Vertical stacking with Hugin

108 views
Skip to first unread message

Nick Thomas

unread,
Mar 20, 2025, 5:50:00 AM3/20/25
to hugin and other free panoramic software
I am attempting to stitch images of the Dunfallandy Stone. I have three images, the top, middle and bottom of the stone taken with a Nikkor 14-24mm lens, set at 14mm.

When I try to align the images, no control points are found. I have manually added 5 CP on each pair of images.

The thing that I am now unsure of is what projection to use. I have tried a number (fish eye, equisolid, orthographic, amongst others), but all give me a huge amount of distortion on the final image.

My questions are:
  1. Are 5 CP sufficient?
  2. What projection should I use for a stitch of 3 vertical images?
As an aside, I am finding that Hugin seems to be flaky when run over a KDE/Wayland/Nvidia driver for an Nvidia graphics card. The problems go away when I use X11 rather than Wayland.

Bruno Postle

unread,
Mar 20, 2025, 6:34:24 AM3/20/25
to hugin and other free panoramic software
For a flat object viewed straight-on you need rectilinear output projection.

Five control points should be enough, but my question is, did you move the camera between shots? Hugin can stitch this, but it is not a 'normal' panorama, so you need to use what Hugin calls a 'mosaic' technique where you optimise the camera positions.

Can you upload the photos? I'm sure someone here can show you how it's done.

Yes there are problems with Wayland, but it depends entirely how wxwidgets has been built, so it varies between Linux distributions.

-- 
Bruno

Nick Thomas

unread,
Mar 20, 2025, 7:22:38 AM3/20/25
to hugin and other free panoramic software
"my question is, did you move the camera between shots?"

Yes, I had to. The stone is in a glass case, from which you get reflections. The only way to get images without reflections is to press the lens hood against the glass. Hence, the reason for the short focal length shots.

"Can you upload the photos?"

Images attached.

_CTW4158.jpg_CTW4159.jpg_CTW4160.jpg 

Nick Thomas

unread,
Mar 21, 2025, 6:27:02 AM3/21/25
to hugin and other free panoramic software
I found a tutorial from 2010, which walked me through stitching flat images.  I followed it, and got better results, but with the top and bottom clipped off.

What appears to be happening is that it is calculating the final size as though the images were being horizontally stacked. I rotated the images and followed the tutorial again. This gives me a different focal length for the lens, and hence a different FOV.  I no longer get the clipping, but I do get the distortion again.

On Thursday, 20 March 2025 at 10:34:24 UTC bruno...@gmail.com wrote:

Bruno Postle

unread,
Mar 23, 2025, 4:33:29 AM3/23/25
to hugi...@googlegroups.com
Hi Nick, attached a PTO project that stitches your photos.

Since this isn't a 'normal' panorama (the camera shifts between shots), you need to set Interface > Expert. This enables XYZ (mosaic) camera positions.
When Hugin loads photos it initially gives them a horizontal spread, but you don't want this, in the Photos tab right click and 'Reset positions'.
In the preview, reduce the angle of the view to fit the photos, and set the output projection to rectilinear (the same as your input photos),
Add some control points, you don't need many, but they need a good spread over the overlapping areas.
In the photos tab, select Optimise > Geometric > custom parameters, this will reveal the Optimiser tab.
In the Optimiser tab, you want the middle photo to stay in place, but set optimisation for Yaw, Pitch, Roll, X, Y & Z for the top and bottom photos. Optimise.
The photos should now be aligned. Go back to the preview, fit the field of view so you can see the whole output, crop and stitch.

Ask if you have any more questions, this is a good demonstration of the mosaic mode in Hugin.

--
Bruno

On Fri, 21 Mar 2025 at 10:27, Nick Thomas wrote:
I found a tutorial from 2010, which walked me through stitching flat images.  I followed it, and got better results, but with the top and bottom clipped off.

What appears to be happening is that it is calculating the final size as though the images were being horizontally stacked. I rotated the images and followed the tutorial again. This gives me a different focal length for the lens, and hence a different FOV.  I no longer get the clipping, but I do get the distortion again.

On Thursday, 20 March 2025 at 10:34:24 UTC Bruno Postle wrote:
For a flat object viewed straight-on you need rectilinear output projection.

Five control points should be enough, but my question is, did you move the camera between shots? Hugin can stitch this, but it is not a 'normal' panorama, so you need to use what Hugin calls a 'mosaic' technique where you optimise the camera positions.

Can you upload the photos? I'm sure someone here can show you how it's done.

On Thu, 20 Mar 2025, 09:49 Nick Thomas wrote:
I am attempting to stitch images of the Dunfallandy Stone. I have three images, the top, middle and bottom of the stone taken with a Nikkor 14-24mm lens, set at 14mm.

When I try to align the images, no control points are found. I have manually added 5 CP on each pair of images.

The thing that I am now unsure of is what projection to use. I have tried a number (fish eye, equisolid, orthographic, amongst others), but all give me a huge amount of distortion on the final image.

My questions are:
  1. Are 5 CP sufficient?
  2. What projection should I use for a stitch of 3 vertical images?


--
Bruno
_CTW4158 - _CTW4160.pto
_CTW4158 - _CTW4160.jpg

Nick Thomas

unread,
Mar 23, 2025, 8:00:32 AM3/23/25
to hugin and other free panoramic software
"Ask if you have any more questions, this is a good demonstration of the mosaic mode in Hugin.

A dangerous thing to say!

Thanks for your instructions. I worked my way through it and saw what you had done.

I started with three images, but there is a fourth, which is the foot of the stone. I can see why you fixed the centre image in the set of three and adjusted the positions of the others. What should I do with four images?

Bruno Postle

unread,
Mar 23, 2025, 10:28:07 AM3/23/25
to hugin and other free panoramic software
Hugin can create a mosaic from any number of photos, and it doesn't really matter which image you use as the 'anchor'. I used the middle image as an anchor because with all the position parameters set to zero it will then be in the middle of the output image. Your fourth photo will extend the view at the bottom, but you can always use the Fit and Crop functions to reframe the output.

One thing I didn't try, because it looked like your photos were straight-on without any perspective distortion, is to also optimise yaw and pitch for the anchor. This might give a slightly better output, but your subject isn't very flat so it could give weird results.

-- 
Bruno
Reply all
Reply to author
Forward
0 new messages