# CUDA Accelerated GStreamer Camera Undistort - CUDA Accelerated GStreamer Camera Undistort Basics

CUDA Accelerated GStreamer Camera Undistort |
---|

Undistort Basics |

Getting Started |

User Guide |

Examples |

Performance |

Contact Us |

## Camera representation

The cuda-undistort element uses a camera matrix to represent the intrinsic properties of the camera. These parameters are unique to a camera and can be reused as long as it is the same camera. The matrix is defined as follows:

Where represents the optical center, and constitutes the focal length, both measured in pixels.

## Image distortion

Image distortion is a phenomenon that produces deviations from the scene to an image; in other words, not all straight lines in the scene remain straight when the image is captured. This can be useful for some applications; however, most of the time it's an undesired product of using different camera lenses.

There are different types of distortion. The CUDA undistort element focuses on two main categories: radial and tangential distortion.

### Radial distortion

Image distortion can be random and not follow any pattern; however, most of the time it has radial symmetry. The barrel and pincushion distortion are examples of radial distortion. This type of distortion is used by fisheye lenses to capture a wider field of view.

The following graphic represents an example of barrel distortion.

### Tangential distortion

This type of distortion is presented when the camera sensor is misaligned with the scene plane, producing a tilted effect like the one shown below.

## Distortion correction models

There are multiple distortion correction models that tackle different types of distortion. The cuda-undistort element implements the Fisheye and Brown-Conrady models.

### Notation

**Distorted pixel locations:**

**Undistorted pixel locations:**

- These are called normalized image coordinates and are calculated from pixel coordinates by translating to the optical center and dividing by the focal length in pixels. Thus, are dimensionless.

**Radial distortion coefficients:**

**Tangential distortion coefficients:**

### Fisheye model

This model is used to correct radial distortion only, it is described by the following equations.

The cuda-undistort camera calibration tool will provide you with the , , and parameters.

### Brown-Conrady model

This model can correct both radial and tangential distortion, it is described by the following equations.

The cuda-undistort camera calibration tool will provide you with the , , , , ,, and parameters.