Change distortion formula

67 views
Skip to first unread message

Torsten Bronger

unread,
Dec 7, 2015, 5:16:36 AM12/7/15
to hugi...@googlegroups.com
Hallöchen!

I would like to model distortion with an alternative formula.
Hugin's formula is described on
<http://hugin.sourceforge.net/docs/manual/Lens_correction_model.html#Lens_distortion_a.2C_b_.26_c_parameters>.
I like to measure lenses using the imatest formula, which also is a
simple polynomial.

I do not need additional parameters, nor do I need Hugin to actually
correct images using the parameters. A q&d hack of the Hugin
sources so that "optimize!" finds the best a, b, c using the other
formula is okay.

But I fail to find the place in the source code where I need to
change that. Can anybody help me with that? Thank you!

Tschö,
Torsten.

--
Torsten Bronger Jabber ID: torsten...@jabber.rwth-aachen.de

Bruno Postle

unread,
Dec 7, 2015, 5:47:12 PM12/7/15
to Hugin ptx
On Mon 07-Dec-2015 at 11:14 +0100, Torsten Bronger wrote:
>
>I would like to model distortion with an alternative formula.
>Hugin's formula is described on
><http://hugin.sourceforge.net/docs/manual/Lens_correction_model.html#Lens_distortion_a.2C_b_.26_c_parameters>.
>I like to measure lenses using the imatest formula, which also is a
>simple polynomial.

>But I fail to find the place in the source code where I need to
>change that. Can anybody help me with that? Thank you!

All this stuff is in libpano13, not in Hugin.

--
Bruno

Torsten Bronger

unread,
Dec 25, 2015, 4:15:57 PM12/25/15
to hugi...@googlegroups.com
Hallöchen!
Thank you! After some fiddling I managed to do it. All it needed
was to change radial() and inv_radial() in math.c. I also changed
the line starting with "optInfo->im[i].cP.radial_params[0][0] =" in
SetAlignParams in adjust.c, but this may have been unnecessary.
Reply all
Reply to author
Forward
0 new messages