Page 1 of 1

Lens distortion

PostPosted: Mon May 26, 2008 1:39 pm
by DrSlony
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?

PostPosted: Mon May 26, 2008 3:06 pm
by AlexandreJ
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.

PostPosted: Mon May 26, 2008 10:32 pm
by DrSlony
Thank you for your reply Alexandre!

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 :(

PostPosted: Fri Apr 09, 2010 3:21 am
by MJSfoto1956
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

PostPosted: Fri Apr 09, 2010 11:12 am
by GURL
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...

PostPosted: Fri Apr 09, 2010 11:28 am
by hankkarl
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.

PostPosted: Fri Apr 09, 2010 3:49 pm
by klausesser
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! :cool: - 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

PostPosted: Fri Apr 09, 2010 6:01 pm
by hankkarl
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.

PostPosted: Fri Apr 09, 2010 9:57 pm
by MJSfoto1956
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

PostPosted: Sat Apr 10, 2010 11:28 am
by GURL
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.
[...]

PostPosted: Wed Apr 14, 2010 9:48 pm
by MJSfoto1956
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