I would like to know the correspondence between the index of the point cloud calculated by
reprojectImageTo3d and the index of the disparity image, which is the input image.
I have used
reprojectImageTo3d to generate a point cloud using a disparity image generated from stereo matching and a Q-matrix with pre-calibration parameters.
And it seems to be working well.
Furthermore, the contour is extracted from the disparity image and the masked RGB image, and the center point of the contour is obtained in image coordinates.
I want to get the point cloud corresponding to the image coordinate (index), but the index
(u, v) of the image coordinate and the index
i of the point cloud cannot be mapped.
Specifically, the index of the image coordinate cannot be applied to the index of the point cloud, so it is assumed to be the index when it is stored in the 1d array as shown below.
i = (row * len(row)) + col
Using the above index, I tried to get the corresponding point cloud, but it was different from the index of the point cloud.
I believe this is theoretically correct, but is there anything wrong with it?