visp
visp copied to clipboard
[example/device/framegrabber/saveRealSenseData] Wrong camera parameters and depth_M_color homogeneous matrix when aligned depth is requested
System
- Ubuntu 20.04
- Realsense 2.50.0 (built from source)
- ViSP v3.5.0 (built from source)
- Intel D435
./example/device/framegrabber/saveRealSenseData
When aligned depth is requested -a:

the depth and the color camera parameters should be similar: ROS-based example:

Here, with saveRealSenseData, the resulting camera parameters are:
camera.xml:
<?xml version="1.0"?>
<root>
<!--This file stores intrinsic camera parameters used
in the vpCameraParameters Class of ViSP available
at https://visp.inria.fr/download/ .
It can be read with the parse method of
the vpXmlParserCamera class.-->
<camera>
<!--Name of the camera-->
<name>color_camera</name>
<!--Size of the image on which camera calibration was performed-->
<image_width>640</image_width>
<image_height>480</image_height>
<!--Intrinsic camera parameters computed for each projection model-->
<model>
<!--Projection model type-->
<type>perspectiveProjWithDistortion</type>
<!--Pixel ratio-->
<px>605.146728515625</px>
<py>604.79150390625</py>
<!--Principal point-->
<u0>325.53253173828125</u0>
<v0>244.95083618164062</v0>
<!--Undistorted to distorted distortion parameter-->
<kud>-0</kud>
<!--Distorted to undistorted distortion parameter-->
<kdu>0</kdu>
</model>
</camera>
<camera>
<!--Name of the camera-->
<name>depth_camera</name>
<!--Size of the image on which camera calibration was performed-->
<image_width>640</image_width>
<image_height>480</image_height>
<!--Intrinsic camera parameters computed for each projection model-->
<model>
<!--Projection model type-->
<type>perspectiveProjWithDistortion</type>
<!--Pixel ratio-->
<px>381.7528076171875</px>
<py>381.7528076171875</py>
<!--Principal point-->
<u0>323.32614135742188</u0>
<v0>236.82505798339844</v0>
<!--Undistorted to distorted distortion parameter-->
<kud>-0</kud>
<!--Distorted to undistorted distortion parameter-->
<kdu>0</kdu>
</model>
</camera>
<camera>
<!--Name of the camera-->
<name>infrared_camera</name>
<!--Size of the image on which camera calibration was performed-->
<image_width>640</image_width>
<image_height>480</image_height>
<!--Intrinsic camera parameters computed for each projection model-->
<model>
<!--Projection model type-->
<type>perspectiveProjWithDistortion</type>
<!--Pixel ratio-->
<px>381.7528076171875</px>
<py>381.7528076171875</py>
<!--Principal point-->
<u0>323.32614135742188</u0>
<v0>236.82505798339844</v0>
<!--Undistorted to distorted distortion parameter-->
<kud>-0</kud>
<!--Distorted to undistorted distortion parameter-->
<kdu>0</kdu>
</model>
</camera>
</root>
Furthermore, in this case (depth aligned to the color frame), depth_M_color should be an identity matrix. With or without the -a option, we're getting the same homogeneous matrix. In my case:
0.999972403 -0.00671335822 -0.003179509426 -0.01465611346
0.006699616555 0.9999682307 -0.004313052632 9.024870815e-05
0.003208363429 0.004291632213 0.9999856353 -0.0004482123477
0 0 0 1