Pitch-Horizon problem

163 views
Skip to first unread message

PeterPT

unread,
Apr 2, 2022, 6:49:43 AM4/2/22
to PTGui Support
Hello to everybody.
I have a strange problem stitching an image (handheld) that I took from the top of St Peter's Dome, Rome. 

As you can see from the attached image (screen of PTGui Panorama Editor) Horizon is wholly 'shifted up' by some degrees: it is not aligned with the central line.
Consequently in the viewers the pano becomes somehow 'barreled'. 
> Standard settings of PTGui are used + I tried to introduce vertical and/or horizontal CPs but nothing changed. 

Any suggestion?
Many thanks in advance.
Pietro Madaschi
2022-04-02-OrizzonteRoma120225.jpg

Erik Krause

unread,
Apr 2, 2022, 9:02:03 AM4/2/22
to pt...@googlegroups.com
Am 02.04.2022 um 12:49 schrieb PeterPT:
> As you can see from the attached image (screen of PTGui Panorama Editor)
> Horizon is wholly 'shifted up' by some degrees: it is not aligned with the
> central line.

Most likely PTGui tries to compensate for parallax errors in the images
with foreground. If you didn't already, you can try to use viewpoint
correction for those images, that sometimes fixes such problems.

Another approach would be to first stitch only the images containing the
horizon and sky. Once those line up perfectly you can fix them in place
by disabling all optimizations for them and stitch the other images.

--
Erik Krause
http://www.erik-krause.de

John Houghton

unread,
Apr 2, 2022, 10:23:50 AM4/2/22
to PTGui Support
Pietro, If Erik's good suggestions don't solve your problem to your satisfaction, I would proceed as follows:  Load in your existing project file (as used for your screen shot) and delete all control points.  Turn off the display of the sky images  by unselecting them in the Include Images list on the Create Panorama tab.  Then assign control points only at or near the horizon between neighbouring images for images 1-17 using the "Generate control points here" function. (Drag out a long thin selection box to select the horizon area each time).  Run optimize, and you should see a perfectly aligned horizon in the right position, because the features near the horizon are far away and therefore not affected by parallax issues.

Next, Uncheck the y,p,r settings for images 1-17 on the Advanced screen of the Optimizer tab.  This locks them in position.  Assuming that there are stitching glitches in the foreground buildings due to parallax, you could then add the images 1-17 a second time and align them  with further control points to the existing set using viewpoint correction only on the second set to align them as well as possible.  Mask away the tops of the second set and the bottoms of the first set  to merge the two sets towards the horizon where they should align reasonably well.  The optimum seams blending option should then clean up the general alignment.  Lock the second set of 17 images also in position, and create control points for the sky images to align them with the images below and switch them back on in the Include Images list.

John

PeterPT

unread,
Apr 4, 2022, 6:50:09 AM4/4/22
to PTGui Support
Hello
Erik and John thank you for you prompt feedback!
I come back to you only now because during the WE I made several 'experiments'. Unfortunately unsuccessfully.
I performed further testing (hopefully correctly) as per your hints. 
After following Erik's suggestion (no success) I tried also John's procedure. 
Result: I achieved a good horizontal line only setting a mere couple of CPs (on the real horizon) between the adjacent images, with Optimizer setting: YPR unchecked and Viewpoint 'keep'.
BUT when I add additional (far away) CPs between the images the Horizon goes up again bringing the previous 'barrel' effect (tested various ways).
... so I am still stuck ... but not giving up
Pietro
Note: Sony a7r2, Canon 8-15 @15mm f8.

Erik Krause

unread,
Apr 4, 2022, 7:50:11 AM4/4/22
to pt...@googlegroups.com
Am 04.04.22 um 12:50 schrieb PeterPT:

> I am still stuck ... but not giving up

By all means, make a set of half size jpegs available for download (use
dropbox, wetransfer etc.) so we can have a try.

--
Erik Krause

PTGui Support

unread,
Apr 4, 2022, 7:52:27 AM4/4/22
to pt...@googlegroups.com
Hi Pietro,

You might try the workflow outlined in 5.6:
https://ptgui.com/support.html#5_6

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
> --
> You received this message because you are subscribed to the Google
> Groups "PTGui Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ptgui+un...@googlegroups.com
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/8bbc9214-cd40-4093-ac66-b550b1ffba7bn%40googlegroups.com
> <https://groups.google.com/d/msgid/ptgui/8bbc9214-cd40-4093-ac66-b550b1ffba7bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

John Houghton

unread,
Apr 4, 2022, 8:07:57 AM4/4/22
to PTGui Support
On Monday, April 4, 2022 at 11:50:09 AM UTC+1 PeterPT wrote:
 I tried also John's procedure. 
Result: I achieved a good horizontal line only setting a mere couple of CPs (on the real horizon) between the adjacent images, with Optimizer setting: YPR unchecked and Viewpoint 'keep'.

Pietro, Having got a nice straight horizon, properly centered vertically, you should have continued with my suggestion of adding the row a second time as described and aligning those to the locked set of images already aligned.  But as Erik suggests, please make your images available for download so we can see if we can do any better.

John

PeterPT

unread,
Apr 4, 2022, 1:23:04 PM4/4/22
to PTGui Support
Erik, John, Joost thanks a lot for your suggestions.
Joost: your 5.6 workflow seems to work for the horizon (minor manual adjustment), but the buildings are definitively too slanted ...
John: when I added the second time the images with my previous setting I had a change in Horizon level. I will try with Joost's 5.6.
Erik: I have sent the 16 .jpg via WeTransfer to support mail.
In the meantime I will continue some tests. 
Thanks very much. Pietro

John Houghton

unread,
Apr 4, 2022, 2:05:48 PM4/4/22
to PTGui Support
Pietro, I'm not part of PTGui Support.  Would you permit Joost to share the images with me (and Erik, I presume)?

John 

Pietro Mad

unread,
Apr 4, 2022, 2:13:34 PM4/4/22
to pt...@googlegroups.com
Absolutely yes … I permit that Joost  shares the images to you and Erik. Thanks again.
Pietro 


Inviato da iPhone

Il giorno 4 apr 2022, alle ore 20:05, John Houghton <houghto...@gmail.com> ha scritto:

Pietro, I'm not part of PTGui Support.  Would you permit Joost to share the images with me (and Erik, I presume)?
--
You received this message because you are subscribed to a topic in the Google Groups "PTGui Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ptgui/tF7_wvT1LqA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ptgui+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ptgui/30f867a5-fcf5-4276-8f80-e5661ab9f02fn%40googlegroups.com.

Erik Krause

unread,
Apr 4, 2022, 5:20:07 PM4/4/22
to pt...@googlegroups.com
Am 04.04.2022 um 19:23 schrieb PeterPT:

> I have sent the 16 .jpg via WeTransfer to support mail.

...which Joost kindly forwarded to me.

I've attached my project file. What I did is the following:

I loaded all images in PTHui, then masked one image such that only the
horizon is visible. I copied the masks to all images in Source Images
tab, then generated control points and optimized. Horizon was still too
high.

I deleted control points from non-adjacent images and such too far below
the horizon, then optimized again. I saw that the shift values where
relatively large, so I reseted them. On the next optimize the horizon
moved even below the center line. I had to level it a bit.

After clearing all the masks I switched off optimization for Pitch (to
keep the horizon) and enabled viewpoint correction for all but the first
image. Then I created control points for the city middleground, avoiding
the roof. After optimizing I got this result.

Actually it's a kind of "Flying Willy", where you walked around the
platform, with enormous parallax in the foreground, of course. Optimum
Seam made a mess of the roof, so I switched it off. It would be good for
the city, though, where there are quite a few stitching errors. But in
that case you would need to paint narrow masks, such that the pattern of
the roof is kept.
7zEC70C987C.pts

John Houghton

unread,
Apr 5, 2022, 3:02:45 AM4/5/22
to PTGui Support
Pietro, My effort is attached.  It generally looks quite good, though you might think the horizon position still isn't quite right.  However, the terrain isn't flat and the true horizon is barely visible - i.e. where the sea horizon line might be.  But I aligned the images on the distant parts of the images near the horizon and assigned many vertical line control points on distant features to level the panorama.  I optimized with the option to include the vertical line points in the first pass of the optimizer.  So the horizon should be close to the correct position.  If you check the project file settings, on the Optimizer tab, you will see that all the lens parameters and all the y,p,r parameters are unchecked for the first set of images 1-16.  Their values are therefore retained from the initial alignment and levelling performed.  After adding the images a second time, control points were added and viewpoint correction selected for just those those images.  Hence running the optimizer will not disturb the alignment and levelling of the first set.  NB.  Levelling using vertical line control points  with the option to include those points in the second pass of the optimiser will allow all images to change position to achieve levelling, even if their y,p,r parameters are unchecked.  Masks allow only the lower parts of the second set to make it through to the final panorama so as to preserve the horizon in the first set.

John

_DSC1388 Panorama-JOOST-1-okHOR-Slant-jh.pts

PeterPT

unread,
Apr 5, 2022, 6:31:27 AM4/5/22
to PTGui Support
Erik, John and Joost
Thanx very much for your excellent support!
You did such a great work so enthusiastically, fast and professionally: it should be an example to all of us!

ERIK: It is indeed a 'Flying Willy' style. Thanks also for your hint of disabling Optimum Seam. 
JOHN: You did really a huge/incredible effort adding/optimizing/adjusting/levelling all the images. Thanks so much.
JOOST: PTGui it is really a mine of resources an I admit I am not so disciplined in reading thoroughly your texts. Thanks for the help.

After your support, it is clear to me that the solution is not that obvious/unique.
So I will deeply analyze your work to better understand the rationale/procedure and go on subsequently for the panorama creation.
A heartly thanks to all of you!
Pietro



PeterPT

unread,
Apr 17, 2022, 9:43:13 AM4/17/22
to PTGui Support
Many thanks to Erik, John, Joost ... and the the final result is:
https://bit.ly/3xecyLw

John Houghton

unread,
Apr 17, 2022, 12:59:29 PM4/17/22
to PTGui Support
Peter, Thanks for letting us see the final result.  You have done well!

John

jürgen eidt

unread,
Apr 17, 2022, 2:45:42 PM4/17/22
to PTGui Support
I like it very much! You took care of all the details.
Especially because it is handheld. Thats a huge challenge.

Jürgen
Reply all
Reply to author
Forward
0 new messages