# Affinity

## Characterization

The affinity model of our intrinsics aims to characterize errors or abberations
in the image plane that appear as affine transformations of our image
coordinates. These can be caused by various effects depending on the type of
camera and underlying electronics that power the camera. Primarily, we
categorize these into *scale* and *shear* effects.

Taking our generalized projection model, we can characterize these effects in the form of:

It is worth mentioning that while \(g_{\mathsf{affinity}}\) can be modeled according to effects in \(x\), effects in \(y\), or both, the Tangram Vision Platform uses the convention of only applying our affinity model to the \(x\) dimension for the sake of simplicity.

## Scale

The scale model aims to describe differences in pixel scaling in the \(x\) (column) and \(y\) (row) dimensions of our image plane.

Helping You Help Yourself

In many perception systems, this is modeled as \(f_x\) and \(f_y\). See our explanation of the projection model for why Tangram doesn't follow this paradigm.

Scale effects may be due to:

- Measured physical differences in pixel size (i.e. rectangular pixels). This is actually quite rare.
- Differences between the clock frequencies of the analog CCD / CMOS clock and the sampling frequency of the Digital-Analog Converter (DAC) in the frame grabber.
- Projective compensation effects resulting from an insufficient range of depths in the set of object space points used to calibrate. This is often the case if flat checkerboards are used for calibration.

The way that we model this effect is with a single linear coefficient \(a_1\), as follows:

Further Reading

Read the Tangram Vision Blog post on focal length for a more complete explanation of these effects.

## Shear

Shear effects model a non-orthogonality between pixels. In effect, we would be modeling our image plane being shaped more like a rhombus than a square or rectangle.

For most full-frame cameras, this effect is not typically worth modeling, nor is it something that can be typically observed in practice. However, shear effects can be apparent in many line or push-broom cameras. This effect can be modeled as follows:

## Scale and Shear

Combining the two possible models above, we get a unified affinity model.