Adjusting the yaw, pitch and roll of two equirectangular panorama in one view

183 views
Skip to first unread message

DerekS

unread,
Nov 16, 2022, 12:01:27 PM11/16/22
to hugin and other free panoramic software
Hi, 

I often use Hugin to correct the pitch and roll of an equirectangular panorama taken with a 360 single shot camera.

However I would like to be able to do this with two equirectangular panorama stacked on top each over so that the yaw, pitch and roll of one can be adjusted  to match the alignment of the other. The top panorama would have to have 50% opacity so that you could see what you where doing.

I expect that this is a unique application, but if you great guys have a practical solution I would gladly hear it.

Many thanks

Derek

dkloi

unread,
Nov 16, 2022, 6:22:16 PM11/16/22
to hugin and other free panoramic software
Have you tried adding control points between the 2 images and then optimising the yaw, pitch, roll of just one of them?

DerekS

unread,
Nov 17, 2022, 8:34:02 AM11/17/22
to hugin and other free panoramic software
Hi dkloi

Interesting idea, that I been playing with at your suggestion.  

I loaded in the two panorama, and added control points, and the selected optimise.  Various Yaw, Pitch, and Roll values were applied to both images, the yaw -135 which made it difficult to compare to the originals. 

So I tried again, anchoring the position of image zero, added the control points and selected optimise again.  On the preview image zero is badly distorted.  It's hard to tell if image 1 is changed. In the advanced user tab, image zero has 0 Yaw, 18.5 pitch, 64.1 roll, far to much, hence the distortion, whilst image 1 has 0 yaw, 0 pitch, roll 0.

I'm assuming you had something else in mind when you made the suggestion, what might I being doing wrong?


Kind regards


Derek

Bruno Postle

unread,
Nov 17, 2022, 9:26:53 AM11/17/22
to hugin and other free panoramic software
Have you set the projection of both input images and the output panorama to equirectangular?

DerekS

unread,
Nov 17, 2022, 12:28:13 PM11/17/22
to hugin and other free panoramic software
Hi Bruno

Indeed the lens type for both input image is being read by Hugin as equirectangular, and the output automatically set to equirectangular.

Thanks


Derek

dkloi

unread,
Nov 22, 2022, 1:46:56 PM11/22/22
to hugin and other free panoramic software
Can you share your 2 images? They can jpgs if that makes it easier to transfer. It should be quite straightforward to align them

DerekS

unread,
Nov 22, 2022, 3:49:30 PM11/22/22
to hugin and other free panoramic software

Sure. Here are two examples.

I would be looking for an easy process to align image 2 with image 1.  In reality there would also be images 3 and 4 that would also need to be aligned with image 1.

Many thanks and kind regards

Derek


IMG_20200717_172605_00_merged_nadir-1.jpg
IMG_20200717_172605_00_merged_nadir-2.jpg

dkloi

unread,
Nov 23, 2022, 2:16:29 PM11/23/22
to hugin and other free panoramic software
Here's the Hugin project file. I've tried to align it as best as I can but you have some noticeable parallax which prevents the two panoramas lining up perfectly.
IMG_20200717_172605_00_merged_nadir-1 - IMG_20200717_172605_00_merged_nadir-2.pto

DerekS

unread,
Nov 24, 2022, 4:18:05 AM11/24/22
to hugin and other free panoramic software
Hi dkloi

Thank you for taking this on.

I should explain that the parallax is deliberate, as these two panoramas are taken from a 360 camera rotated at a distance of approximately 32mm from a centre point, by 90 degrees. As mentioned above, there are actually four panoramas, the 1st taken at 0 degrees rotation, 2nd 90 degrees, 3rd 180 degrees, 4th 270 degrees. A 3D panorama can then be viewed by showing the left and right eye the appropriate section of each panorama, it works well in a google cardboard style headset. Example of earlier work here at https://www.virtualmountains.co.uk/GorskiKotarV50/TourControlV50_8_7.html

Unfortunately some inaccuracy in the camera gyro and likely some flexibility in my equipment means that what may be vertical in one panorama is leaning a little in another, and the horizon is higher or lower from panorama to panorama.

So what I'm trying to achieve is to find an easy way to correct the pitch and roll so that each panorama is better aligned.

The pitch and roll of 0.4 and -0.6 found in your pto are typical of the corrections I have to apply.

When I added the two panorama to Hugin, a yaw of -135 is applied to the first image, and 135 to the second.  What are you doing to prevent this?

After adding the control points, are you just selecting optimize to get the best pitch and roll values, or am I missing a stage?

Is there an simple way to export the 2nd panorama alone, with the pitch and roll of 0.4 and -0.6 applied, or do you recommend manually applying these correction values in the "Move/Drag" tab?

All the best

Derek 



dkloi

unread,
Nov 25, 2022, 6:02:11 AM11/25/22
to hugin and other free panoramic software

What you can do is custom optimise and choose what parameters you want to keep fixed on the optimise tab that comes up. Make sure the parameters for the 1st panorama are fixed (unticked) and that the lens parameters are also unticked. Then just optimise the y, p, r parameters of the 2nd image.

To export just the 2nd pano with the adjusted parameters, in the preview window you can select only the 2nd panorama, hide the other one. Then when you export, it will only use the selected image.

Since you have deliberate parallax, you should try to select control points on objects as far away from the camera as possible.

DerekS

unread,
Nov 26, 2022, 4:37:42 PM11/26/22
to hugin and other free panoramic software
Hi dkloi

Thank you again for your further assistance.  I'm 99% of the way there now.  My control points were in different places than yours, and so I got a different yaw, pitch, and roll than you.  I tried both in a 3D viewer I created and neither result are ideal. The reason that uprights post of the signpost are not parallel to each other.  Rather a Yaw of around 0.4, Pitch of 1.3, and Roll of around -1.1 seem to be a better fit.  Adding lots more control points helps a little, but it seems to be trial and error rather that a precise science.  I'm going to have to give this some more thought.

Best wishes


Derek

dkloi

unread,
Nov 27, 2022, 8:16:19 AM11/27/22
to hugin and other free panoramic software
The main issue is the deliberate parallax for stereoscopic imaging. You will only be able to get good alignment if your control points are on objects as far away from the camera position. In principle, you will only need 2 pairs of control points to align 2 panoramas with y, p, r adjustment. Initially, try to find 2 pairs of control points that are 90 degrees apart from each other and on object as far away as you can find. You can then add more pairs of control points to see if you converge on a good solution.

If you want to fix verticals, then you can place a pair of vertical control points on each image. Yaw the images so that the vertical control point pair on the reference pano is at 0 deg yaw and then allow the roll of the reference image to also be optimised. The other image vertical control point pair should also try to be optimised to be vertical.

See attached PTO file. You can see the very significant parallax (that you want) but this diminishes for parts of the scene further away from the camera.

Aligned Verticals.pto
Reply all
Reply to author
Forward
0 new messages