Help Center
Back Home
Serial port server
Composite robot terminal device
Composite robot terminal device
2D camera internal parameter calibration

If the camera manufacturer does not perform internal parameter calibration before the camera is shipped from the factory, then we must perform the calibration ourselves. The camera models currently requiring calibration are: Hikon camera, Daheng camera, and USB camera.

Currently, there are two methods for calibration. The first method requires the use of Matlab tools. The second method involves direct calibration in Roboshop.

1. Using matlab tool for calibration

For the internal parameters of the camera, the current requirement is to assist in the calibration process using the Matlab tool. The detailed installation steps are as follows:

Step 1: Connect the camera to your computer and turn it on. If you are using Matlab, you will need to install the camera driver package for the first time.

Step 2: Locate the calibration tool

The third step is to collect photos. It is recommended to use a checkerboard for calibration. It is necessary to print out the checkerboard in advance, and the size can be chosen as A4 paper.

In the Add Images section of Medium selection, select From camera. At this point, Matlab will call the camera for image acquisition. During the acquisition process, ensure that the camera captures the entire checkerboard from different angles for optimal results.

Select and click Capture to collect; choose Capture. A pop-up window will appear and prompt you to enter the actual physical size of the checkerboard grid.

Step 3: Begin calibration and compute internal parameters.

Once 20 images have been gathered, the collection process can be halted. Choose the third-order radial distortion coefficient from the available options and calculate the tangential distortion coefficient. Ensure that your reprojection has an overall mean error of less than 0.5 pixels.

The red lines in the above figure are explained as follows, in order: radial distortion coefficient (3rd order), tangential distortion coefficient (2nd order), world coordinate unit is millimeters, internal parameter matrix, minimum focal length (fx, fy), origin coordinate of imaging plane (unit is pixels).

Radial distortion coefficients correspond to Roboshop. The coefficients are k1, k2, and k3. Tangential distortion coefficients correspond to p1 and p2. The focal length corresponds to fx and fy. The imaging plane origin coordinates correspond to cx and cy.

2. Use the internal parameter calibration tool of roboshop for calibration

Step 1: Begin by turning on the camera and selecting "isRealShow" on the camera model configuration page.

Step 2: Navigate to the calibration interface and locate the options for calibrating camera parameters;

Step 3: Click on "Start Calibration", and you will see the real-time picture of the camera appear in the calibration interface. Click on the "Take Picture" button to save a picture, and the number in the parentheses indicates how many pictures have been saved.

Step 4: Collect at least 15 pictures. While collecting, ensure to capture the calibration board from various angles and directions. Once enough pictures are collected, click on the "calculate parameter" button.

Step 5: Following this, a pop-up window will appear. Enter the number of rows and columns based on the rows and columns of the tags on the calibration board. Choose a camera type and input 0.03 for mesh length and 0.3 for mesh spacing.

Step 6: Once calibration is finished, click the "End" button to terminate the process. The calibration results will be displayed on the interface. Click "Set calibration parameters" to input the results into the corresponding internal parameter area of the camera model.

Step 7: Click to view the calculation results. You will be able to see the calibration result chart, which can be used to analyze the accuracy of the calibration.

Step 8: The figure below displays the legend for the end of calibration. The green points along the path represent the corner points recognized by the algorithm, while the red points are the points reprojected on the calibration board after calibration. A successful calibration should closely align with both the red and green points. In the lower left corner, orange indicates the mean and maximum reprojection errors in pixels. The camera used in this legend is a standard USB camera, which has poor recognition accuracy. For industrial cameras, the average reprojection error should be less than 0.3.

Last updated 2023/05/02
Article content
  1. Using matlab tool for calibration
  1. Use the internal parameter calibration tool of roboshop for calibration