By Marcus Orciuch, Solutions Engineer
Lens Distortion Correction (LDC) is a digital image processing technique used for rectifying the distortions introduced by the inherent optical properties of camera lenses. Correcting these distortions is critical for accurate representations of objects and improving the reliability of computer vision applications like facial recognition. LDC profiles are often built specifically for a lens based on known distortion characteristics and patterns, and then applied after the image is captured.
When deploying a security surveillance system, LDC should be enabled to ensure proper undistorted coverage and optimal analytical performance.
Background
Most camera lenses used in modern imaging devices utilize curvilinear lenses, which are circular. Curvilinear lenses are cost-effective, however, they introduce two major types of geometric distortion in the final image: barrel and pincushion. These distortions occur because as a light ray passes through the curved surface of a lens, the ray experiences varying degrees of refraction depending on where the ray intersects with said curvature. This causes portions of the image to be magnified or compressed unevenly, more specifically on the edges of an image.
The examples below demonstrate the difference: barrel distortions depict a shape’s edges as curving away from the center of the image, whereas pincushion distortions bend edges toward the center of the image.
Barrel Distortion:
Pincushion Distortion:
The type of distortion depends on a number of other factors, like the number of optical elements inside the lens, the aperture of the lens, and whether the lens is varifocal. Typically, barrel distortions are found on wide-angle lenses, while pincushion distortions are found often in telephoto zoom lenses.
How Does Lens Distortion Correction Work?
LDC reduces the geometric distortion by utilizing a lens profile created specifically for a particular lens. Each profile is created by identifying the distortion characteristics of a lens through an analysis of known patterns and calibration charts.
Different parameters, such as image sensor surface area, output resolution, focal length, etc, are tested against known distortion patterns of that lens and applied to the image data. Once the calibrator visually confirms that the parameters used are correctly dewarping an image, these parameters can be bundled together to form a corrective lens profile.
If the distortion characteristics of the lens are unknown, there are generic LDC algorithms that can be employed.
Why is Lens Distortion Correction used?
In the context of security camera systems, correcting the lens distortion serves an important function for general performance and generating predictable results. Dewarped video feeds not only ease human monitoring but also improve the accuracy of detection systems that employ Computer Vision (CV).
Most modern camera systems utilizing CV-based analytics, like facial, person, or vehicle detection, require LDC to perform optimally. This is because the cost of incorporating distorted training data within a single CV model outweighs the cost of performing LDC on every camera. If a CV model were to include distorted training data, the model would be larger, thus decreasing the speed at which the model could perform detections. Keeping a CV model lean and applying LDC on every CV-based camera makes it easier to make the model better across cameras with different lens profiles.
LDC is a key part of modern imaging, however, this technique does come with one notable drawback. Once LDC is employed, the overall field of view is effectively reduced. In the example above, one can observe that some of the details captured at the edges of the frame are lost once LDC is enabled. This is because the LDC algorithm involves some cropping and remapping of certain parts of the image, thus consuming some of the detail captured in the outer areas of the image.
Below is an example of the field of view with LDC off (purple) and LDC on (red).
Despite the drawback of a reduced field of view, the benefits of improved accuracy and reliability in security applications often outweigh this limitation. It is therefore highly recommended to enable LDC on all security cameras, especially ones utilizing computer vision analytics to ensure optimal performance of the system. When planning physical security deployments, coverage should be based on the field of view with LDC enabled to ensure optimal analytic performance.