Calculate Optimal Size Shifting Control Point Distance

44 views
Skip to first unread message

Alexander Drecun

unread,
Oct 12, 2022, 12:58:00 AM10/12/22
to hugin and other free panoramic software
Hey all,

I'm attempting to stitch a mosaic panorama in 2021.0.0 on OSX and am running into an issue with "calculate optimal size." I've gone through the recommended steps to assemble the panorama - add images, create control points, optimize - at which point I end up with an average control point distance of .073 and a max distance of 1.63, and when I select "edit CP" in the Preview window, the control points are all green. This is with the canvas size at 3000 x 1500 and the panos I've stitched from this size have worked.

The issues begin when I click "calculate optimal size." The control point distances explode with an average control point distance of 97 and a max distance of 1065. Additionally, now all of the control points in the Preview window are red and the panos I've attempted to stitch from this point haven't worked. Basically, they look like four or five separate tiles, each made up of two or three images stitched together.

I'm not sure how else to describe this problem, so I've attached a .pto file and can include screenshots if that helps.

Thanks!

Alex
White Line Sample.pto

Terry Duell

unread,
Oct 12, 2022, 6:44:59 PM10/12/22
to hugi...@googlegroups.com
Hello Alexander,

On Tue, 2022-10-11 at 21:58 -0700, Alexander Drecun wrote:
> Hey all,
>
> I'm attempting to stitch a mosaic panorama in 2021.0.0 on OSX and am running
> into an issue with "calculate optimal size."

Out of curiosity more than any belief that I could really help, I had a bit of a
snoop around your project.
My first attempt involved using Panotools-script 'ptodummy' with your pto file
to see if it showed anything useful, but it failed...not sure if that was due to
an issue with the tool or with your pto file.
I then ran the pto file through ptoinfo, which produced the following partial
output...
--------------------
[terry@localhost test]$ ptoinfo test.pto
---
Hugin project file: test.pto
Project:
Number of images: 20
Dimensions: 1772069x174631
Megapixels: 295122.3
Format: Rectilinear
Horizontal Field of View: 159
File type: "TIFF_m c:LZW r:CROP"
Exposure Value: 9.64386
Stitching mode: LDR
Selection area: 0,944823,0,174631
blender: enblend
hdrmergeOptions: -m avg -c
optimizeReferenceImage: 0
optimizerMasterSwitch: 0
optimizerPhotoMasterSwitch: 21
outputImageType: png
outputImageTypeCompression: LZW
outputImageTypeHDR: exr
outputImageTypeHDRCompression: LZW
outputJPEGQuality: 90
outputLDRBlended: true
outputLayersCompression: LZW
outputLayersExposureDiff: 0.5
outputRangeCompression: 0
outputStacksMinOverlap: 0.7
ptoversion: 2
remapper: nona
Gamma: 1
Interpolator: poly3
Huber Sigma: 2
Photometric Huber Sigma: 0.00784314
Number of stacks: 1
Stack 0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19
Number of exposure layers: 1
Layer 0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19
Number of connected group(s): 1
Group 0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19
Normal control points: 945
Average normal control point error: 60414.1247097716
Maximum normal control point error: 99814.1252741164
-----------------------
The control point errors shown here look pretty large.
The other thing that comes to mind is that you say "they look like four or five
separate tiles, each made up of two or three images stitched together".
Have you looked at the control points linking the 'tiles'?

Not sure whether any of that helps, but good luck and hope someone who knows a
bit more will chime in with some real help.

Cheers,
--
Terry Duell <tdu...@iinet.net.au>

Alexander Drecun

unread,
Oct 12, 2022, 6:55:05 PM10/12/22
to hugi...@googlegroups.com
So what's curious is that the pano doesn't look like tiles in Hugin. That comes only once I've stitched it and opened it in another application like Photoshop. The pano at 3000x1500 canvas and at the optimal size canvas look identical except that the control points have gone from great to terrible. This is what it looks like in the Preview window before and after I calculate optimal size. It's bizarre.

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to a topic in the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hugin-ptx/x19xUMam9PY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/f3e8fcb157f336ff8b7b704d8c63b30a85dc4e64.camel%40iinet.net.au.
Screen Shot 2022-10-11 at 9.33.03 PM.png
Screen Shot 2022-10-11 at 9.36.22 PM.png

Bruno Postle

unread,
Oct 13, 2022, 2:02:10 PM10/13/22
to hugin and other free panoramic software
The control point error is reported in terms of pixels in the output panorama. So if 'calculate optimal size' changed your 3000x1500 panorama into a 30000x15000 panorama then all the control point distances will be ten times bigger. The output will look the same but with higher resolution.

You have a single row of images, so the canvas size (in pixels) of your panorama should be about the same height as your input images. Rather than clicking on 'calculate optimal size' (which isn't working for you), I would directly enter a canvas size that is a bit more reasonable.

I suspect the problem is that very wide rectilinear panoramas are not ideal for this automatic calculation.

-- 
Bruno

Kornel Benko

unread,
Oct 15, 2022, 11:54:32 AM10/15/22
to hugi...@googlegroups.com
Am Thu, 13 Oct 2022 19:01:53 +0100
schrieb Bruno Postle <br...@postle.net>:

> The control point error is reported in terms of pixels in the output
> panorama. So if 'calculate optimal size' changed your 3000x1500 panorama
> into a 30000x15000 panorama then all the control point distances will be
> ten times bigger. The output will look the same but with higher resolution.
>
> You have a single row of images, so the canvas size (in pixels) of your
> panorama should be about the same height as your input images. Rather than
> clicking on 'calculate optimal size' (which isn't working for you), I would
> directly enter a canvas size that is a bit more reasonable.
>
> I suspect the problem is that very wide rectilinear panoramas are not ideal
> for this automatic calculation.
>

Would be nice to have an option to see the distances proportional to the angle.
Something like (angle * 1000 / PI)

Kornel

T. Modes

unread,
Oct 16, 2022, 12:24:37 PM10/16/22
to hugin and other free panoramic software
bruno...@gmail.com schrieb am Donnerstag, 13. Oktober 2022 um 20:02:10 UTC+2:
You have a single row of images, so the canvas size (in pixels) of your panorama should be about the same height as your input images. Rather than clicking on 'calculate optimal size' (which isn't working for you), I would directly enter a canvas size that is a bit more reasonable.

I suspect the problem is that very wide rectilinear panoramas are not ideal for this automatic calculation.

For the given pto file the automatic size calculation works fine. I assume you pressed first "calculate optimal size" (which was using a way too high HFOV) and then "calculate FOV". The order of the buttons on the stitcher tab should guide you in which order the things should calculated: first calculate FOV and than optimal size, then you get the correct numbers.


T. Modes

unread,
Oct 16, 2022, 12:26:51 PM10/16/22
to hugin and other free panoramic software
Hi Kornel,
kornel schrieb am Samstag, 15. Oktober 2022 um 17:54:32 UTC+2:

Would be nice to have an option to see the distances proportional to the angle.
Something like (angle * 1000 / PI)

That would not work for most projections. Here the angle is depended on the (x/y) position and so the outer cp would calculate a much higher error then the central cps.
Furthermore it collides the way line cp are taken into account.

Reply all
Reply to author
Forward
0 new messages