Why adjust and correct the camera?
Depending on the camera you use, there will be differences such as the focal distance and lens skew. The characteristic values (camera parameters) of cameras like this will affect the calculation process of the 3D positions marked by the image, this affects the placement of 3D objects after they are generated. In order to get the correct measurement results, you must adjust and correct the camera parameters before the experiment.
The official English website contains two methods for camera correction. (Artoolkit documentation-camera calibration)
- 1-step in-place correction (simple)
You only need to display the overlapping images to obtain a sufficient precision method.
- 2-step in-place correction method (relatively difficult)
The correction method used to obtain more scientific and accurate data (applicable to a 3-dimensional measurement)
Here we will only introduce the detailed process of the simple practice "Step 1 in place correction ".
Printed graphics for Camera Calibration
Usually, when camera calibration is performed, a piece of paper printed with a grid or separated by a dot matrix (also known as a calibration Board) is used, record the location of the grid dot matrix in the image and perform some simple calculations to calculate the camera parameters. Artoolkit contains the pattern and computing tool for lens correction.
The pattern used for correction contains the following PDF file.
C:/program files/artoolkit/patterns/calib_dist.pdf
Print this pattern on a blank sheet of white paper. (If there is no printer, it is also feasible to show the pattern in full screen on the Computer Display)
Lattice graphics (calib_dist.pdf) used by the calibration mirror Header)
After printing, use a ruler to measure the distance from the center of a vertex to the center of another vertex. Use millimeters as the unit of measurement. If it is printed on an A4 paper, the obtained spacing should be between 38mm and ~ In the range of 40mm. This value will come in handy.
Correction Implementation Method
Let's start to try and correct the camera. The following procedure is required for one-step in-place correction.
C:/program files/artoolkit/bin/calib_camera2.exe
When the program is started with 【1】double-click calib_camera2.exe, the following words are displayed.
Input the distance between each marker dot, in millimeters:
Enter the distance between the point and the point in millimeters. Enter the value measured with a ruler and press Enter 1. Then the dialog window set for screen capture will pop out, and press "OK" without making any changes. ※If you want to change the resolution, you can change the "camera image size" project.
After a value is entered, the following information is displayed, and the image window appears.
Input the distance between each marker dot, in millimeters: 38Camera image size (x,y) = (320,240)-----------Press mouse button to grab first image,or press right mouse button or [esc] to quit.argl error: Your OpenGL implementation and/or hardware's texturing capabilitiesare insufficient to support rectangle textures.
[2] Next, take all 4x6 points into the same screen, and click the left mouse button on the screen. Make sure that the pattern used for correction is flat.
[3] After double-clicking the left mouse button, the screen will be fixed and converted to the feature point record mode.
-----------Press mouse button and drag mouse to rubber-bound features (6 x 4),or press right mouse button or [esc] to cancel rubber-bounding & retry grabbing.
"Please press and hold the left mouse button to drag and drop 6x4 (24 in total) feature points, if you click the right-click or [ESC] key, the current record job will be abandoned and the capture screen status will be returned. An English message like this will be displayed. By dragging and dropping the mouse, you can select a range from one spot to one spot. The fields used for range selection are displayed as black and white colors. Drag and Drop the mouse to open the left mouse button. The center of the selected point indicates the Red Cross. After this operation, all 24 points are marked with the Red Cross. Note that the black spot clicking operation is sequential. You must click the black spot in the order of blue numbers.
|
The center of the black spot must be recorded in this Order |
This is displayed in the operation.
Marked feature position 1 of 24Marked feature position 2 of 24Marked feature position 3 of 24Marked feature position 4 of 24Marked feature position 5 of 24
[4] after recording all vertices, the following information is displayed. Click the left mouse button to save the feature point record. Right-click the record or the [ESC] key to clear the record result and record it from the original point ". If your record is correct, click the left mouse button on the screen.
Marked feature position 24 of 24-----------Press mouse button to save feature positions,or press right mouse button or [esc] to discard feature positions & retry grabbing.
[5] After you click the left mouse button, the coordinates of the point specified in the previous operation are displayed. The screen is activated and the static state is removed. The screen will show the words "click the left mouse button to start reading the image for the next stage of the record, right click or [ESC] key to find the diagonal line Image. The calibration camera must carry out at least two Dot Matrix Measurement records, which must be repeated here [2 ]~ 4.
-----------Press mouse button to grab next image,or press right mouse button or [esc] to calculate distortion parameter.
[6] after the record operation for 2nd feature points is completed, you must right-click the image and wait until the calculation is complete, the following information is displayed in the dot matrix connected by a red slash.
-----------Checking fit on image 1 of 2.Press mouse button to check fit of next image.
In this case, it is OK if the picture of the diagonal line and the grid work is displayed. Click the left mouse button on the screen to show the picture of the 2nd measurement records.
-----------Checking fit on image 2 of 2.Press mouse button to calculate parameter.
If the diagonal lines and square lines in the two pictures are correctly displayed, click the screen with the left mouse button.
[7] After some computation on the computer, if the following information is displayed, the correction is successful. "Camera calibration has been successful. Enter the file name to save the camera image ." Start a file name (for example, my_camera_para.dat) and press Enter.
Calibration succeeded. Enter filename to save camera parameter to below.--------------------------------------SIZE = 320, 240Distortion factor = 105.000000 81.500000 -30.700000 0.986381750.89434 0.00000 155.00000 0.000000.00000 1999.36684 32.50000 0.000000.00000 0.00000 1.00000 0.00000--------------------------------------Filename:
[8] the camera parameter file is generated in [C:/program files/artoolkit/bin. So far, the camera correction has been completed.
The default Camera Parameter used by the sample program is the following file.
C:/program files/artoolkit/bin/data/camera_para.dat
If you replace this file with a parameter file you have made, you can use your camera to produce a more accurate transparent image.