I spent the best part of a day trying to create a lens profile for my trusty Canon PowerShot S90. In theory, it should be a rather straightforward thing to do. The Creating lens distortion models with Hugin’s lens calibrator article provides easy-to-follow instructions on how to create a lens distortion model.
Creating a lens distortion model with Hugin Lens Calibrator
I used a single RAW file to generate a simple model (see the screenshot above). I then added the following lens profile to the /usr/share/lensfun/compact-canon.xml file:
<model>Canon PowerShot S90</model>
<distortion model="ptlens" focal="6" a="0.01463" b="-0.07992" c="0.00461" />
So far, so good. digiKam seems to pick the added lens profile, but the Auto-Correction tool (Enhance → Lens → Auto-correction) produces a rather strange result:
“Auto-correcting” distortion in digiKam
I can’t figure out what I’m doing wrong, so if you have a suggestion, feel free to chime in.
While GIMP offers a wide range of tools for working with photos, it lacks one feature that is essential for serious photographers: the ability to automatically fix lens distortion. Fortunately, the GimpLensfun plugin fills the void quite nicely.
Continue to read Correct Lens Distortion in GIMP with GimpLensfun
Lens distortion is a fact of life. You can mitigate this problem, but you can’t avoid it completely (unless you are willing to invest in seriously expensive professional-grade lenses, that is). Fortunately, digiKam provides a set of tools that can help you to fix lens distortion with relative ease. In fact, the application sports the Auto-Correction feature that attempts to fix lens distortion with a minimum of tweaking. So if you have a photo that suffers from barrel1 or pincushion2 distortion, you might be able to fix it quickly using the Auto-Correction tool. To do this, open the photo in the image editor (choose Image | Edit or press F4) and choose Enhance | Lens | Auto-Correction. digiKam then automatically pulls the camera, lens, and other relevant information from the photo’s metadata and attempts to fix the distortion based on the obtained data. Besides the lens distortion, the Auto-Correction feature can fix other problems, too, including chromatic aberration and vignetting. So if the photo exhibits any of these problems, you can apply fixes to it by ticking the appropriate check boxes.
Usually the Auto-Correction tool does a decent job of fixing lens distortion, but if it fails to do the job, you can try to fix the problem manually. To do this, choose Enhance | Lens | Distortion and adjust the Main and Edge sliders to correct lens distortion.
1 Barrel distortion is a lens effect which causes images to be spherised or “inflated”. Barrel distortion is associated with wide angle lenses and typically occurs at the wide end of a zoom lens. The use of converters often amplifies the effect. It is most visible in images with perfectly straight lines, especially when they are close to the edge of the image frame. (Source: Digital Photography Review)
2 Pincushion distortion is a lens effect which causes images to be pinched at their center. Pincushion distortion is associated with tele lenses and typically occurs at the tele end of a zoom lens. The use of converters often amplifies the effect. It is most visible in images with perfectly straight lines, especially when they are close to the edge of the image frame. (Source: Digital Photography Review)