patch for optimization of shear parameters

15 views
Skip to first unread message

dev g

unread,
Mar 31, 2009, 4:55:44 PM3/31/09
to hugin and other free panoramic software
Hello,

Scanners or scanning cameras can introduce shearing distortions to images.  In order to correct for such shears, the panotool's imaging model can optimize two parameters g, shearing in the x-direction and t, shearing in the y-direction.

However, I have noticed that if one wants to optimize the shear parameters, the values returned by the optimizer are not passed to the panorama.  To test this, set up a .pto file with a pair of images and generate control points between them.  Go the optimizer tab and click the "edit script" box.  Then you must add the shearing parameters to the list of variables you wish to optimize (e.g. g1, t1, g2, t2, etc.).  After pressing optimize, you'll find that the values of g and t don't change in the panorama.  Is there a reason for this?  Is this by design?

I was able to change this by adding a couple of lines to the GetAlignInfoVariables function in PanoToolsInterface.cpp.  This causes the optimized values of g and t to be passed to the panorama and display in the GUI.  A patch file is attached.

Best,
Dev
shear_parameter.patch

Carl von Einem

unread,
Mar 31, 2009, 6:35:34 PM3/31/09
to hugi...@googlegroups.com
Hi all,

I mostly shoot my panoramas on film and scan using two different
scanners. One of them is a Nikon LS-4000 ED film scanner which shows a
huge vertical shear (sigh). My usual workflow prior to feed hugin with
my images is to
- correct for vertical shear (9-14 pixels depending on scan
resolution/size/whatever/...weather?)
- crop all images to the same frame size and add masks to hide unwanted
parts)
- correct for vignetting

BTW the other scanner (a Hasselblad 646) introduces no shear at all, I
just need a custom made scanner specific mask to be able to scan more
that one frame in one go. (another deep sigh)

Dev's description of how to correct g and t inside hugin is accurate, I
only think that my values were actually optimized whenever I tried.
Sometimes I also try to optimize g an t inside hugin but I'd prefer an
addition in the optimizer tab that uses the two tables for 'd' and 'e'
in a more flexible way: All other tables for yaw, pitch, roll, vof, a, b
and c should be 'static' like thea are now but the following ones could
IMHO be of better use if the table header was a drop down list showing
all other available variables one could possibly want to optimize (I'm
already preparing a screenshot...)

I know this could also be done editing the script but this solution
might be faster (and also easier for less experienced users).

One more idea: how about showing the lens number in this tab's tables
for every clickable image number? This could help to better distinguish
the standard shots from those handheld nadir shots :-)

Carl

Reply all
Reply to author
Forward
0 new messages