lensfun: Adding new cameras to the database

lensfun 0.2.7.0

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

Adding new cameras to the database

Adding new cameras is very easy.

You just have to know its crop factor, and the EXIF identification strings for this camera; that's all.

If you don't know the crop factor, you can search in google for e.g. "Nikon D300 sensor size". Let's suppose you found out that your sensor size is 23.6 x 15.8mm. Now compute the length of the diagonal using Pythagora's theorem:

d = sqrt (23.6^2 + 15.8^2) = 28.4 mm

Now you just divide the magic number 43.27 (the diagonal of a usual 35mm film frame) by the number you got:

crop = 43.27 / 28.4 = 1.52

Usually the image from the sensor is a little cropped along every margin, so let's suppose it's exactly 1.5.

Now you must find out the identification string for your camera from EXIF data. For this you can use the exiftool script:

$ exiftool blah.nef
....
Make : NIKON CORPORATION
Camera Model Name : NIKON D300
....

Now you can create a XML entry for your camera:

<camera>
<maker>NIKON CORPORATION</maker>
<maker lang="en">Nikon</maker>
<model>NIKON D300</model>
<model lang="en">D300</model>
<mount>Nikon F AF</mount>
<cropfactor>1.5</cropfactor>
</camera>

Now add this definition to a XML database file along lensfun database search path and your camera will be detected and lensfun will work properly with images produced by it.

- Declaring cameras: <camera>