Stereo image alignment

224 views
Skip to first unread message

Vladimir Nadvornik

unread,
Jan 31, 2011, 5:55:14 PM1/31/11
to hugin and other free panoramic software
Hi,

I wrote a tutorial how to use my stereo patches (attached to bug
679753):

http://vndlinuxphoto.blogspot.com/2011/01/stereo-image-alignment-in-hugin.html

Comments are welcome.

Vladimir

Chris

unread,
Apr 15, 2024, 5:06:51 AM (10 days ago) Apr 15
to hugin and other free panoramic software

Vladimir. I have written an app that relies on align-image-stack and your 3D patch to it. The app is for images taken with a mobile phone or a camera, so they won’t be aligned properly and won’t create a 3D image without tedious manual alignment or preferably the use of AIS.

I have recently re-read the documentation https://wiki.panotools.org/Align_image_stack to try to make the most of AIS by using the optimum choice of settings. I found it a bit limited and posted some queries here https://groups.google.com/g/hugin-ptx/c/StZln-rxsGw with the result that it has been improved.

The Panotools 3D page https://wiki.panotools.org/Talk:Align_image_stack gives a statement which is clearly wrong:

align_image_stack -i -a AIS_ -S -A -P IMG_????.

  • It only names one input file.

  • It sets both -A and -P which are contradictory.

I have been using the settings you mention in your link above.

align_image_stack -p aligned.pto -a aligned -m -i -P -C right.jpg left.jpg

(It revealed this bug https://bugs.launchpad.net/hugin/+bug/2002813 when using -i which caused AIS to hang when the images were blurry, it’s fixed now.)

I have since noticed that you have added a statement to the official page:

align_image_stack -p out.pto -x -s 4 -P -C right.tif left.tif

The options

-S Assume stereo images - allow horizontal shift of control points. Adds all control points as "horizontal lines".
-A Align stereo window - assumes -S. Adds one "normal" control point that is the nearest point, so that everything will appear behind the display plane.
-P Align stereo window with pop-out effect - assumes -S. Adds one "normal" control point that is the nearest point from the border areas, so that the center of the image may appear in front of the display plane.

The language is a little ambiguous here - “assumes -S “ Does this mean

-      “Assumes you have also used the –-S parameter?” If not what would happen?

Or

-      “This will also set/activate/turn-on the -S option.”

-m magnification

I don’t think the -m is relevant for my application since both L and R images would be taken quickly one after the other.

-i Optimize image center shift for all images

I assume this means “Optimise matching of centre of image, or weight corrections towards the centre rather than the periphery. That seems sensible, however it might attempt to match the x axis and I don't think we want that ‘corrected’ as it has to be different for the 3D effect.

-x That seems wrong to me as I don't think we want that ‘corrected’, as it has to be different for the 3D effect. Why did you switch to using this?

Optimisation phase

States that yaw pitch and roll are optimised by default. My images are likely to be incorrectly matched in the y axis and in roll, so need correction. I don’t think they should be adjusted in the x axis or in yaw as they are 3D factors. Unfortunately the yaw correction can’t be switched off, as it is automatic and there is no parameter for it.

I am going to try align_image_stack -a output.tif -y -P -C right.tif left.tif

Would you like to comment on my thoughts?

T. Modes

unread,
Apr 15, 2024, 11:23:34 AM (10 days ago) Apr 15
to hugin and other free panoramic software
Hi Chris,

Chris schrieb am Montag, 15. April 2024 um 11:06:51 UTC+2:

The Panotools 3D page https://wiki.panotools.org/Talk:Align_image_stack gives a statement which is clearly wrong:

Please keep the discussion on one platform. This is now the third one you are using for the same questions. Most discussion are  done on this mailing list. The bug tracker and the wiki are not an ideal place for such discussion.

align_image_stack -i -a AIS_ -S -A -P IMG_????.

  • It only names one input file.

No, you can also use placeholder like ? or *.

Chris

unread,
Apr 15, 2024, 12:11:13 PM (10 days ago) Apr 15
to hugin and other free panoramic software
Sorry, I didn't realise you were a moderator. 
"on one platform. This is now the third one" I got no reponse on the bugtracker so posted her. What is the third platforms are you referring to?

Chris

unread,
Apr 15, 2024, 12:11:57 PM (10 days ago) Apr 15
to hugin and other free panoramic software
...here. What is the third platform are you referring to?

T. Modes

unread,
Apr 15, 2024, 12:46:52 PM (10 days ago) Apr 15
to hugin and other free panoramic software
Chris schrieb am Montag, 15. April 2024 um 18:11:57 UTC+2:
...here. What is the third platform are you referring to?

Sorry, I did not check correctly. It was a mistake on my side. Take my excuse.

But you repeat often the same phrases: assumes options or implies options means in this context that the corresponding option automatically activated/set and does not need to set manually.

Message has been deleted
Message has been deleted

Chris

unread,
Apr 17, 2024, 1:38:19 AM (8 days ago) Apr 17
to hugin and other free panoramic software
T Modes: "Sorry, I did not check correctly. It was a mistake on my side. Take my excuse."
Apology accepted.
"But you repeat often the same phrases..."
I'll answer that on https://groups.google.com/g/hugin-ptx/c/StZln-rxsGw where it belongs.

Chris

unread,
Apr 17, 2024, 2:13:09 AM (8 days ago) Apr 17
to hugin and other free panoramic software
T modes:"No, you can also use placeholder like ? or *. "
This is undocumented so far as I can see.

Bruno Postle

unread,
Apr 17, 2024, 2:38:10 AM (8 days ago) Apr 17
to hugin and other free panoramic software
On Wed, 17 Apr 2024, 07:13 Chris wrote:
T modes:"No, you can also use placeholder like ? or *. "

This is undocumented so far as I can see.

This is normal filename globbing. The ? and * characters are usually expanded into a list of files by the operating system. align_image_stack only sees the list of files.

-- 
Bruno

Chris

unread,
Apr 17, 2024, 3:33:51 PM (8 days ago) Apr 17
to hugin and other free panoramic software
OK. It wouldn't have occurred to me do this because there could be ten files in the "glob". Would it just take the first 2, and assume that the first one was the right-hand image and the second the left-hand?

Bruno Postle

unread,
Apr 17, 2024, 3:50:21 PM (8 days ago) Apr 17
to hugin and other free panoramic software
On Wed, 17 Apr 2024, 20:33 Chris wrote:
OK. It wouldn't have occurred to me do this because there could be ten files in the "glob". Would it just take the first 2, and assume that the first one was the right-hand image and the second the left-hand?

align_image_stack will align as many images as you like. It was originally devised for creating HDR images from bracketed exposure stacks, which typically have five or more photos.

-- 
Bruno

Chris

unread,
Apr 18, 2024, 4:57:42 PM (7 days ago) Apr 18
to hugin and other free panoramic software
Yes, I understood that, but this thread is about stereo image alignment.  You need 2 images for that, so how does it pick 2 out of for example 10 images? Or does it assume the first one in order is the left-hand image and then treat all the others as right-hand ones and match them to it? Or does it make no assumptions about L and R and just match them all together?

Chris

unread,
Apr 18, 2024, 5:32:00 PM (7 days ago) Apr 18
to hugin and other free panoramic software
Maybe I read too much into Vladimir's recommendation:
align_image_stack -p aligned.pto -a aligned -m -i -P -C right.jpg left.jpg
He names two files and puts them in a specific order - right then left, rather than the more logical left then right, so I assumed that's what you had to do. Checking the documentation I now see that the -S, _A and -P options don't mention files, so I assume the answer is probably the last one of those I suggested in my previous post - it makes no assumptions about L and R and just matches them all together. The order could be modifed by the options --align-to-first and/or --use-given-order
Reply all
Reply to author
Forward
0 new messages