Introduction
Lens distortion is a common anomaly in digital photography and computer vision. It causes straight lines to appear curved (radial distortion) or misaligned (tangential distortion). This project demonstrates how to calibrate a camera, calculate lens distortion coefficients, and rectify distorted images using MATLAB toolboxes to restore geometrical accuracy.
Methodology
Camera Calibration: A standard checkerboard pattern is utilized to capture multiple calibration images at different orientations. MATLAB's Camera Calibrator app or equivalent script estimates the camera intrinsic parameters, extrinsic parameters, and lens distortion coefficients.
Image Undistortion: The calculated parameters are applied to the distorted input images using the `undistortImage` function, which maps and interpolates pixels to output clean, rectified digital images.
Results
Geometrical lines are successfully rectified. The calibration errors are minimized to sub-pixel accuracy, which is essential for accurate distance measurements, 3D reconstruction, and robot navigation systems.