## Camera Calibration: Tips and Techniques

Camera calibration is the process of determining the intrinsic and extrinsic parameters of a camera. Intrinsic parameters are properties of the camera itself, such as its focal length and principal point, while extrinsic parameters describe the position and orientation of the camera in the world. Accurate calibration is important for tasks such as 3D reconstruction, object tracking, and augmented reality, as well as for correcting distortions caused by the camera lens.

There are several approaches to calibrating a camera, including:

- Single-view calibration: This method uses a single image of a calibration pattern, such as a checkerboard, to determine the intrinsic parameters of the camera. The corners of the pattern are detected in the image, and the intrinsic parameters are found by minimizing the projection error between the detected corner points and the corresponding points in the 3D world.
- Multi-view calibration: This method uses multiple images of the calibration pattern taken from different views to determine both the intrinsic and extrinsic parameters of the camera. The intrinsic parameters are found by minimizing the projection error between the detected corner points and the corresponding points in the 3D world, while the extrinsic parameters are found by minimizing the projection error between the views.
- Self-calibration: This method does not require a calibration pattern or any prior knowledge about the camera. Instead, it relies on the fact that most real-world scenes contain sufficient structure to allow for the estimation of the camera’s intrinsic parameters. The method estimates the intrinsic parameters by minimizing the reprojection error between corresponding points in multiple views of the same scene.
- Photometric calibration: This method uses images of a uniformly-colored scene, such as a white wall, to determine the camera’s response function, which describes how the camera’s pixel values change with respect to the incident light intensity. The response function can then be used to correct for non-uniformities in the camera’s sensitivity, such as vignetting and color shading.

In summary, camera calibration is an important task in computer vision, and there are several approaches that can be used to determine the intrinsic and extrinsic parameters of a camera. Accurate calibration is essential for tasks such as 3D reconstruction, object tracking, and augmented reality, and it is also useful for correcting distortions caused by the camera lens.

## Single View Calibration

Single-view calibration is a method for determining the intrinsic parameters of a camera using a single image of a calibration pattern. The calibration pattern is typically a checkerboard with a known number of rows and columns of square black and white cells. The goal of single-view calibration is to determine the intrinsic parameters of the camera such that the projection of the 3D points corresponding to the corners of the checkerboard onto the image plane matches the locations of the detected corners as closely as possible.

To perform single-view calibration, the following steps are typically followed:

- Acquire an image of the calibration pattern. The image should be taken under uniform lighting conditions and should include the entire pattern within the field of view of the camera.
- Detect the corners of the checkerboard in the image. This can be done using a corner detection algorithm such as the Harris corner detector or the Shi-Tomasi corner detector.
- Determine the 3D coordinates of the corners of the checkerboard. The 3D coordinates of the corners can be computed from the known dimensions of the checkerboard cells and the known number of rows and columns.
- Estimate the intrinsic parameters of the camera. The intrinsic parameters are found by minimizing the projection error between the detected corner points in the image and the corresponding points in the 3D world. This can be done using a optimization algorithm such as least squares or non-linear least squares.
- Validate the estimated intrinsic parameters. The accuracy of the estimated intrinsic parameters can be checked by projecting the 3D points corresponding to the corners of the checkerboard onto the image plane using the estimated parameters and comparing the resulting locations to the detected corner points.

Single-view calibration is a simple and efficient method for determining the intrinsic parameters of a camera, but it has some limitations. One major limitation is that it does not provide any information about the extrinsic parameters of the camera, which describe the position and orientation of the camera in the world. To determine the extrinsic parameters, a multi-view calibration method must be used. Another limitation is that single-view calibration is sensitive to noise and outliers in the detected corner points, which can lead to inaccurate estimates of the intrinsic parameters. To address these issues, it is often necessary to use a multi-view calibration method or to apply robust estimation techniques to filter out outliers.

## Multi-View Calibration

Multi-view calibration is a method for determining the intrinsic and extrinsic parameters of a camera using multiple images of a calibration pattern taken from different views. The calibration pattern is typically a checkerboard with a known number of rows and columns of square black and white cells. The goal of multi-view calibration is to determine the intrinsic parameters of the camera such that the projection of the 3D points corresponding to the corners of the checkerboard onto the image plane matches the locations of the detected corners as closely as possible, and to determine the extrinsic parameters such that the projections of the 3D points onto the image plane from different views agree as closely as possible.

To perform multi-view calibration, the following steps are typically followed:

- Acquire multiple images of the calibration pattern from different views. The images should be taken under uniform lighting conditions and should include the entire pattern within the field of view of the camera.
- Detect the corners of the checkerboard in each image. This can be done using a corner detection algorithm such as the Harris corner detector or the Shi-Tomasi corner detector.
- Determine the 3D coordinates of the corners of the checkerboard. The 3D coordinates of the corners can be computed from the known dimensions of the checkerboard cells and the known number of rows and columns.
- Estimate the intrinsic and extrinsic parameters of the camera. The intrinsic parameters are found by minimizing the projection error between the detected corner points in each image and the corresponding points in the 3D world. The extrinsic parameters are found by minimizing the projection error between the views. This can be done using a optimization algorithm such as least squares or non-linear least squares.
- Validate the estimated intrinsic and extrinsic parameters. The accuracy of the estimated intrinsic and extrinsic parameters can be checked by projecting the 3D points corresponding to the corners of the checkerboard onto the image plane using the estimated parameters and comparing the resulting locations to the detected corner points.

Multi-view calibration is a more powerful method than single-view calibration because it allows for the determination of both the intrinsic and extrinsic parameters of the camera. However, it is also more complex and requires more computation than single-view calibration. In addition, multi-view calibration is sensitive to noise and outliers in the detected corner points, which can lead to inaccurate estimates of the intrinsic and extrinsic parameters. To address these issues, it is often necessary to apply robust estimation techniques to filter out outliers.

## Robust Estimation Techniques

Robust estimation techniques are methods that are resistant to the presence of outliers in the data. Outliers are data points that are significantly different from the majority of the data, and they can have a significant impact on the accuracy of an estimate if they are not properly handled. In the context of camera calibration, outliers can arise due to noise or errors in the detection of the corner points of the calibration pattern.

There are several robust estimation techniques that can be used to filter out outliers in the data in order to improve the accuracy of the camera calibration estimate. Some common techniques include:

- RANSAC (Random Sample Consensus): RANSAC is an iterative method that estimates the model parameters by fitting a subset of the data (called an “inlier set”) that is most consistent with the model. At each iteration, a random subset of the data is selected and the model parameters are estimated based on that subset. The subset of data that gives the best fit is chosen as the inlier set, and the model parameters are re-estimated based on the inlier set. This process is repeated until the model parameters converge or a maximum number of iterations is reached. RANSAC is effective at handling outliers because it only considers the inlier set in the final model estimate, and the inlier set is chosen based on the data points that are most consistent with the model.
- Least Median of Squares (LMedS): LMedS is a method that estimates the model parameters by minimizing the median of the squared residuals between the data points and the model. The residuals are the differences between the data points and the model predictions. LMedS is resistant to outliers because it is based on the median of the residuals rather than the mean, which is more sensitive to the presence of outliers.
- Least Trimmed Squares (LTS): LTS is a method that estimates the model parameters by minimizing the sum of the squared residuals after removing a certain percentage of the data points with the largest residuals. LTS is similar to LMedS in that it is resistant to outliers, but it is more computationally efficient because it only removes a small percentage of the data points rather than considering the entire dataset.

In summary, robust estimation techniques are useful for filtering out outliers in the data and improving the accuracy of the camera calibration estimate. These techniques can be applied in conjunction with single-view or multi-view calibration methods to improve their robustness to noise and errors in the detected corner points.

## Self-Calibration

Self-calibration is a method for determining the intrinsic parameters of a camera without the use of a calibration pattern or any prior knowledge about the camera. Instead, self-calibration relies on the fact that most real-world scenes contain sufficient structure to allow for the estimation of the camera’s intrinsic parameters. The method estimates the intrinsic parameters by minimizing the reprojection error between corresponding points in multiple views of the same scene.

To perform self-calibration, the following steps are typically followed:

- Acquire multiple images of a scene from different views. The images should be taken under uniform lighting conditions and should contain sufficient structure to allow for the estimation of the intrinsic parameters.
- Identify corresponding points in the different views of the scene. Corresponding points are points in the scene that can be uniquely matched between the different views. These points can be identified using feature detection and matching algorithms, such as SIFT or ORB.
- Estimate the intrinsic parameters of the camera. The intrinsic parameters are found by minimizing the reprojection error between the corresponding points in the different views. This can be done using a optimization algorithm such as least squares or non-linear least squares.
- Validate the estimated intrinsic parameters. The accuracy of the estimated intrinsic parameters can be checked by projecting the 3D points corresponding to the corresponding points in the different views onto the image plane using the estimated parameters and comparing the resulting locations to the detected points.

Self-calibration is a powerful method because it does not require a calibration pattern or any prior knowledge about the camera. However, it also has some limitations. One major limitation is that it does not provide any information about the extrinsic parameters of the camera, which describe the position and orientation of the camera in the world. To determine the extrinsic parameters, a multi-view calibration method must be used. Another limitation is that self-calibration is sensitive to the quality and quantity of the corresponding points in the different views of the scene. If the corresponding points are poorly distributed or there are too few of them, the intrinsic parameters may not be accurately estimated.

In summary, self-calibration is a method for determining the intrinsic parameters of a camera without the use of a calibration pattern or any prior knowledge about the camera. It relies on the presence of sufficient structure in the scene to allow for the estimation of the intrinsic parameters by minimizing the reprojection error between corresponding points in multiple views of the same scene. Despite its advantages, self-calibration has some limitations and is sensitive to the quality and quantity of the corresponding points in the different views of the scene.

## Photometric Calibration

Photometric calibration is a method for determining the camera’s response function, which describes how the camera’s pixel values change with respect to the incident light intensity. The response function can be used to correct for non-uniformities in the camera’s sensitivity, such as vignetting and color shading. Photometric calibration is typically performed using images of a uniformly-colored scene, such as a white wall or a gray card.

To perform photometric calibration, the following steps are typically followed:

- Acquire multiple images of a uniformly-colored scene under different lighting conditions. The images should be taken at different exposures and/or with different light sources to provide a range of pixel values.
- Measure the reflectance of the uniformly-colored scene. The reflectance of the scene can be measured using a spectrophotometer or other device that can accurately determine the spectral power distribution of the light reflected by the scene.
- Estimate the camera’s response function. The response function is estimated by comparing the measured reflectance of the uniformly-colored scene to the pixel values in the images. This can be done using a optimization algorithm such as least squares or non-linear least squares.
- Validate the estimated response function. The accuracy of the estimated response function can be checked by applying it to the images and comparing the resulting pixel values to the measured reflectance of the uniformly-colored scene.

Photometric calibration is an important step in many computer vision applications because it allows for the correction of non-uniformities in the camera’s sensitivity. Without accurate calibration, the colors and intensity of the pixels in the images may not accurately represent the actual scene, which can lead to errors in tasks such as color constancy, object recognition, and 3D reconstruction. Photometric calibration is typically performed as a separate step from geometric calibration (i.e., the determination of the intrinsic and extrinsic parameters of the camera), although some methods have been proposed for jointly estimating the geometric and photometric parameters of the camera.

In summary, photometric calibration is a method for determining the camera’s response function, which describes how the pixel values in the images change with respect to the incident light intensity. Photometric calibration is typically performed using images of a uniformly-colored scene and is used to correct for non-uniformities in the camera’s sensitivity. It is an important step in many computer vision applications, and it is typically performed as a separate step from geometric calibration.

## 2 Responses

Hello,

Nice write up. Can you provide me some paper references. I would like to see how self calibration works. Since the other models works since they know the distance between each corners. Which is unknown in the self calibration.

https://www.sciencedirect.com/science/article/abs/pii/S0141938221001062

https://www.sciencedirect.com/science/article/abs/pii/S104732031930313X

https://openaccess.thecvf.com/content_CVPR_2019/html/Li_Blind_Geometric_Distortion_Correction_on_Images_Through_Deep_Learning_CVPR_2019_paper.html

https://openaccess.thecvf.com/content_CVPR_2019/html/Xue_Learning_to_Calibrate_Straight_Lines_for_Fisheye_Image_Rectification_CVPR_2019_paper.html

https://openaccess.thecvf.com/content_WACV_2020/html/Zhang_DeepPTZ_Deep_Self-Calibration_for_PTZ_Cameras_WACV_2020_paper.html