"optimizer failed to achieve a good alignment" stitching nadir

288 views
Skip to first unread message

Anton Shcherbinin

unread,
May 10, 2019, 8:18:48 AM5/10/19
to pt...@googlegroups.com
Hello,

I'm getting bruises stitching my very first panorama with PTGui 11.12
trial version. New to panoramas and stitching in general, so I may be
missing some "obvious" basics. Any help whatsoever is appreciated.

It's a 360x180 outdoor panorama taken from above the centre of a round
fountain (without water) from a tripod with "Chinese" panoramic adapter.
The source images are 54 = 18 groups of 3: 1 nadir, 1 zenith, 8 groups
with +30 degrees pitch (45 degrees of yaw step), 8 x -30 degrees pitch.
Canon 5D mIV + 17-40mm f/4L at 17 mm and f/8. The 3 images in each group
only differ in exposure (1/128s, 1/256s, 1/32s). I don't have any "nadir
adapter", so the nadir images I had to take from hands, keeping about
the same height of the no parallax point. Unfortunately, my legs and
feet are on the nadir photos, but I believe this should not be *the*
problem.

Running PTGui in "simple" mode gives very mediocre and disappointing
results. The nadir is completely "blended", PTGui couldn't find any
control points to stitch the nadir with the pitch=-30deg images. One of
the -30deg segments is also completely "blended" (blurry with no
details), which is weird. Also, the whole sphere is strangely inclined
(the point PTGui thinks is the nadir is not the real nadir), and the
perfectly circular border of the fountain is a sine curve on the
equirectangular resulting image (instead of expected horizontal line).

I switched to the "manual" mode and spent some 4-5 hours finding control
points on the nadir images binding them to the -30deg images. Corrected
the automatic values for yaw/pitch (what to do with "roll" and how it's
measured in general, I don't know). Ran the optimizer only to get

"The optimizer failed to achieve a good alignment of the images..."

Agreed "to run 'Initialize and Optimize' and got:

Average control point distance: inf
Minimum control point distance: 0.000000
Maximum control point distance: inf

Which means as far as I can guess, the optimizer failed to stitch
anything at all :(

In which direction should I be moving to improve/resolve this?
Thanks!

(Attaching the project file and a screenshot with control points showing
huge "Dist" of 2000-3000 pixels; not attaching 2GB source .cr2 images)
2019-05-09.Buch.pts
2019-05-10T141221.PTGui.Stiching.Nadir.Huge.Dist.jpg

John Houghton

unread,
May 10, 2019, 8:41:12 AM5/10/19
to PTGui Support

On Friday, May 10, 2019 at 1:18:48 PM UTC+1, Anton Shcherbinin wrote:
Hello,

I'm getting bruises stitching my very first panorama with PTGui 11.12
trial version. New to panoramas and stitching in general, so I may be
missing some "obvious" basics. Any help whatsoever is appreciated. 

Anton, This is far too complicated for a first attempt.  Forget about bracketed images for HDR processing until you can get a decent result from a single exposure set of images (i.e. all shot with exactly the same exposure settings, same white balance (not auto), and same focus setting.  Convert your raw images to jpegs, which will be perfectly fine for your first steps. 

Leave the nadir out of the project to start with.  It can be added in later when all the other images are correctly aligned.  Don't worry about apparent distortion such as a wavy horizon or sloping verticals.  These can all be simply corrected at the end in a variety of ways.  One way is to simply drag and rotate the whole panorama image in the Panorama Editor.  window.

Don't overlook the help that is available on the PTGui web site.

John

PTGui Support

unread,
May 10, 2019, 8:46:28 AM5/10/19
to pt...@googlegroups.com
Hi Anton,

You are using the standard version of PTGui, but you need to use PTGui
Pro instead. Only PTGui Pro supports HDR panoramas and viewpoint
correction (which you will need for your nadir image).

You can download the PTGui Pro trial version from the PTGui web site.

I've opened and modified your project in PTGui Pro, see attached my
project file.

I've linked the bracketed images, so PTGui Pro treats each set as one.

For the nadir image, viewpoint correction must be enabled, since it
inevitably suffers from parallax. The optimizer seems to get stuck
attempting to position it. I've manually put the nadir at pitch=-90 and
then re-ran the optimizer.

For viewpoint correction, control points must be placed on a flat
surface only. You will probably need to remove control points manually
(I can't do this without seeing the source images).

Do watch the video tutorials, there are dedicated tutorials about HDR
and about viewpoint correction:

https://www.ptgui.com/videotutorials.html

Hope this helps.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
anton.pts

Murtaza Saifee

unread,
May 10, 2019, 8:47:43 AM5/10/19
to pt...@googlegroups.com
Could you please tell me how to stitch nadir. I am tired of patching Nadir. 

Murtaza Saifee.

PTGui Support

unread,
May 10, 2019, 8:54:25 AM5/10/19
to pt...@googlegroups.com
Please see:

https://www.ptgui.com/videotutorials.html
Part 7

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com

On 5/10/2019 14:47, Murtaza Saifee wrote:
> Could you please tell me how to stitch nadir. I am tired of patching Nadir.
>
> Murtaza Saifee.
>
> --
> 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 post to this group, send email to pt...@googlegroups.com
> <mailto:pt...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ptgui.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/CAAjJwukGhy48nMheGqHXMyrPNTq%2BUDdDwFu0qGT39fa_w4CDuw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ptgui/CAAjJwukGhy48nMheGqHXMyrPNTq%2BUDdDwFu0qGT39fa_w4CDuw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

John Houghton

unread,
May 10, 2019, 9:03:03 AM5/10/19
to PTGui Support
Anton.  I have simplified your project by including only one exposure set and excluded the nadir.  Load my attached project file into the same folder/directory as your image files, and then open it with PTGui using the File menu option.  The panorama should look reasonable in the Panorama Editor window so you should be able to create an output panorama image.

John
2019-05-09.Buch-jh.pts

Anton Shcherbinin

unread,
May 10, 2019, 2:07:39 PM5/10/19
to pt...@googlegroups.com
Fri, 10 May 2019 14:46 +0200, PTGui Support wrote:
> You are using the standard version of PTGui, but you need to use PTGui
> Pro instead. [...skip...]
> I've opened and modified your project in PTGui Pro

Thank you so much, Joost!
I just switched from PTGui trial to PTGui Pro trial, used the project
you sent and it changes everything, the nadir gets stitched perfectly
with a typical "Dist" of 3-6 pixels instead of 3000.

One original issue is still unsolved, though. One of the segments is
very blurry on the preview. See attached
2019-05-10.pano.preview.img.11.blurry.jpg

There's obviously something wrong, but I cannot understand what exactly.
This segment (source image 11) has many dozen automatically found
control points (up to 200 per pair of adjacent images), so the problem
seems not to be in the control points. In the Panorama Editor, this
image 11 is visibly much darker (almost black) than the others (see
attached 2019-05-10.Pano.editor.img.11.darker.jpg) The real source image
is not darker than the rest (see attached
2019-05-10.source.img.11.sharp.jpg )

So it looks like PTGui is "highlighting" this image 11 for some reason,
but I don't understand the message or the reason why.

> Do watch the video tutorials, there are dedicated tutorials about HDR
> and about viewpoint correction:

I've watched the very first introductory video, it is quite good. I
promise to watch the others a bit later :)

Thank you very much for your prompt help and have a good weekend!
2019-05-10.Pano.editor.img.11.darker.jpg
2019-05-10.pano.preview.img.11.blurry.jpg
2019-05-09.Buch.pro.pts
2019-05-10.source.img.11.sharp.jpg

Erik Krause

unread,
May 10, 2019, 2:55:06 PM5/10/19
to pt...@googlegroups.com
Am 10.05.2019 um 16:07 schrieb Anton Shcherbinin:
> So it looks like PTGui is "highlighting" this image 11 for some reason,
> but I don't understand the message or the reason why.

PTGui tries to make it brighter so it fits with the other images. This
results in very reduced contrast. Appear you chose the wrong exposure
for this image.

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

John Houghton

unread,
May 10, 2019, 3:10:40 PM5/10/19
to PTGui Support

On Friday, May 10, 2019 at 7:07:39 PM UTC+1, Anton Shcherbinin wrote:

So it looks like PTGui is "highlighting" this image 11 for some reason,
but I don't understand the message or the reason why.

 Anton, You need to select HDR mode on the Exposure / HDR tab.  What happens then is that PTGui is able to divide the images into three sets, corresponding to the three exposures used in the bracketing.  The images in each set will then be separately stitched into three panorama images called blend planes.  These blend planes are then merged together using either HDR processing or a fusion process.  You can try each way and see which you prefer.  You can also output the three blend plane images separately on the create panorama tab. Visual examination of the three blend planes may go some way to finding an explanation for the black image.

John

Anton Shcherbinin

unread,
May 10, 2019, 5:31:05 PM5/10/19
to pt...@googlegroups.com
Fri, 10 May 2019 12:10 -0700, John Houghton wrote:
> Anton, You need to select HDR mode on the Exposure / HDR tab.
[...skip...]
> You can also output the three blend plane images separately on the
> create panorama tab. Visual examination of the three blend planes may
> go
> some way to finding an explanation for the black image.

Thanks a lot for your help, John. I also appreciated you previous 2
messages. You are right beyond doubt, my setup was way too complicated
for the first try. However, I need a realistic and inspiring (eye
pleasing) pano to make myself pay 100 or 200 Euros for a stitching
program. And this "eye pleasing" is difficult to achieve without
HDR/bracketing in a scene with bright clouds and dark shadows.

I'll try what you are suggesting at the weekend. What makes me wonder is
that Photoshop just silently and, literally, seamlessly, merged the 3
images around the "problematic" one. It merged 3 .cr2 images, though,
not the 3 bracketed sets of 3 images each.

Have a good weekend.
2019-05-10.Images.10-11-12.merged.by.Photoshop.jpg

PTGui Support

unread,
May 11, 2019, 4:04:46 AM5/11/19
to pt...@googlegroups.com
Hi Anton,

I checked your 2019-05-09.Buch.pro.pts but it does not explain why the
image is darker. It has the same exposure sequence and PTGui is not
adjusting its exposure.

If you could make the source images available (or a subset around image
11) I'd be happy to take a look.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com

Anton Shcherbinin

unread,
May 11, 2019, 4:13:10 PM5/11/19
to pt...@googlegroups.com
Sat, 11 May 2019 10:04 +0200, PTGui Support wrote:
> I checked your 2019-05-09.Buch.pro.pts but it does not explain why the
> image is darker. It has the same exposure sequence and PTGui is not
> adjusting its exposure.

Yes, I checked this as well.

> If you could make the source images available (or a subset around image
> 11) I'd be happy to take a look.

Very nice of you. Here are the source 54 .cr2 images just in case:
https://drive.google.com/open?id=1MuVs98woCykoHZkhmRjPFqk9BuPfvjT7
The updated project file is also in this Google Drive folder.

However, I did what John Houghton suggested (on the Exposure/HDR tab,
switched the HDR radio button from "No bracketing: ..." to "Group
bracketed exposures into separate blend planes (for HDR panoramas)"
and the "Merge the blend planes using" radio button to "Exposure fusion"
(didn't touch the "exposure fusion settings").

The strange phenomenon with image 11 being much darker than the rest in
Panorama Editor disappeared. (attaching a screenshot) Also, the whole
segment of the resulting panorama taken from image 11 is not so blurry
any more, and 3 seams out of 4 are virtually invisible. The 4th seam,
between images 11 and 3 (pitch=-30 deg and +30 degrees)
is still quite visible, but the reason can be in a long pause between
these images (3 minutes) and the sun being behind clouds in the image
11, but not image 3.
2019-05-11T2145.Panorama.Editor.ok.jpg

John Houghton

unread,
May 12, 2019, 8:25:16 AM5/12/19
to PTGui Support

On Saturday, May 11, 2019 at 9:13:10 PM UTC+1, Anton Shcherbinin wrote:
Here are the source 54 .cr2 images just in case:
https://drive.google.com/open?id=1MuVs98woCykoHZkhmRjPFqk9BuPfvjT7

Anton, Just a few comments on your project:

It really is worth converting the raw images with a decent raw converter and correcting chromatic aberration.  The attached comparison shows how much better the quality is from tiff images generated with Photoshop's ACR converter.  There's no contest.

For the hand-held nadir shot, you should unlink the three images since they will be shot from slightly different viewpoints, so it's not appropriate to force them to share identical yaw, pitch and roll parameters. Unlinking improves the optimization figures. Note that linking does not affect the division of images into blend planes at all.

The panorama will benefit from being levelled to get the vertical features properly vertical.  There's no shortage of vertical features on which you can create vertical line control points.  See tutorial at http://www.johnhpanos.com/levtut.htm .

John
raw-comp.jpg

Anton Shcherbinin

unread,
May 13, 2019, 8:16:32 AM5/13/19
to pt...@googlegroups.com
Hello John,

can't express how grateful I am. Did all that you suggested:

> It really is worth converting the raw images with a decent raw
> converter and correcting chromatic aberration.

Converted all the raw images to max quality JPEGs using Adobe Camera
Raw. Was not sure if to correct distortion etc. in ACR or to leave this
to PTGui, so in ACR I only checked the box to correct chromatic
aberration. Also, I chose ACR settings for the 1st photo manually and
then applied these settings for every photo.

> For the hand-held nadir shot, you should unlink the three images

Understood and done.

> Note that linking does not affect the division of images into blend
> planes at all.

Important detail which was not obvious, got it.

> The panorama will benefit from being levelled to get the vertical
> features properly vertical. There's no shortage of vertical features
> on which you can create vertical line control points. See tutorial
> at http://www.johnhpanos.com/levtut.htm .

I find the tutorial very useful. The most difficult part, being
impatient, was reading it to the end. I added 2-3-4 vertical control
"points" to most images (except the nadir and zenith) and was
disappointed when all these verticals were still not vertical
("meridians") on the resulting pano . Then I had to read the tutorial
further :) to learn how to do "levelling". The theory is still not very
clear (what exactly levelling and straightening do and what the
difference is), but the result is there: the houses do not "lean"
sideways any more :)

Thank you so much for all your advice, John.

John Houghton

unread,
May 13, 2019, 9:44:13 AM5/13/19
to PTGui Support

On Monday, May 13, 2019 at 1:16:32 PM UTC+1, Anton Shcherbinin wrote:
The theory is still not very
clear (what exactly levelling and straightening do and what the
difference is), but the result is there: the houses do not "lean"
sideways any more :) 

Anton, Straightening will generally level the panorama if the panorama head's vertical axis of rotation was exactly vertical.  Otherwise, levelling with vertical line control points will be much more accurate.  A picture is worth a thousand words: See attached comparison.

Just one other comment. To minimize problems with your zenith image alignment: shoot it first, immediately before you start the upper row.  Clouds have time to shift a long way if you shoot it after both rows, as your example clearly shows. You zenith image doesn't match the sky in the upper row at all closely, which means you really need to manually align it as best you can and use masks to get as good a blend as you can.

John

 
straight-level.jpg
Reply all
Reply to author
Forward
0 new messages