Is the information inside this page for you?
The manual calibration is needed ONLY in these 3 cases:
- you have not obtained good results during the calibration of a USB monocular camera and the Onit Support Team told you explicitly to use this guide.
- you have to calibrate a generic stereoscopic USB camera (for the calibration of the ASTAR stereo camera please follow the instructions at the beginning of this guide).
- you have to calibrate a stereoscopic USB camera made of 2 USB monocular cameras.
In all the other cases you need to use the Calibration tab of the Dragonfly Web User Interface and follow the instructions at these links:
Requirements
These are the prerequisites that MUST be met to make use of the Calibration App:
- OS: Linux
- USB camera: monocular or stereo.
- Dragonfly App installed.
Setup
- Download the Calibration App available at this link.
- Download the calibration pattern at this link.
- Open the calibration pattern on the screen of your PC or print it out on an A4 or Letter paper and place it on a plain table/desk or stick the calibration pattern on a cardboard cover. Do not perform the calibration with wobbly paper in your hand. Those results are unusable.
- Measure the distance in meters of the HDIST line visible inside the calibration pattern. Regardless of the fact that you read “distance in millimeters” on the calibration pattern.
Perform the calibration
- Open a Terminal on your Linux
- Go to the directory where you have downloaded the Calibration App and extract it.
unzip calibration_20200121.zip
- Run the executable named CalibrationApp. It should display the help and all the available options:
#on Linux
cd calibration_20200121/ubuntu
./CalibrationApp
3.1 – Monocular camera
- Launch the Calibration App with the following command to calibrate a monocular camera (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 0 --width 640 --height 480 --hdist 0.185 --output my_file
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 30 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected 30 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- You can now press Q to stop the Calibration App.
- The JSON calibration file has been saved inside the Calibration App directory and can be now moved inside the Dragonfly folder (application/data/config).
3.2 – Stereo camera (single device)
The stereo calibration is tricky and a bit longer to perform:
- First, it is required to perform a monocular calibration of the 2 cameras.
- If you have a single device stereo camera with concatenated images, launch this command to calibrate the LEFT side of the stereo camera (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 0 --width 1280 --height 480 --split vertical --select left --hdist 0.185 --output left
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 30 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected 30 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- Press CTRL + C to terminate the command.
- Launch this command to calibrate the RIGHT side of the stereo camera (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 0 --width 1280 --height 480 --split vertical --select right --hdist 0.185 --output right
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 30 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected 30 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- Press CTRL + C to terminate the command.
- Once the calibration file for both cameras is available, you can perform the stereo calibration by providing the 2 calibration files in option. Example (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 0 --width 1280 --height 480 --split vertical --calib_left left.json --calib_right right.json --hdist 0.185 --output stereo
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 40 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected at least 40 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- You can now press Q to stop the Calibration App.
- The “stereo.json” calibration file has been saved inside the Calibration App directory and can be now moved inside the Dragonfly folder (application/data/config).
3.3 – Stereo camera (dual device – 2 monocular cameras)
The stereo calibration is tricky and a bit longer to perform:
- First, it is required to perform a monocular calibration of the 2 cameras.
- If you have a stereo camera made of 2 monocular cameras launch this command to calibrate the LEFT camera (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 1 --width 640 --height 480 --hdist 0.185 --output left
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 30 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected 30 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- Press CTRL + C to terminate the command.
- Launch this command to calibrate the RIGHT camera (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 2 --width 640 --height 480 --hdist 0.185 --output right
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 30 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected 30 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- Press CTRL + C to terminate the command.
- Once the calibration file for both cameras is available, you can perform the stereo calibration by providing the 2 calibration files in option. Example (change the hdist value accordingly BUT don’t change the resolution shown in the command below!):
./CalibrationApp --webcam 1 --webcam_right 2 --calib_left left.json --calib_right right.json --hdist 0.185 --output stereo
- You should now see the preview of your camera. If you hold your calibration pattern to the camera, you should see the black dots being connected by colored lines. It doesn’t matter whether you move the camera over the calibration pattern or the calibration pattern in front of the camera.
- Your challenge is now to collect 40 different pictures. The pictures taken should be as diversified as possible:
- Translate and rotate the pattern between each picture along every axis.
- Avoid taking two pictures of the pattern in the same position.
- To collect a picture press P.
- Once you have collected at least 40 pictures press ENTER. The Calibration App will start the computation of the calibration parameters of your camera and you will be notified once this process is finished.
- You can now press Q to stop the Calibration App.
- The “stereo.json” calibration file has been saved inside the Calibration App directory and can be now moved inside the Dragonfly folder (application/data/config).