Your scanning camera will introduce distortion into your scans, especially if you are using a close macro setting, just as I do. Darktable has a large database of cameras and lens and yours will likely be on it. These corrections come from the lensfun project, which Darktable depends on.
My XZ-1 was indeed available as a built in correction. However, I found that the correction for super macro mode was not sufficiently strong. Unfortunately, it is not possible to simply tweak the settings in Darktable. Instead, one must make a manual edit in the lensfun database file. This file can be found on your linux computer at
/usr/share/lensfun. In there, you will find a file that contains your camera and lens (if removable). As long as you can find it, you can add an extra entry if you need to. What, then are the numbers that you need to add?
You can perform a semi-automatic lens calibration by using the hugin software, which comes with a lens calibration tool that helps you create a correction that can be entered into your local lensfun database. You first need to take a photograph of an image that has clear horizontal and vertical lines in it. provide a good target This photograph should be taken at the focal length and aperature that you intend to scan your negatives at. You can simply display the image on your computer screen and then take the photo. Use a tripod and ensure that the horizontal and vertical lines in the image are indeed horitonzal and vertical with respect to the image boundaries. Once taken, transfer the image to your computer.
You then use Hugin to correct this image. After you install Hugin, you will have a ‘Hugin Calibrate Lens’ item in your menu. Launch this program or just type
calibrate_lens_gui into a terminal prompt. To do the correction, try this…
review this process
- Add the image with the ‘Add’ button.
- Enter the focal length. You can enter one less than the lowest value present in your lensfun database for the camera/lens you are calibrating.
- Tweak the options and preview until the lines are nicely detected.
- Click the ‘Optimise’ button to generate the correction numbers
- Preview the corrected image to see if it looks good. Tweak again until you are happy.
- Edit the lensfun database you wish to add the new entry to.
- Copy the closest ‘distortion’ entry, set the focal length and enter the numbers for a, b and c as you see them in the Hugin calibration tool.
- Update the ‘focal’ entry min and max values as required to cater for your new row.
- Save the file and restart Darktable.
You can search around for more help with this process, for example, here.
previous: Publish, Backup and Share