Lens correction issue

Hi All

I have a strange observation recently in darktable. I use my Canon R6 with RF24-105mm lense for landscape pictures. When I apply lens correction my pic looses sharpness and also gets bit stretched toward the edges mostly toward corners. Has anyone noticed the same?

I have stopped using lens correction altogether. Please correct me if I am not seeing something correctly.

@s7habo @Bruce_Williams

Check a couple of things… check with the highquality option set for preview and or at 100% to confirm your visual impression of the impact… and in the lens correction you can usually select what corrections you want to apply. You can toggle the options to see which one might be giving you that visual… finally you could share an image here and see if others can see what you see…

1 Like

I only use lens correction when I see an obvious problem such as pincushion or barrel distortion. This is usually not an issue in landscapes but can be when photographing buildings.

1 Like

Hi, does it happen when you select lens correction data embedded in your Raw file (if present/supported) or correction data provided by the external lensfun library?

1 Like

AFAIK this is not supported for Canon yet.

1 Like

Stretching towards corners is normal, especially at wide focal lengths, because of the barrel effect. As far as sharpness is concerned, i don’t know… Have you tried setting different “correction” modes? Like “TCA only” or “distortion only” to see if sharpness is still affected. It sounds like the correction profile on lensfun might be defective, so you could submit your samples to them if nothing helps

3 Likes

I also noticed a sharpness loss with lens correction and I experimented with both “lensfun” and “embedded metadata”. I think it is related to the stretching and distortion correction, which alter the initial pixels positions.

1 Like

See the two images side by side… I screenshot smaller segment to show the actual difference better. Also attached the original CR3, if someone wants to try out.
No_Lens_Correction
With_Lens_Correction
_6I_2550.CR3 (16.0 MB)
t

1 Like

You can set the module to only do vignetting and CA correction, but skip the geometric one. Alternatively, you may choose a different projection; for example, stereographic projects circles to circles, so is a good choice for portraits taken with a wide-angle lens, but will project straight lines onto curved ones.
I’ve just come across these two blog entries. The second one prints out how painters mix projections, keeping architectural lines straight, but then abandoning linear projection when painting people who appear in the same scene:

3 Likes

thank you that is very helpful

A fascinating reading (especially the article that the posts explain), but it has nothing to do with the topic above (correcting optical imperfections of lenses).

Mere optical corrections should not loss that much sharpness IMO. If the effect persists with the best method (lanczos3? i am on the phone so I did not check it), I would open an issue.

I meant to address the maybe unexpected, but unavoidable stretching of the image:

just loading it with scene defaults and setting the preview to hq… it seems not really too bad if vignette is not used and only tca and distortion but maybe I just don’t have a good eye to pick it up…

I applied lens distortion and could see no discernible softening of the image at 100% magnification on a 43 inch monitor. I have attached a screen shot with no lens correction on the left and lens correction on the right.
image

2 Likes

Two apples with the lens correction module turned off:

With no geometry correction applied, rectilinear geometry:
image

With the default, rectilinear correction:
image

With stereographic:
image

With fisheye:
image

Panoramic:
image

Equirectangular:
image

Orthographic:
image

Equisolid angle:
image

Thoby fisheye:
image

I often switch to stereographic if the image has people close to the edges.
Don’t forget to have darktable re-calculate the scale when switching between geometries, or you may end up with dark corners and extrapolated areas (where darktable is trying to fill the frame but there’s no data from the image sensor):

1 Like

In the corners, and near the edges, where the stretching is the strongest, it’s unavoidable that you lose resolution: the data from a (demosaicked) sensor pixel does not correspond 1:1 to an output pixel; what’s more, the data is spread over to cover a larger area.

Here, I disabled geometric distortion correction, and manually lowered the scale, so parts of the image that normally end up outside the frame become visible. You’ll notice the areas where darktable just uses the last valid pixel to fill in the left side of the image (I didn’t use top left corner, as the image is mostly a flat blue area there):

With distortion correction enabled:

And this is a close-up of correction on (top) vs off (bottom):
image

You’ll notice that darktable stretched the image outwards.

It will perform some stretching even if you disable the geometric correction; I assume that is to bring the image to the selected target geometry:

target geometry
In addition to correcting lens flaws, this module can change the projection type of your image. Set this combobox to the desired projection type (e.g. “rectilinear”, “fisheye”, “panoramic”, “equirectangular”, “orthographic”, “stereographic”, “equisolid angle”, “Thoby fisheye”).
(darktable 4.9 user manual - lens correction)

You can normally get away with not correcting geometric distortions (fixing vignetting and CA only) if there are no straight lines in the image and distortion is mild.

Even if correcting lens distortions (imperfections), the effect described in the articles linked above remains: geometric distortion correction fixes lens flaws, not the effects of linear perspective.

2 Likes

Hi Kofa. I had presumed this was a potential problem because the pixels would have to be recreated by the software. I loved the examples you gave above. I will look closer at the lens correction module and experiment. But the module works really well on distorted buildings and photos of paintings etc. Thanks for your informative post here.

3 Likes

They are (re)created anyway by the demosaicing (assuming one not using a Foveon sensor).

That said, I am wondering why no one is using monotone bicubic splines to interpolate. Computationally a bit more expensive, but not prone to the ringing artifacts of lanczos(3)/sinc.

1 Like