-
Notifications
You must be signed in to change notification settings - Fork 790
Depth Calibration
RTAB-Map >=0.11.10 required
This tutorial shows how to calibrate the depth of RGB-D sensors using CLAMS approach (integrated in RTAB-Map for convenience) to reduce depth distortions at longer range. We assume that the RGB-D sensor has relatively accurate depth under 4 meters to get good visual odometry and that RGB and depth images are already rectified and registered. If not, this approach will not work!
-
Start a new map in RTAB-Map. Create the map following the tips in the Recording section of CLAMS. Here is an example using this sample database: clams_example.db. In this database, the camera is always seeing objects under 3-4 meters to get good odometry while looking the far wall. Rotating the camera is important to get training samples (at multiple depths up to 10 meters) for all pixels in the image.
-
Make sure the trajectory/map is looking okay before continuing to next step. If not, return to step 1. Do "Edit->View high-res point clouds...", then set parameters as in the first screenshot below (same parameters that will be used for depth calibration). You may also want to do "Tools->Post-processing..." before to get a more accurate map.
-
Open depth calibration dialog: "File->Depth calibration...", and click "Calibrate".
-
At the end of the process, you will be asking to save the distortion model and an overview of the calibration will be shown as below. Five samples of the distorsion model taken at 2,4,6,8 and 10 meters. On left, the white pixels show that enough training samples were taken while black pixels show missing training examples. So in this example, we are lacking some long-range information at the bottom left.
-
You can apply the resulting distortion model when regenerating the map:
-
To use the distortion model on runtime, set it in Source panel of Preferences dialog.
-
If you want to use multiple mapping sessions for the calibration, as recommended on CLAMS website, leave unchecked "Reset previous model." in the "Depth Calibration" dialog. After one calibration, you can close your current database, open another one and go back to "Depth Calibration" dialog. You will see at the bottom of the dialog how many training samples are already in the model. Clicking on "Calibrate" will add training samples to current model.
-
To see the actual 3D map and point of views used for calibration, set the level of the logger in "Preferences dialog->Logging" to Debug. You will also see a comparison of the depth images used and the corresponding ground truth depth images generated from the 3D map.