6

I took some raw (CR2) photos and want to edit them in darktable. The focal length is quite low and the distortion high.

Usually I correct the distortion by using darktable's lens correction module which automatically chooses the right values based on the exif information. It works for DSLRs but for this very camera the values are not known.

lens correction

My question:

  • What's the way to correct the distortion in darktable, if I cannot choose the right objective from the drop down menu in the lens correction module?
  • How do I determine the values? Which values should I choose?
4

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".

  • Good info. But I believe that lensfun 0.3.95 (development) has info for the G5 X, so perhaps just an update to 0.3.95 is all that's necessary? – scottbb Oct 7 '18 at 19:32
  • @scottbb Yeah, but that's been covered elsewhere, and this seemed like a good place to introduce this little workaround. ;) – junkyardsparkle Oct 8 '18 at 8:31
  • This answer made my night, thank-you – CRThaze Feb 7 at 23:25
  • @CRThaze and others: There's now a github issue regarding how to improve this situation, here... if you would find the added manual controls useful, consider leaving a comment to that effect. – junkyardsparkle Feb 8 at 4:26
2

Missing lenses are probably added in the latest version of lensfun. The problem is that lensfun don't get updates via the packet manager. To update the database you need to run this command lensfun-update-data as root.

  • Well, that's half true. ;) The command may be run as root, but doesn't need to be. It should also be noted that it requires python3, and that many Linux distros don't include it in the base Lensfun package, but in an additional package named "lensfun-tools" or similar. Also, saying a given lens is "probably" available in an update is a bit of a stretch... it may or may not be. Check that here. Feel free to work this information into your answer. :) – junkyardsparkle Mar 22 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.