Ask Your Question

Revision history [back]

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculate the P1, and P2 finally use P1, P2 and two camera points If the the rvecL is 0 degree in all direction, the following works fine. WorldPoint=WorldPointEst However, if i add roll to any degree in x direction, WorldPoint != WorldPointEst (surpposed to be same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L); projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

for(int i =0; i<imagepoint_l.size(); i++)="" {="" triangulatepoints(p1,="" p2,="" mat(imagepoint_l[i]),="" mat(imagepoint_r[i]),="" worldpointest);="" }<="" p="">

click to hide/show revision 2
None

updated 2018-02-14 01:34:26 -0600

berak gravatar image

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculate the P1, and P2 finally use P1, P2 and two camera points If the the rvecL is 0 degree in all direction, the following works fine. WorldPoint=WorldPointEst However, if i add roll to any degree in x direction, WorldPoint != WorldPointEst (surpposed to be same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L);
projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

Q);

for(int i =0; i<imagepoint_l.size(); i++)="" {="" triangulatepoints(p1,="" p2,="" mat(imagepoint_l[i]),="" mat(imagepoint_r[i]),="" worldpointest);="" }<="" p="">

i<imagePoint_L.size(); i++) { triangulatePoints(P1, P2, Mat(imagePoint_L[i]), Mat(imagePoint_R[i]), worldPointEst); }

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculate caculates the P1, and P2 finally use P1, P2 and two camera points points to caculate the worldPoint again.

If the the rvecL is 0 degree in all direction, the following works fine. WorldPoint=WorldPointEst

However, if i add roll to any degree in x direction, WorldPoint != WorldPointEst (surpposed to be same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L);
projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

for(int i =0; i<imagePoint_L.size(); i++)
{
triangulatePoints(P1, P2, Mat(imagePoint_L[i]), Mat(imagePoint_R[i]), worldPointEst);
}

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculates the P1, and P2 finally use P1, P2 and two camera points to caculate the worldPoint worldPointEst again.

If the the rvecL is 0 degree in all direction, WorldPoint=WorldPointEst

However, if i add roll to any degree in x direction, WorldPoint != WorldPointEst (surpposed to be same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L);
projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

for(int i =0; i<imagePoint_L.size(); i++)
{
triangulatePoints(P1, P2, Mat(imagePoint_L[i]), Mat(imagePoint_R[i]), worldPointEst);
}

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculates the P1, and P2 finally use P1, P2 and two camera points to caculate the worldPointEst again.

If the the rvecL is 0 degree in all direction, WorldPoint=WorldPointEst

However, if i add roll to any degree in x or y direction, WorldPoint != WorldPointEst (surpposed to be same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L);
projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

for(int i =0; i<imagePoint_L.size(); i++)
{
triangulatePoints(P1, P2, Mat(imagePoint_L[i]), Mat(imagePoint_R[i]), worldPointEst);
}

stereoRectify, projectPoints, triangulatePoints

Hi, I am simulating 3D->2D->3D process. first, i project worldPoint to two camera points(left and right) then, use stereoRectify caculates the P1, and P2 finally use P1, P2 and two camera points to caculate the worldPointEst again.

If the the rvecL is 0 degree in all direction, WorldPoint=WorldPointEst

However, if i add any degree in x or y direction, WorldPoint != WorldPointEst (surpposed to be the same)

Any help for this? Thanks in advanced

----------------------------------------code sample---------------------------------------------------

projectPoints(worldPoint, rvecL, tvecL, cameraMatrix_L, distCoeffs_L, imagePoint_L);
projectPoints(worldPoint, rvecR, tvecR, cameraMatrix_R, distCoeffs_R, imagePoint_R);

stereoRectify(cameraMatrix_L, distCoeffs_L, cameraMatrix_R, distCoeffs_R, cv::Size(640,480), R_rotation_Matrix_rev, R_translation, R1, R2, P1, P2, Q);

for(int i =0; i<imagePoint_L.size(); i++)
{
triangulatePoints(P1, P2, Mat(imagePoint_L[i]), Mat(imagePoint_R[i]), worldPointEst);
}