Public Attributes | List of all members
lfLensCalibDistortion Struct Reference

Lens distortion calibration data. More...

#include <lensfun.h>

Public Attributes

enum lfDistortionModel Model
 The type of distortion model used.
float Focal
 Nominal focal length in mm at which this calibration data was taken.
float RealFocal
 Real focal length in mm for this nominal focal length. More...
cbool RealFocalMeasured
 Whether the real focal length was actually measured.
float Terms [5]
 Distortion coefficients, dependent on model (a,b,c or k1 or k1,k2)
lfLensCalibAttributes CalibAttr
 Calibration settings (currently unused).

Detailed Description

Lens distortion calibration data.

Lens distortion depends only of focal length. The library will interpolate the coefficients values if data for the exact focal length is not available.

Member Data Documentation

◆ RealFocal

float lfLensCalibDistortion::RealFocal

Real focal length in mm for this nominal focal length.

When Lensfun speaks of “focal length”, the nominal focal length from the EXIF data or the gravure on the lens barrel is meant. However, especially for fisheye lenses, the real focal length generally differs from that nominal focal length. With “real focal length”, Lensfun means the focal length in the paraxial approximation, see http://en.wikipedia.org/wiki/Paraxial_approximation. Note that Hugin (as of 2014) implements the calculation of the real focal length wrongly, see http://article.gmane.org/gmane.comp.misc.ptx/34865. It is needed for accurate geometry transformations, e.g. from fisheye to rectilinear.

The default value usually is the nominal focal length. Only for Hugin-based distortion models, the default is the nominal focal length multiplied by the "d" parameter (i.e. linear in r) in the Hugin polynomial. This is because it is this focal length that Hugin assumes in its fit.

In practice, its effect is mostly negligible. When converting to rectilinear, it merely results in a magnification (which probably is reverted by autoscaling). When converting to a fisheye projection besides stereographic, the degree of distortion is not detectable by the human eye. Moreover, most non-fisheyes have quite accurate nominal focal lengths printed on the lens. Thus, the only use case left is the conversion from non-stereographic fisheye to stereographic. This maps perfect circled to perfect circles, so it is noticeable if the nominal focal length is rather off.

The documentation for this struct was generated from the following file: