-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi,
I tested the e2e function with Python 3.10.11 (Windows 10, 64 bit) and the following packages:
After some tests I put in the following code for yaw, pitch and roll (a little modified values):
# fetch the angle values from web form in degrees
rollAngle = float(request.form.get("RollAngle"))
pitchAngle = float(request.form.get("PitchAngle"))
yawAngle = float(request.form.get("YawAngle"))
qualityValue = int(request.form.get("Quality"))
print("Selected rollAngle, pitchAngle, yawAngle: ", rollAngle, pitchAngle, yawAngle)
...
# use modified values for the torch rotation, pitch angle is kept original
print("Used rollAngle, pitchAngle, yawAngle: ", rollAngle / 2, pitchAngle, -yawAngle)
transform = transforms.ToPILImage()
im = transform(torch_rotation(equi_image, -yawAngle, pitchAngle, rollAngle / 2))
...
@torch.jit.script
def torch_rotation(equi_image: torch.Tensor, yawAngle: float, pitchAngle: float, rollAngle: float) -> torch.Tensor:
# due to memory problems with big panoramas I had to process channels separately
indices = torch.tensor([0])
image_R = torch.index_select(equi_image, 0, indices)
indices = torch.tensor([1])
image_G = torch.index_select(equi_image, 0, indices)
indices = torch.tensor([2])
image_B = torch.index_select(equi_image, 0, indices)
# clean up memory
del equi_image
print("\nProcess red channel")
# Rotate an equirectangular image around one more axes
rotated_equi_R = e2e(
image_R, # Equirectangular image
h_deg=yawAngle, # Vertical rotation/shift, Yaw
v_deg=pitchAngle, # Horizontal rotation/shift, Pitch
roll=rollAngle, # Clockwise/counter clockwise rotation, Roll
mode='bilinear' # Sampling interpolation
)
# clean up memory
del image_R
print("\nProcess green channel")
# Rotate an equirectangular image around one more axes
rotated_equi_G = e2e(
image_G, # Equirectangular image
h_deg=yawAngle, # Vertical rotation/shift, Yaw
v_deg=pitchAngle, # Horizontal rotation/shift, Pitch
roll=rollAngle, # Clockwise/counter clockwise rotation, Roll
mode='bilinear' # Sampling interpolation
)
# clean up memory
del image_G
print("\nProcess blue channel")
# Rotate an equirectangular image around one more axes
rotated_equi_B = e2e(
image_B, # Equirectangular image
h_deg=yawAngle, # Vertical rotation/shift, Yaw
v_deg=pitchAngle, # Horizontal rotation/shift, Pitch
roll=rollAngle, # Clockwise/counter clockwise rotation, Roll
mode='bilinear' # Sampling interpolation
)
del image_B
return torch.vstack((rotated_equi_R,rotated_equi_G,rotated_equi_B))
The original test picture is:

WEB preview (with grid):

Test yaw=45°
For yaw=45° everything is fine.
LOG:

WEB preview (with grid):

preview = result => perfect!
Test roll=45°
For roll=45° I modify the used angle to roll/2.
LOG:

WEB preview (with grid):

preview = result with roll/2 => is this intended?
Test pitch=45°
For pitch=45° I don't understand the result..
LOG:

WEB preview (with grid):

WEB preview of result (with grid):

preview != preview of result (pitch is 45°, but there is also yaw >45°) => this is strange...
I have the following questions:
- Is the use of half roll angle intended?
- How do I achieve the correct pitch result?
Metadata
Metadata
Assignees
Labels
No labels