Modeladvanced
Kannala-Brandt fisheye model
Also called generic fisheye camera model, equidistant fisheye model.
Model a fisheye lens by the image radius as an odd polynomial of the angle between the ray and the optical axis, which covers fields of view of 180 degrees and more.
The Kannala-Brandt model describes a fisheye lens, or any central lens with a wide field of view, by one function: the distance of the image point from the principal point as an odd polynomial of the angle between the incoming ray and the optical axis. A pinhole camera has , which goes to infinity at 90 degrees, so no pinhole model with polynomial distortion, such as the Brown-Conrady model, can describe a field of view of 180 degrees. A polynomial in stays finite there. Kannala and Brandt (2006) showed that a few odd terms fit the common fisheye designs closely, and also normal lenses over a limited angle. With four coefficients it is the fisheye model of OpenCV, and many visual odometry and SLAM systems use it for wide cameras.
The machine
Input. A point of the world, the pose , the coefficients , and the intrinsics .
Step 1: angle of the ray. . Let and . The point may have ; only the direction counts, so the model is central, and runs from 0 to 180 degrees.
Step 2: image radius.
The polynomial is odd because the lens is symmetric about its axis. OpenCV writes the same thing as , with the first coefficient fixed at 1 and the scale moved into and .
Step 3: image point. and (and if ). Then and .
Lens distortion. Lens distortion acts on normalized coordinates: project, distort, then apply . Here the projection gives the angle and the azimuth instead of the point , which does not exist for degrees, the polynomial is the distortion, and comes last as in every other model on this list.
Inverse. Unprojection maps a pixel to a ray. Compute from , then , then solve for by the Newton-Raphson method from the start , and return the direction . There is no closed form for more than one term.
Extra terms. The full model of Kannala and Brandt also has terms that depend on the azimuth, for lenses that are not exactly symmetric or not centered. Most software uses only the symmetric part.
What it counts
The model predicts the pixel of each ray of a central camera, for rays up to the largest angle covered by the calibration data. Calibration fits the coefficients, and the target poses by minimizing the reprojection error, as for other models; Kannala and Brandt used a planar target. The cost of one projection is a few multiplications, an arctangent and a square root, all in the real-RAM model. The cost of unprojection is a few Newton steps.
Classic projections. Optical designers make fisheye lenses to follow one of a few projections. At degrees with pixels they give these radii (computed with a script):
| projection | formula | radius at 60 degrees |
|---|---|---|
| perspective | 519.6 | |
| equidistance | 314.16 | |
| equisolid angle | 300.0 | |
| stereographic | 346.4 | |
| orthographic | 259.8 |
The equidistance projection is the model with one term, . The others are fitted by the odd polynomial. A least squares fit of the equisolid angle projection over degrees with gave a largest error of 18.27, 0.178, , and pixels for 1 to 5 odd terms. The perspective projection is harder because of its pole at 90 degrees: over degrees, 2 to 5 terms gave 17.9, 2.95, 0.46 and 0.07 pixels. So the model also covers normal lenses, but only over a limited angle.
Inverse example. For and , Newton's method from reaches (62.98 degrees) to 7 digits in 3 to 4 steps.
Relation to other models
- Pinhole with Brown-Conrady. That model writes the radius as a polynomial in . It cannot reach 90 degrees, and its fit grows wild near the edge of a wide lens. The Kannala-Brandt model replaces by .
- Unified and double sphere models. The unified model and its extensions have closed form unprojection, which is faster. Usenko, Demmel and Cremers (2018) compared these models on fisheye data sets by reprojection error and computation time, and proposed the double sphere model, which fits wide lenses well, is cheap to compute and has a closed form inverse. Their numbers are benchmark results for the lenses they tested; see the paper for the tables.
- Division model. The division model has one parameter and is algebraically simple, so it suits minimal solvers, but it fits strong fisheye lenses less well.
- Generalized camera. The model is central: all rays pass through one point. A generalized camera drops this assumption, which some fisheye lenses violate slightly.
Known results in the model
- Field of view (theorem). For an increasing on , every ray up to has exactly one image point, and can be 90 degrees or more. A pinhole model with radial distortion cannot do this, because its input is not defined at 90 degrees.
- Unique inverse (theorem). If on the calibrated range, the inverse is unique on that range and Newton's method converges from a start close enough to the root. The polynomial must be checked for this: a fit can turn down beyond the data.
- Approximation (heuristic and benchmark). Odd polynomials with 4 or 5 terms approximate the classic fisheye projections to well below a pixel, as the fits above show. Real lenses deviate from the classic designs, so the fitted coefficients are not those of any closed formula.
- Choice of terms. More terms reduce the fit error on the calibration data but can make the polynomial non monotone outside the data. Four terms, as in OpenCV, is a common compromise, not a result of theory.
References
- Juho Kannala and Sami S. Brandt, A generic camera model and calibration method for conventional, wide-angle, and fish-eye lenses, IEEE Transactions on Pattern Analysis and Machine Intelligence 28(8), 2006, 1335-1340, the radially symmetric model r(theta) as an odd polynomial, the extra asymmetric terms, and the calibration from a planar target
- Vladyslav Usenko, Nikolaus Demmel and Daniel Cremers, The double sphere camera model, International Conference on 3D Vision, 2018, 552-560, the comparison of the Kannala-Brandt, unified, extended unified and double sphere models on fisheye data, including the cost of projection and unprojection
- Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Chapter 2, Image formation (the part on lens distortions and fisheye lenses)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 59RAGT Edit this page History Report an error Markdown