Welcome to NUWA-HP60C Depth Camera repository
2. Camera internal parameter calibration
2. Camera intrinsic calibration
1. Preparation before calibration
- A large chessboard of known size. This tutorial uses a 9x6 chessboard with 20 mm squares, which needs to be flattened during calibration. Calibration uses the internal vertices of the chessboard, so a "10x7" chessboard uses the internal vertex parameters "9x6", as shown in the example below. Any size of calibration board can be used, just change the parameters. A more open area without obstacles and calibration board patterns
- Monocular camera that publishes images through ROS
2. Start calibration
Install the calibration function package camera_calibration. Take foxy as an example. Enter in the terminal,
sudo apt install ros-foxy-camera-calibration*
Start the camera before calibration, and turn it off after all calibrations are completed. Start the camera and enter in the terminal,
xxxxxxxxxxros2 launch ascamera hp60c.launch.py
Use the following command to view the topic terminal input,
xxxxxxxxxxros2 topic list

The topic we need to use to calibrate RGB color images is /ascamera_hp60c/camera_publisher/rgb0/image.
To run the calibration program, enter in the terminal,
xxxxxxxxxxros2 run camera_calibration cameracalibrator --size 9x6 --square 0.02 --ros-args --remap /image:=/ascamera_hp60c/camera_publisher/rgb0/image
size: the number of internal corner points of the calibration chessboard, for example, 9X6, the corner points have six rows and nine columns.
square: the side length of the chessboard, in meters.
Topic name: /ascamera_hp60c/camera_publisher/rgb0/image. If you are starting usb_cam, change it to /image_raw

X: Left and right movement of the chessboard in the camera's field of view
Y: Up and down movement of the chessboard in the camera's field of view
Size: Front and back movement of the chessboard in the camera's field of view
Skew: Tilt and rotation of the chessboard in the camera's field of view
As shown in the figure above, you need to capture the image by flipping up and down, front and back, left and right, so that the X, Y, Size, and Skew on the right turn green, as shown in the figure below, and then click CALIBRATE to start calibration.

After the calibration is completed, click SAVE, as shown in the figure below.

The calibration results are saved to [/tmp/calibrationdata.tar.gz], and the saved path is the terminal directory where the calibration program is started. After the calibration is completed, you can move out the [/tmp/calibrationdata.tar.gz] file to view the contents
xxxxxxxxxxsudo mv /tmp/calibrationdata.tar.gz ~
Terminal input,
xxxxxxxxxxcd ~tar -xvf calibrationdata.tar.gz
You will get the calibration png file, ost.yaml and ost.txt files in the terminal directory