ROS learning - using computer camera calibration

1. Install usb-cam package and calibration data package

sudo apt-get install ros-kinetic-usb-cam
sudo apt-get install ros-kinetic-camera-calibration 

Change kinetic to your own ros version.

2. Start the camera

roslaunch usb_cam usb_cam-test.launch

an interface will appear

 You can use the following command to check which parameters are released by the camera:

rostopic list

 You can use the following command to view the specific type of the published message:

rostopic info /usb_cam/image_raw

We can see the publisher and receiver:

3. Start the camera calibration package

rosrun camera_calibration cameracalibrator.py  --size 8x6 --square 0.024 image:=/usb_cam/image_raw camera:=/usb_cam

black and white camera

 4. Carry out camera calibration

Go to the Internet to find chess calibration pictures, aim at the computer camera, and then rotate in different directions, the camera will capture pictures from different angles (when there are colored lines on the chessboard, the current picture on the surface is effectively captured, when the chessboard is almost full of the camera interface The success rate of capturing images is highest when . About 40 photos were captured (estimated to take 1 to 5 minutes), and the blue-green "calibrate" button appeared on the right, indicating that the calibration was completed.

Click the "calibrate" button to start calculating the camera parameters and display them on the terminal. After that, three blue-green buttons will appear on the interface, click the "save" button, and the parameters will be saved.

The address where the parameters are saved will be displayed on the last line of the terminal.

 

Open the saved location, you can see the pictures and parameter files "ost.txt" and "ost.yaml" during calibration

 

Guess you like

Origin blog.csdn.net/bulletstart/article/details/130892720