lensfun: Lens calibration data format

lensfun 0.3.95.0

Lens calibration data format

Possible embedded elements:

<distortion focal="number" model="name" k1="number" k2="number" k3="number" a="number" b="number" c="number" real-focal="number"/>
  Declares the image distortion model for this lens. Distortion is specific for every focal length (in mm), so you can declare multiple distortion entries with different focal values; the library will interpolate the parameters for intermediate focal lengths. The model name may be "none", "poly3", "poly5", "ptlens", or "acm". See Real focal length for a description of the optional “real-focal” attribute.
  See also
    lfDistortionModel
<tca focal="number" model="name" kr="number" kb="number" />
  Declares the Transversal Chromatic Aberrations model for this lens, depending on focal length. The library will interpolate the parameters for intermediate focal lengths. The model name may be "none", "linear", "poly3", or "acm".
  See also
    lfTCAModel
<vignetting focal="number" aperture="number" distance="number" model="name" k1="number" k2="number" k3="number" />
  Declares the vignetting model for this lens at given focal length (in mm), given aperture (as f-number), and given distance to subject in focus (in meters). This kind of calibration requires relatively many sample points since it depends on three variables. The library will interpolate the parameters for between the sample points if necessary. The model name may be "none", "pa", or "acm".
  See also
    lfVignettingModel
<crop focal="number" mode="name" left="number" right="number" top="number" bottom="number" />
  Declares the image crop for this lens. Crop can be specific for every focal length (in mm), so you can declare multiple crop entries with different focal values; the library will interpolate the parameters for intermediate focal lengths. The mode name may be "no_crop", "crop_rectangle", or "crop_circle".
  See also
    lfCropMode

# Real focal length

The optional attribute “real-focal” for the <distortion> element declares the real focal length of the lens in the paraxial approximation, in contrast to the nominal focal length used in all "focal" attributes. Especially for fisheye lenses, both values can differ significantly. Lensfun itself needs the real focal length for lens type transformations. It uses the nominal focal length as a fallback.

The real focal length can be determined reliably only with a 360° panorama, e.g. with Hugin. The images must overlap by at least half an image width. However, Hugin's results need to be rectified. The real focal length must correspond to the distortion coefficients. Typically, they are the result of the very same parameter optimisation.