Improving non-panoramic output result

49 views
Skip to first unread message

Martim Passos

unread,
Jul 2, 2025, 5:20:24 PMJul 2
to hugin and other free panoramic software
Hi, I'm stitching non-panoramic images of a map and, after reading the flat scan tutorial and some threads here about doing one or two images at a time, parameter optimization order, etc, I achieved what I believe to be a decent result. The main issue is that the top row seems pitched, even though I was very cautious with camera leveling and distance to subject (not as much with consistent overlapping I'm afraid)

I wonder if anyone more experienced could help me go a step further? The source images can be found in this Google Drive folder, and the project file is attached below.

I'm happy to try improving it myself if anyone provides pointers too. Thanks!
1965_01 - 1965_26.pto

wirz

unread,
Jul 2, 2025, 6:51:22 PMJul 2
to hugi...@googlegroups.com
Hi,

I gave that a quick try, see attached. (One can easily fine tune that
further.)

Looking at your version: I think it is harmful to optimise plane pitch
and yaw here; the first lens parameters should be optimised (eg a and
b); given that there is a grid it is helpful and very easy to define a
few horizontal and vertical lines; you can remove many control points
that are in areas of low contrast, especially the water, because you
can't trust them.
However, there are limits to what one can expect as the map is not
completely flat.

cheers, lukas wirz


On 02/07/2025 23:42, Martim Passos wrote:
> Hi, I'm stitching non-panoramic images of a map and, after reading the flat
> scan tutorial and some threads here about doing one or two images at a
> time, parameter optimization order, etc, I achieved what I believe to be a
> decent result. The main issue is that the top row seems pitched, even
> though I was very cautious with camera leveling and distance to subject
> (not as much with consistent overlapping I'm afraid)
>
> I wonder if anyone more experienced could help me go a step further? The
> source images can be found in this Google Drive folder
> <https://drive.google.com/drive/folders/1LGUipCbT6L9Rn2Jkie9CRsAPzqLXp7Bq?usp=drive_link>,
1965_01-1965_26_mine.pto

Martim Passos

unread,
Jul 3, 2025, 9:37:06 AMJul 3
to hugin and other free panoramic software
Looks great, thank you so so much! In the future, should I optimize lens parameters before or after aligning the images? Also, I see you left X, Y and Z unchecked for a particular image and checked all parameters for the anchor image too, can you explain the rationale? I though I was supposed to leave the anchor image unchecked. Was that the last one to be optimized? 

After a lot of trial and error, my workflow was to:
  • Import all images and detect control points
  • Clean obviously bad control points (normally when there's only 5 or so in images that don't overlap)
  • Select only one image at a time, start with XYZ, add Yaw, Pitch and Roll, then plane yaw and pitch
  • If the error was under 1unit, move on, else try a different order for the parameters, another neighboring image, or review CPs
After all images were aligned, I would go to the Move/Drag tab and try to get it level. Throughout the process the alignment looked good but the map was very skewed. Is there a better way of doing so (like straighten/keystone in Capture One or PS), or is this fixed by the line CPs?

Thanks again!

wirz

unread,
Jul 3, 2025, 6:08:38 PMJul 3
to hugi...@googlegroups.com
Hi,

> In the future, should I optimize lens
> parameters before or after aligning the images?

I don't think there is a clear argument for either order.

> Also, I see you left X, Y
> and Z unchecked for a particular image and checked all parameters for the
> anchor image too, can you explain the rationale? I though I was supposed to
> leave the anchor image unchecked. Was that the last one to be optimized?

What I did there wasn't exactly what I was intending to do. The plan was
to choose some image near the centre (eg, 09.tif, but any works), leave
yaw and pitch constrained to zero, optimise roll, don't optimise x/y/z
of that image. Roll can be optimised when you define some
vertical/horizontal lines. yaw/pitch/x/y/z of one image that can be
chosen freely are redundant degrees of freedom, so you can choose them
to be 0 (or any other value). After that the image should be nicely
horizontal without any manual alignment.

> After a lot of trial and error, my workflow was to:
>
> - Import all images and detect control points
> - Clean obviously bad control points (normally when there's only 5 or so
> in images that don't overlap)
> - Select only one image at a time, start with XYZ, add Yaw, Pitch and
> Roll, then plane yaw and pitch
> - If the error was under 1unit, move on, else try a different order for
> the parameters, another neighboring image, or review CPs

I think except for the optimisation of plane yaw and pitch that is fine.

> After all images were aligned, I would go to the Move/Drag tab and try to
> get it level. Throughout the process the alignment looked good but the map
> was very skewed. Is there a better way of doing so (like
> straighten/keystone in Capture One or PS), or is this fixed by the line CPs?

With good input images and sufficient vertical/horizontal lines this
step shouldn't be required. If one does rotate the image, yaw/pitch and
x/y/z shift of any image that is not centred at 0/0/0 is modified (as
one would expect). However, when shifting, the x/y/z shift of an image
centred at 0/0/0 stays constant while the plane yaw and pitch of all
other images get modified. While this is certainly a valid
transformation, I'd find it more intuitive to leave plane yaw/pitch
constant and modify the x/y/z shift of *all* images. One has to be
careful here.

cheers, lukas wirz





Paul Womack

unread,
Jul 4, 2025, 4:11:48 AMJul 4
to hugi...@googlegroups.com
On Thu, 3 Jul 2025 at 23:08, wirz <lnw...@posteo.net> wrote:
Hi,

> In the future, should I optimize lens
> parameters before or after aligning the images?

I don't think there is a clear argument for either order.

I would recommend taking a 360 horizontal panorama of a scene with lots of detail, shoot with lots of overlap, and optimising the lens, then save the lens model.

Then, for your more difficult map image, don't optimise the lens settings at all - simply load the known-good lens model.
Reply all
Reply to author
Forward
0 new messages