## Lens distortion

Share your tips and tricks here or get help with any Autopano Pro / Giga problem!
No bug reports (of any kind) in this forum!

DrSlony
Moderator

Topic author
Posts: 1893
Likes: 0 post
Liked in: 0 post
Joined: Sat Nov 03, 2007 6:30 pm
Location: Sweden
Info

### Lens distortion

AlexandreJ could you please give a definite answer as to when we should use "Adjust lens distortion", "Advanced distortion" and no distortion optimization? I will then add this to the wiki (if I understand it).

1- Does the focal length matter when deciding on which one to turn on?
2- Does aperture matter?
3- Does exif have to be present?
4- If the above conditions are met, will rms always be lower with the appropriate option turned on? If not, why not?
5- Is it important whether the pano is a 360 or not?
6- Anything else we should know to help us decide which one to use, or whether to use them at all?

AlexandreJ
Kolor Team

Posts: 5987
Likes: 7 posts
Liked in: 10 posts
Joined: Mon Nov 14, 2005 4:56 pm
Location: Francin, France
Info
DrSlony wrote:1- Does the focal length matter when deciding on which one to turn on?

Not directly. If all focal are the same, lens distortion is calculated on all pictures with the same value, instead each lens can vary apart.

DrSlony wrote:2- Does aperture matter?

No

DrSlony wrote:3- Does exif have to be present?

Not necessary. If no exif is set (by lens editor) or found, I suppose nothing and every picture is free to vary alone.

DrSlony wrote:4- If the above conditions are met, will rms always be lower with the appropriate option turned on? If not, why not?

Good question : no always. It's more a math issue. Let's use a parabola.
You have screw and a hammer. Deciding to use or not the hammer will not really help you to use right the screw. Having it will help a little but not so good as with a screwer.
For distortion, it's the same : you have lens distortion, always ! That's an optical fact. But you can also have unknown distortions coming from the fact that you don't shoot at the nodal point. So if you turn on lens distortion correction to correct a nodal issue, it won't work well, thus it will help a little ( but of course, it will at least correct true lens distortion ).

DrSlony wrote:5- Is it important whether the pano is a 360 or not?

A 360° panorama has one good fact : when closing the panorama it really gives a hard constrains to look for sure the focal lens. Without it, the focal length can really by approximate without any visual issue in the picture. Imagine a panorama of 250° and another of 280° : nothing is different between both.
But when you close a panorama, you create a strong constraint which causes the focal to be calculated really accurately.
For lens distortion, it won't really change anything ( also it has to be checked, not sure in fact ).

DrSlony wrote:6- Anything else we should know to help us decide which one to use, or whether to use them at all?

Lens distortion is solving a radial equation. If the input pictures shares the same center, it can not be solved : you can see that with a pure bracketing shot for example. In this case, just uncheck lens distortion. I won't calculate them.

DrSlony
Moderator

Topic author
Posts: 1893
Likes: 0 post
Liked in: 0 post
Joined: Sat Nov 03, 2007 6:30 pm
Location: Sweden
Info

Now lets see whether I understand it :]

1- We can use lens distortion correction (lets call it LDC) on images regardless of focal length and aperture, no matter whether exif is present or not. It should work.
2- LDC can correct not only pincushion and barrel distortion, but also "not rotating around nodal point" distortion. I assume you dont mean parallax errors only the image being a bit 'sideways' because it is off-center.

3- "A 360° panorama has one good fact : when closing the panorama it really gives a hard constrains to look for sure the focal lens. Without it, the focal length can really by approximate without any visual issue in the picture." I dont understand this too well: "look for sure the focal lens".
"Without it, the focal length can really by approximate without any visual issue in the picture" "For lens distortion, it won't really change anything ( also it has to be checked, not sure in fact)". So are you saying that LDC isnt necessary for correcting focal length issues in 360 panos, but it will still help to correct pincushion/barrel distortion and that will give a better rms?

4- When feeding bracketed photos to APP, we should always disable LDC?

OK assuming I understood you right, the summary is:
"Always use LDC for better quality except if you're feeding APP bracketed photos"?

What about "advanced distortion", when do we use it? ONLY for fisheyes (and ALWAYS for fisheyes?) or also in other situations (with other non-fisheye lenses)?

Is there some lens focal length threshold above which enabling LDC would be pointless and only unneccessarily slow APP down, e.g. above 50mm? So would this rule for example be good "Always turn on LDC if focal is below 50mm and when not bracketing"?
If yes, what is the threshold for turning on advanced distortion? e.g. 15mm?

When (and if) I understand this, I will update the wiki accordingly, from what I see nobody really knows when to use which, but first I must be sure I understand it right :] Also pity I cant speak French :(

MJSfoto1956
Member

Posts: 32
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 26, 2008 3:54 pm
Info
Does this mean that if I use a program such as DxO Optics Pro (which corrects for lens distortion) that I should always turn "Adjust lens distortion" off?

Michael

GURL
Member

Posts: 2943
Likes: 0 post
Liked in: 0 post
Joined: Tue Dec 06, 2005 1:57 pm
Location: Grenoble
Info
DrSlony wrote:AlexandreJ could you please give a definite answer as to when we should use "Adjust lens distortion", "Advanced distortion" and no distortion optimization?

Sometimes the "definitive answer" does not exist.

Though pano optimization is certainly less complex, it's a bit like weather forecast: many of the laws that rule weather are well understood (but accuracy may vary), many data are available (but not all relevant data are known), it often works but sometimes fails...

Examples:

The actual size of my camera sensor is not taken into account by it's firmware (!) so that EXIF data are inaccurate and fisheye FOV is obviously wrong. I decided to make some tests to know whether manually entering a more accurate value would help but missed to enter the decimal point: Autopano was able to find a correct stitch using a x 10 completely stupid focal length value. I can't conclude that focal length is useless, just know that it's sometimes useless.

Michael wrote:Does this mean that if I use a program such as DxO Optics Pro (which corrects for lens distortion) that I should always turn "Adjust lens distortion" off?

I'm afraid that, if possible, a definitive answer to this question would be unpractical and useless...
Georges

hankkarl
Member

Posts: 1284
Likes: 0 post
Liked in: 0 post
Joined: Tue Feb 21, 2006 5:32 pm
Location: Connecticut, USA
Info
MJSfoto1956 wrote:Does this mean that if I use a program such as DxO Optics Pro (which corrects for lens distortion) that I should always turn "Adjust lens distortion" off?

Michael

On some panos, I start with lens correction off, then make sure that all the links are good, then turn it on.

klausesser
Member

Posts: 8836
Likes: 5 posts
Liked in: 64 posts
Joined: Mon May 22, 2006 12:18 am
Location: Duesseldorf, Germany
Info
hankkarl wrote:On some panos, I start with lens correction off, then make sure that all the links are good, then turn it on.

Cool, man! - iÂ´ll try that.

I usually disable lens correction and advanced lens correction - i learned itÂ´s for fisheyes and advanced is for slightly off-centered fisheyes. Right?

With a Nikon 10,5mm i use lens correction but no advanced. Works ok.

I use manual Nikon lenses on Canons.

best, Klaus
Simplicity is the keynote of all true elegance. Coco Chanel

hankkarl
Member

Posts: 1284
Likes: 0 post
Liked in: 0 post
Joined: Tue Feb 21, 2006 5:32 pm
Location: Connecticut, USA
Info
The issue is that if APP finds a bad link between pictures (ie a link that shouldn't be there) it will distort those images, and then never "undistort" them fully--it seems that they never quite go back to where the other images are.

Lens correction has gotten a lot better since 1.4.x, so I try stitching with lens correction on, and if the pano is really bad, I'll restitch with lens correction off, then go in and fix the links and turn lens correction on.

But if I'm doing a high quality pano, I'll start with lens correction off.
Last edited by hankkarl on Fri Apr 09, 2010 6:03 pm, edited 1 time in total.

MJSfoto1956
Member

Posts: 32
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 26, 2008 3:54 pm
Info
My (anecdotal) observations regarding "Adjust lens distortion" checkbox together with DxO Optics Pro RAW conversion prior to APP:

- long lenses w/ matching DxO profile (doesn't seem to matter what setting you use)
- long lenses w/o matching DxO profile (doesn't seem to matter what setting you use)
- wide lenses w/ matching DxO profile (always better with it off)
- wide lenses w/o matching DxO profile (always better with it on)

In other words, it seems that APP is trying to correct for barrel distortion for *any* lens that it considers to be wide angle. Since DxO already corrects for all lens distortion, you end up with "over correction" and subsequently poor stitches no matter how accurate your control points. In my case, now that all my lenses have DxO profiles, I have permanently turned this value off and the quality of stitching has improved noticeably. YMMV.

Michael

GURL
Member

Posts: 2943
Likes: 0 post
Liked in: 0 post
Joined: Tue Dec 06, 2005 1:57 pm
Location: Grenoble
Info
MJSfoto1956 wrote:- wide lenses w/ matching DxO profile (always better with it off)
- wide lenses w/o matching DxO profile (always better with it on)

How wide your wide lenses are would be interesting to know. For zooms, it could happen that the conclusion which applies at one end do not apply at the other end (but, perhaps, you are avoiding using zoom lenses...)
Whether the resulting panorama FOV matters or not would be interesting to know, too.

This being said, the way to follow is certainly to make tests like the ones you have done before deciding to use or not to use Autopano distortion correction.

Notes: "lens distortion" is a rather vague expression. For example whether in Autopano parlance this includes lens versus sensor misalignment corrections (as shown in the fisheye crop-circle window) or not would be interesting to know.
Likewise, barrel correction by a RAW converter should change the width / height ratio of the resulting image (the diagonal FOV is reduced.)
Anti-shake recent DSLR feature (wich moves the sensor in X and Y directions) if used (or forgotten) with very wide lenses could explain some stitcher failures.
[...]
Last edited by GURL on Sat Apr 10, 2010 11:30 am, edited 1 time in total.
Georges

MJSfoto1956
Member

Posts: 32
Likes: 0 post
Liked in: 0 post
Joined: Sun Oct 26, 2008 3:54 pm
Info
In my case wide = 18mm and 24mm using an 18-135mm zoom on a D200 (35mm equivalent of 27mm)

In my case long = 80mm, 135mm, 180mm, and 200mm (mostly zooms) on a D200 (again need to multiply by 1.5x to obtain equivalent 35mm)

Michael

### Who is online

Users browsing this forum: No registered users and 6 guests