Member-only story
3 Ways To Calibrate Your Camera Using OpenCV and Python
Fix camera distortions in an easy way.
When a camera takes a photograph, we often see the image not quite the same as we see it in our brain. This is caused by the camera lens and it happens more than we think.
This alteration of the image is what we call distortion.
Generally speaking, distortion is when a straight lines appear bent or curvy in an image.
There are different types of distortion, depending essentially on the model of the camera lens you used.
Although you sometimes want to create a nice effect on your images, a distortion can be bad for computer vision systems. Since the coordinates of the image are deviated from its original position, you might create some errors or fail to detect an object.
When you calibrate a camera, you discover some specific parameters that will fix these distortions.
Camera Model
A camera model describes a relationship between a point in a 3D space and its projection into a 2D space (an image). The pinhole camera model is often used in computer vision as a reasonable approximation of a camera.
Duration the calibration process, some parameters are discovered to fix most of the distortions caused by a camera:
- Intrinsic parameters: focal length, optical center, and skew coefficients. Specific to each camera.
- Extrinsic parameters: rotation and translation vectors that translate a 3D scene into a 2D coordinate.
- Radial distortion coefficients: it models the radial distortion, that causes straight line to appear curved. It occurs when light rays bend more near the edges of a lens than they do at its optical center.
- Tangential distortion coefficients: it models the…