Lens correction with Hugin

128 views
Skip to first unread message

Robert Lounsberry

unread,
May 8, 2018, 3:45:12 PM5/8/18
to hugin and other free panoramic software

I am trying to figure out if this is expected or if I can make a change so that the post 2014 version of Hugin works like the pre-2014 version when doing lens correction.

In the old version as you would place control points they would only appear on one side of the image (left side for the left image and right side for the right images) as seen here in this screenshot - https://www.screencast.com/t/HSWzBkoPB


In the post 2014 new version of Hugin you get these lines that go across the entire image on both sides as seen here - https://www.screencast.com/t/RVRV1srhI2


Whenever I put all the control points down I am able to optimize and get a set of lens correction numbers but they are always way off and still don't fully correct the image. 


If the UI is just different and not part of my issue, can someone help me understand where I'm going wrong when creating the lens distortion control points? I follow the steps here http://hugin.sourceforge.net/tutorials/calibration/en.shtml as well as this video here https://vimeo.com/51999287 and I can arrive at the numbers assigned to a, b, and c, but they are always way off. 

Torsten Bronger

unread,
May 8, 2018, 4:52:19 PM5/8/18
to hugi...@googlegroups.com
Hallöchen!

Robert Lounsberry writes:

> I am trying to figure out if this is expected or if I can make a
> change so that the post 2014 version of Hugin works like the
> pre-2014 version when doing lens correction.
>
> In the old version as you would place control points they would
> only appear on one side of the image (left side for the left image
> and right side for the right images) as seen here in this
> screenshot - https://www.screencast.com/t/HSWzBkoPB
>
> In the post 2014 new version of Hugin you get these lines that go
> across the entire image on both sides as seen here -
> https://www.screencast.com/t/RVRV1srhI2

To switch off the lines, see <https://www.screencast.com/t/HSWzBkoPB>.
And, "horiz. Line" in this screenshot indicates that you are doing
something wrong. It must be a "new line" instead (like "Line 4" in
the other screenshot).

Tschö,
Torsten.

--
Torsten Bronger

Torsten Bronger

unread,
May 9, 2018, 12:41:16 AM5/9/18
to hugi...@googlegroups.com
Hallöchen!

Torsten Bronger writes:

> [...]
>
> To switch off the lines, see <https://www.screencast.com/t/HSWzBkoPB>.

Sorry, http://permalink.gmane.org/gmane.comp.misc.ptx/35067 is the
correct link.

Robert Lounsberry

unread,
May 16, 2018, 2:44:06 PM5/16/18
to hugin and other free panoramic software
Thanks for the reply. I redid everything making sure I added a new line 3, 4, and 5 for the lines I was using. I've included a video of the process after I added the lines. I'll show that each line is it's own number yet when I optimize them all the numbers I arrive at are vastly different than those currently in lensfun. I am doing this as a test to see if I can get close to the numbers in lensfun (also shown at the end of the video). Is that a realistic goal? To be able to get close to those numbers? I'm evaluating this entire process so that I may start contributing to lensfun. 

Video of my settings and output. 

Thanks,
Robert Lounsberry

Torsten Bronger

unread,
May 16, 2018, 4:11:15 PM5/16/18
to hugi...@googlegroups.com
Hallöchen!

Robert Lounsberry writes:

> [...] Is that a realistic goal? To be able to get close to those
> numbers?

Even without having looked at the video yet I can say: No. Very
different coefficients can yield rather similar functions in the
respective interval. The actual question is whether your
coefficients lead to a good-looking correction.

Robert Lounsberry

unread,
May 16, 2018, 5:19:13 PM5/16/18
to hugi...@googlegroups.com
Thank you very much. I was working toward what seems an impossible end. Disregarding the difference in the numbers, I was finally able to arrive at the proper corrections for the 16 and 20mm focal lengths for the zoom lens I'm testing. Thank you very much for your help and kindness. 

Best regards,
Robert Lounsberry

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/878t8j4b12.fsf%40wilson.bronger.org.
For more options, visit https://groups.google.com/d/optout.

Robert Lounsberry

unread,
May 17, 2018, 2:40:49 PM5/17/18
to hugin and other free panoramic software
Just to make sure I understand correctly, you don't need to do both vertical and horizontal lines to create a proper lens distortion correction. You only need to use horizontal lines....right? And if you do need to do vertical lines, how would you line them up in Hugin since they wouldn't be touching like in horizontal test images. 

Torsten Bronger

unread,
May 17, 2018, 4:41:13 PM5/17/18
to hugi...@googlegroups.com
Hallöchen!

Robert Lounsberry writes:

> Just to make sure I understand correctly, you don't need to do
> both vertical and horizontal lines to create a proper lens
> distortion correction. You only need to use horizontal
> lines....right?

Yes, because they are longer usually.

> And if you do need to do vertical lines, how would you line them
> up in Hugin since they wouldn't be touching like in horizontal
> test images.

I don't understand this. You need to do vertical lines becasue you
have a test image in portrait mode? Or because the subject only had
vertical lines?

Robert Lounsberry

unread,
May 17, 2018, 4:45:38 PM5/17/18
to hugi...@googlegroups.com
I was asking that if I had to also use vertical lines, how would I line them up on top of each other like two portrait orientation images and match a vertical line top to bottom. Since I don't have to use vertical lines and can use only horizontal lines then it's a moot question. I just wasn't sure how to, if I had to. Thank you. 

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+unsubscribe@googlegroups.com.

Frederic Da Vitoria

unread,
May 17, 2018, 5:14:17 PM5/17/18
to hugin-ptx
2018-05-17 22:45 GMT+02:00 Robert Lounsberry <rob...@alienskin.com>:
I was asking that if I had to also use vertical lines, how would I line them up on top of each other like two portrait orientation images and match a vertical line top to bottom. Since I don't have to use vertical lines and can use only horizontal lines then it's a moot question. I just wasn't sure how to, if I had to. Thank you. 

On Thu, May 17, 2018 at 4:38 PM, Torsten Bronger <bro...@physik.rwth-aachen.de> wrote:
Hallöchen!

Robert Lounsberry writes:

> Just to make sure I understand correctly, you don't need to do
> both vertical and horizontal lines to create a proper lens
> distortion correction. You only need to use horizontal
> lines....right?

Yes, because they are longer usually.

> And if you do need to do vertical lines, how would you line them
> up in Hugin since they wouldn't be touching like in horizontal
> test images.

I don't understand this.  You need to do vertical lines becasue you
have a test image in portrait mode?  Or because the subject only had
vertical lines?

Tschö,
Torsten.

--
Torsten Bronger

I may be wrong, but I believe you shouldn't set lines as horizontal or vertical in Hugin for calibration. Just declare them as "normal" lines, no matter if they are actually vertical or horizontal. I guess it could help calibration if you find vertical lines as well as horizontal. For that matter, you could use oblique lines too. 

--
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org

Robert Lounsberry

unread,
Jun 12, 2018, 10:39:09 AM6/12/18
to hugi...@googlegroups.com
I'm really comfortable making corrections with horizontal lines. Based on Torsten's tutorial I translated to the new version of Hugin and where the image jumps after you make a control point. In a horizontal image you just know that you can click on both sides of the image just at the inside edges and continue. That's where he says "you can just turn your brain off" in the tutorial video. In an image where the subject is vertical or angled lines, I'm not sure how that would work. The corrections I get from multiple horizontal lines seem to work fine for everything, but I want to understand how to use vertical or oblique lines. 

Torsten, I emailed you a couple times. I'm looking to contribute by making corrections for user submissions. 

Thanks everyone for the assistance. 

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages