Clear Filters
Clear Filters

Transformation from "triangulate" -coordinates to "reconstructScene" -coordinates

2 views (last 30 days)
We have a calibrated stereo camera system, which we use to both motion estimation and to measure real 3d objects. We solve 3d coordinates by using both
a) disparity map and reconstructScene -function (dense point cloud) and
b) SURF-features and "triangulate" function (sparse point cloud).
The 3d coordinates obtained by these two different methods seem to be in different coordinate system. How can we transform sparse point cloud to the coordinate system of the dense point cloud ie what is the transformation matrix between these two systems? I suppose we should be able to derive the transformation from stereo parameters (and this is also done somewhere in the intrinsic functions of the computer vision toolbox).
Below are rough outlines of both methods:
% Dense point cloud approach
% Rectify images
[J1, J2] = rectifyStereoImages(I1, I2,stereoParameters,'OutputView','full');
% Solve disparities
...
% Backproject
point3D = reconstructScene(disparities, stereoParameters);
% Sparse point cloud approach
% Undistort images
params = stereoParameters.CameraParameters1;
I1 = undistortImage(I1,params);
params = stereoParameters.CameraParameters2;
I2 = undistortImage(I{2},params);
% Detect, extract, and match SURF-features
...
% Backproject
[XYZ,reprojectionErrors] = triangulate(matchedPoints1,matchedPoints2,stereoParameters);
  1 Comment
Gilad Gottlieb
Gilad Gottlieb on 20 Aug 2020
Edited: Gilad Gottlieb on 20 Aug 2020
Have you managed to solve the problem?
I suspect that it is related to the homography matrix for the rectification.
as indicated in ReconstructScene, the dense point cloud suppose to be represented in camera 1 coordinate system, however when i darw sparse points in the same figure they seems to be translated apart.

Sign in to comment.

Answers (2)

Leo Leo
Leo Leo on 29 Dec 2019
i have the same question

Holger Mettelsiefen
Holger Mettelsiefen on 22 Aug 2022
I think this question is similar, and the accepted answer works out:
https://www.mathworks.com/matlabcentral/answers/1780505-match-the-coordinate-systems-of-triangulate-and-reconstructscene-with-disparitysgm

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!