SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
Most digital cameras suffer from some degree of nonlinear geometric distortion. A spatial transformation is required to correct the distortion. In automotive applications, cameras use wide angle lenses, including fisheye lenses to provide 180+° field of view. To visually present the scene to the user in an easy-to-consume representation, these distortions need to be corrected
Back mapping gives coordinates of the distorted image as a function of coordinates of the undistorted output image. Correction involves back-mapping each output pixel to a location in the source distorted image, and thus the corrected image is fully populated. As the distorted pixel locations mostly fall onto fractional coordinates, correction involves interpolation among the nearest available pixels.
For any distortion, the user must determine the overlap between the distorted space and the input image coordinates. Valid image data is produced only for those points where the distorted space lies completely within the valid input image.
As shown in Figure 9-203, the LDC consists of a back mapping block, a x/y offset table, image buffer interface, buffer, and an interpolation block.
Figure 9-203 is a block diagram of the LDC.
Given the coordinates of the undistorted image, the corresponding coordinates of the distorted image are calculated by combining the output coordinates and the offsets from the offset table. Distorted pixels are read from the image buffer, and buffered for the bilinear interpolation. After the interpolation, corrected image is written back to the image buffer.
The LDC processes the image in small two-dimensional (2D) blocks. The software configures appropriate parameters, then initiates the LDC function by writing to an LDC register. The LDC controls the sequencing through 2D blocks, DMA transfers, and computation to process an entire image autonomously. Interrupt, if enabled, is asserted at the completion of the image.
The LDC can also be stalled and controlled on a macroblock basis by an external controller. The LDC provides an intermediate interrupt to facilitate this. The LDC can be stalled by deasserting the write request enable on the output write port.
To start the LDC, software must set the LDC_PCR[0] EN bit to 1. The LDC_PCR[2] BUSY bit is a status that reflects LDC activity.