# The Calibration Model

The calibration model is described by the calibration mode, expressed as a combination of options. Use [`EWorldShape::GetCalibrationModes`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a48f18a1dc6aaec88a4d6ff2a26ffbeda) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a913ff80816e0c9371416214b0b2a57aa) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a47e46ecb1a337986d7c1b7c0bdb3c014) to access it.

The different calibration models are:

* A  ***field-of-view calibration model*** used when the calibration mode is the combination of the options [`ECalibrationMode_Scaled`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html), [`ECalibrationMode_Anisotropic`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html), [`ECalibrationMode_Skewed`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html), [`ECalibrationMode_Tilted`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html) and/or [`ECalibrationMode_Radial`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html).
* An  ***advanced calibration model*** using a more complex distortion model capable of better calibrating wide-angle lens.
  - This model does not expose its parameters.
  - This model is used when the calibration mode is [`ECalibrationMode_Advanced`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html)
*  ***Empirical models*** based either on a quadratic model ([`ECalibrationMode_Quadratic`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html)) or a bilinear model ([`ECalibrationMode_Bilinear`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html)).
  - These models do not expose their parameters.

#### HINT
When using [`EWorldShape::AutoCalibrateDotGrid`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#af94941f444b116cbd70a6b78f3c1ba54) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a553ebd0ab2ef817ce63b364acf05fe56) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#aa4b20a15ae05df324f61adbdcbb5fe6b), pass the combination of options that you want to test. The method selects the model that has the best precision on the calibration image.

## Parameters

To tune the field-of-view calibration model, use these parameters:

### Sensor Width and Height

The [`sensor width`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#ade73057ee303c5bcee32ce7a520b06d2) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a55c13f4688c4b5fa67ad32094f1388af) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a4e9b97b2b3161ab2e60453a12c94fe9d) and [`sensor height`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a43a290163e191fd738b60c41159e0cfd) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#aa1fb5795744dbd24ca7d41914e0f2d59) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a1b9d6377b0ac3c9adaaeb6e96b45eebd) give the logical image size, in pixels (always integers).

### Field-of-View Width and Height

The **field-of-view (f-o-v)** [`field width`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a996d840d4c173546a0ce2feac6842860) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a567c7c205ffad39ddbf145c467bca850) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a9fa7a7f35535255844f002e9f192893d) and [`field height`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a31842aadc121005fa9c7fc13a7a84dfd) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#afeb367a3026004ce7457a093a88e1926) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#ad2320207e713ee721a3b17a145e74ecb) give the actual image size, in length units, i.e. the size of the rectangle corresponding to the image edges in the world space. These values are related to the pixel resolution by the following equations:

$$

\begin{aligned}
\mathit{f\textrm{-}o\textrm{-}v\ width} &= \mathit{pixel\ width} * \mathit{sensor\ width} \\
\mathit{f\textrm{-}o\textrm{-}v\ height} &= \mathit{pixel\ height} * \mathit{sensor\ height}
\end{aligned}
$$

or

$$

\begin{aligned}
\mathit{sensor\ width} &= \mathit{f\textrm{-}o\textrm{-}v\ width} * \mathit{horizontal\ resolution} \\
\mathit{sensor\ height} &= \mathit{f\textrm{-}o\textrm{-}v\ height} * \mathit{vertical\ resolution}
\end{aligned}
$$

By default pixel height is not specified, the pixels are assumed to be square (pixel width = pixel height).

### Ratio

![image](assets/images/easygauge/calibrationratio.webp)

### Center Abscissa and Ordinate

The [`center abscissa`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#aa8849fab22b271c1787d453bc3108110) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a44fc6e3bb7e0e058cb5c8d5bcace8fff) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#ab7ae7b876ea2b31b3012894634076a82) (x) and [`ordinate`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#af3f0b768fb539347c79de2d4e59a50d6) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a27cf399780066813d3d3002535144336) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a77b7b31dbaa5d725b7058f3a70eb40e3) (y) indicate the image origin point (world coordinates (0,0)). Default is the image center.

### Skew Angle

The [`skew angle`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a546e01673dd5871d258723470576b872) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a6bfd056b60750e811d7db26e777b0e82) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a1fa84223554139fc444a32392e1b3e3e) is the angle formed by the real-world reference frame (X-axis) and the image edge (horizontal). The default is no skew.

![image](assets/images/easygauge/calibrationangle.webp)

#### NOTE
When the pixels are not square, the [`EWorldShape`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html) object can convert the angle between the world and sensor spaces.

### X and Y Tilt Angles

The [`X`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a882d7db11e237a0e1bfb0597d91f6927) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a49504cfe8c7df7e23668a0b38dbef378) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#aa42e6bbd0c0826dab875352e98673d5a) and [`Y`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a0bd128cee74865d0f82a1a17b83ead78) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a8e4e2b7d3441041bb0e521f0d069e0e3) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a6f8b6bd892cd739377de1248a1400ace) tilt angles describe the viewing plane direction. They correspond to the required rotations around X and Y axis that bring the Z axis parallel to the optical axis.

![](assets/images/easygauge/calibrationtiltxangle.webp)![](assets/images/easygauge/calibrationtiltyangle.webp)

### Perspective Strength

The [`perspective strength`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a5b8ce5d6f038c8fba2209375229b8f48) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a28e18bb7d0dca0dc59a6691532aa5df9) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a2e68f2cff0d85eae072f172b436973c0) gives a relative measure of the perspective effect. The shorter the focal length, the larger the value.

![](assets/images/easygauge/calibrationperspectiveweak.webp)![](assets/images/easygauge/calibrationperspectivestrong.webp)

### Distortion Strength

[`Distortion strength`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a2bd4972facaea98da81ffff6b74bb767) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#ab7e862d1314abd28545bbff499fb3828) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a03d52a6e4e08649e15468480dc5737dd) gives a relative measure of radial distortion in the image corners, that is the ratio of image diagonal length with and without distortion.

![](assets/images/easygauge/calibrationdistortionpositive.webp)![](assets/images/easygauge/calibrationdistortionnegative.webp)

[`Calibration modes`](../../../../doxygen_cpp/namespaceeVision.html#aa4f09c74296350db3ffce101d476f05a) [<sub>.NET</sub>](../../../../doxygen_cs/namespaceeVision.html#aadc222f93604cb16a11491a0bf6e52ae) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1ECalibrationMode.html), expressed as a combination of options, can be accessed via [`EWorldShape::GetCalibrationModes`](../../../../doxygen_cpp/classeVision_1_1Legacy_1_1EWorldShape.html#a48f18a1dc6aaec88a4d6ff2a26ffbeda) [<sub>.NET</sub>](../../../../doxygen_cs/classeVision_1_1Legacy_1_1EWorldShape.html#a913ff80816e0c9371416214b0b2a57aa) [<sub>Python</sub>](../../../../doxygen_python/classeVision_1_1Legacy_1_1EWorldShape.html#a47e46ecb1a337986d7c1b7c0bdb3c014).

### Effect of the Calibration Coefficients

![](assets/images/easygauge/calibrationnocoefficient.webp)![](assets/images/easygauge/calibrationallcoefficients.webp)
