dice icon indicating copy to clipboard operation
dice copied to clipboard

Question about coordinate system and the reconstruction results.

Open cxn304 opened this issue 2 years ago • 1 comments

Dear Dr.Turner,

I hope this email finds you well. I have a question regarding a coordinate system and the reconstruction results. In Figure 1(a), I have presented the results of my point cloud reconstruction along with the camera positions. Figure 1(b) represents the world coordinates of the camera centers. I have referred to the 'load cal file' module in the 'dice/tests/regression/stereo_rectified/cal.xml' file of the DICE repository on GitHub, which states that the camera poses in the XML file are in the world-to-camera coordinate system. Therefore, Figure 1(c) shows the poses of two cameras as mentioned in the XML file. 1703162451944

Figure 1. From left to right: (a) Point cloud reconstruction results with camera positions and orientations; (b) World coordinates of camera centers; (c) Camera parameters from the XML file.

In Figure 2(a), I have selected a region of interest (ROI). Figure 2(b) displays the point cloud plot obtained by directly reading the XYZ coordinates from the 'DICe_solution_0.txt' file in the DICE's result (as described in the 'Triangulation.pdf' file, these points should be in the coordinate system of the left camera since I did not select the 'use best fit plane' option). Furthermore, Figure 3(c) shows the point cloud transformed into the world coordinate system along with the camera poses. It is evident that the point cloud plot in Figure 2(b) does not resemble a rectangular shape like the ROI in Figure 2(a); instead, it appears as a trapezoid. Moreover, it seems to deviate from the world coordinate system depicted in Figure 2(c). 1703162486794 Figure 2. From left to right: (a) ROI of the object; (b) plotting the point cloud from the xyz coordinates directly read from the DICe_solution_0.txt file; (c) the point cloud and camera poses after transformation to the world coordinate system.

I would greatly appreciate it if you could help me understand the reason behind this discrepancy and provide guidance on how I can rectify it.

Thank you for your attention to this matter.

cxn304 avatar Dec 21 '23 12:12 cxn304

Hi,

It looks to me like there is a slight mistake in the camera calibration parameters, in particular the extrinsic parameters. Have you taken a look at this report: https://github.com/dicengine/dice/blob/master/doc/reports/Triangulation.pdf? That might help clarify the conventions used.

Most of the time, the issue is a simple sign convention. Here's an example that might help that was developed to get the extrinsics between two satellite imagers (GOES 16 and 17): Screenshot 2023-12-21 at 6 28 32 AM The resulting extrinsics are: Screenshot 2023-12-21 at 6 28 44 AM If you define the extrinsics as above, you would want to set this parameter in the calibration file as well: <Parameter name="extrinsics_relative_camera_to_camera" type="bool" value="true" />

In the example above, the results would be in model coordinates as defined with the GOES 17 pinhole camera being the origin, Z pointing out from the camera lens. In the corresponding calibration file, camera 0 would have a unity matrix for the rotation matrix and zeros for the other extrinsics. Camera 1 would have the parameters in the image above.

dicengine avatar Dec 21 '23 13:12 dicengine