How can I correct lens distortion in darktable if my lens isn’t in the Lens Correction module?
Asked 10/7/2018
5 views
2 answers
0
I’m editing RAW (CR2) files in darktable and the images have strong wide-angle distortion. Normally I use the Lens Correction module, which reads EXIF data and applies the correct profile automatically, but this camera/lens combination isn’t listed.
How can I correct distortion in darktable when there’s no matching lens profile? Is there a way to determine or choose usable values manually?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
7y ago
2 Answers
8
Unfortunately, as of right now, darktable doesn't have a very good way of doing ad hoc distortion correction for a lens you don't have a lensfun profile for. The following is a dirty hack that may be useful in cases where the barrel distortion at the wide end of a zoom is so strong that even "incorrect" correction might be an improvement...
In the lens correction module:
- Click on the top (camera) dropdown list and select Generic --> Crop-factor 1.0 (Full Frame)
- For the lens dropdown: Select Generic --> Rectilinear 10-1000mm f/1.0.
- Change the geometry to fish-eye
- Change mode to distort
Now, when you change the value in the "mm" dropdown menu, you should get different degrees of generic "defishing"; start at the largest mm values and work down the list until you find something that looks closest to correct. Clicking the circular arrow button to the right of the "scale" slider will auto-adjust the scale to the largest crop with no blank pixels.
If you're trying to correct "pincushion" distortion at the long end of a zoom, change the mode to "correct" instead of "distort".
Originally by user37649. Source · Licensed CC BY-SA 4.0
user37649
7y ago
0
Generated from our catalog & community — verify before relying on it.
First, update the lensfun database, because your lens may simply be missing from an outdated profile set. On systems that support it, run lensfun-update-data as root/admin, then restart darktable and check again.
If no profile exists, darktable doesn’t offer a great true manual calibration workflow in the Lens Correction module. A workable hack is:
- In Lens Correction, set the camera to
Generic -> Crop-factor 1.0 (Full Frame) - Set the lens to
Generic -> Rectilinear 10-1000mm f/1.0 - Change geometry to
fish-eye - Change mode to
distort - Adjust the
mmvalue to vary the amount of generic correction until the image looks right
This is only an approximation, but it can improve strong barrel distortion when no proper lensfun profile is available.
So the practical order is: update lensfun first, then use the generic profile hack if your lens still isn’t recognized.
Recommended products
UniqueBot
AI7y ago
Your Answer
Related Questions
Why is Darktable lens correction greyed out for a Tamron 18-270mm on Ubuntu?
How can I manually update the Lensfun database for Darktable on Ubuntu?
How can I update Lensfun in darktable so my camera and lens are recognized?
Why does darktable show my Nikon 18-55mm lens as "160" instead of its name?
Why doesn’t darktable auto-detect my lens for lens correction after reinstalling Debian?