Install driver libfreenect2 and IAI Kinect2 for OpenCV 4 under ros before camera calibration
Install Kinect v2 driver libfreenect2 tutorial
Install IAI Kinect2 for OpenCV 4 tutorial under ros
Why install IAI Kinect2 for OpenCV 4 instead of the official library, this is Because using the official library for calibration will report an error and cannot be calibrated, see the above tutorial for details
calibration
The calibration process is carried out according to the steps in the official tutorial, the tutorial link
Download calibration board
I chose chess5x7x0.03, consistent with the tutorial, and then printed it out and pasted it on a flat surface
Calibration procedure
- Open a window to start the bridge node
rosrun kinect2_bridge kinect2_bridge _fps_limit:=2
- Create a new folder for storing calibration data, and the path can be modified according to the actual situation
mkdir ~/kinect_cal_data; cd ~/kinect_cal_data
- Take
color
a picturerosrun kinect2_calibration kinect2_calibration chess5x7x0.03 record color
, if it prompts that the package cannot be found, click firstsource
, and the correspondingsource
path should be changed to the subdirectory where you store itiai_kinect2_opencv4
,catkin_ws
because the location where you save the calibration data may not becatkin_ws
in the subdirectory, eg:source ~/catkin_ws/devel/setup.bash
. Take at least 100 photos - calibration internal reference,
rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate color
- Take photos
ir
,rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 record ir
, at least 100 photos - Calibrate
ir
the internal parameters of the camera,rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate ir
- Take
color
andir
sync photos,rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 record sync
, take at least 100 photos - Calibration of external parameters,
rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate sync
- calibrated depth measurement,
rosrun kinect2_calibration kinect2_calibration chess5x7x0.03 calibrate depth
- View the device number of the camera,
roslaunch kinect2_bridge kinect2_bridge.launch
, you can see the device number from the output content
kinect2_bridge/data
Create a new calibration file for the device underroscd kinect2_bridge/data; mkdir 008426164947
- Copy , , , into
kinect2_cal_data
_ _calib_color.yaml
calib_depth.yaml
calib_ir.yaml
calib_pose.yaml
008426164947
verify
cd ~/catkin_ws
source devel/setup.bash
roslaunch kinect2_bridge kinect2_bridge.launch
# 新开窗口
rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud