Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::TriangulatePoints drifting for points from same pose

Hi, I am encountering a strange issue with the triangulation function of openCV. For my two-view pose estimation tests, I was doing this:

Case 1: A single camera taking pictures of a scene from two views, then computing the essential matrix and triangulating the scene: which worked reasonably well. Also tested multiple pictures from pose 1 and multiples from pose 2, simulating a pair of cameras taking pictures continuously.

Case 2: I am trying to do this with two cameras (both calibrated), but triangulation is failing. For image pairs from the same poses, the triangulated points should be more or less the same (and indeed they were in case 1), but now, they are drifting.

Example:

t1 = [0.9950924870426178, 0.0518147862900856, -0.08429810290303305] (cam 2 at 0, 0, 0)
Homogenized feature match: (-0.1558, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point: [0.3234335097144092;  0.8584558734176684;  -5.836245557353]

t2 = [0.9962326376676536, 0.05676863562110455, -0.08508433760191333] (approx. the same as before)
Homogenized feature match: (-0.1557, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point: [0.3981734431737524; 1.069992964345484; -7.241918381979839]

What am I doing wrong here? For the next set of points, triangulatePoints comes up with another weird estimate. Initially, I was wondering if small changes in the R matrix were throwing it off track, but I tested the same thing with case 1, and even small changes in R and t still gave consistent triangulation results.

cv::TriangulatePoints drifting for points from same pose

Hi, I am encountering a strange issue with the triangulation function of openCV. For my two-view pose estimation tests, I was doing this:

Case 1: A single camera taking pictures of a scene from two views, then computing the essential matrix and triangulating the scene: which worked reasonably well. Also tested multiple pictures from pose 1 and multiples from pose 2, simulating a pair of cameras taking pictures continuously.

Case 2: I am trying to do this with two cameras (both calibrated), but triangulation is failing. For image pairs from the same poses, the triangulated points should be more or less the same (and indeed they were in case 1), but now, they are drifting.

Example:

t1 = [0.9950924870426178, 0.0518147862900856, -0.08429810290303305] (cam 2 at 0, 0, 0)
Homogenized feature match: (-0.1558, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point: [0.3234335097144092;  0.8584558734176684;  -5.836245557353]
 [-4.8177, -4.6760, 30.92588]

t2 = [0.9962326376676536, 0.05676863562110455, -0.08508433760191333] (approx. the same as before)
Homogenized feature match: (-0.1557, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point: [0.3981734431737524; 1.069992964345484; -7.241918381979839]
[-2.3599, -2.3053, 15.1603]

What am I doing wrong here? For the next set of points, triangulatePoints comes up with another weird estimate. Initially, I was wondering if small changes in the R matrix were throwing it off track, but I tested the same thing with case 1, and even small changes in R and t still gave consistent triangulation results.

cv::TriangulatePoints drifting for points from same pose

Hi, I am encountering a strange issue with the triangulation function of openCV. For my two-view pose estimation tests, I was doing this:

Case 1: A single camera taking pictures of a scene from two views, then computing the essential matrix and triangulating the scene: which worked reasonably well.

Case 2: I am trying to do this with two cameras (both calibrated), but triangulation is failing. For image pairs from the same poses, the triangulated points should be more or less the same (and indeed they were in case 1), but now, they are drifting.

Example:

t1 = [0.9950924870426178, 0.0518147862900856, -0.08429810290303305] (cam 2 at 0, 0, 0)
Homogenized feature match: (-0.1558, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point:  [-4.8177, -4.6760, 30.92588]

t2 = [0.9962326376676536, 0.05676863562110455, -0.08508433760191333] (approx. the same as before)
Homogenized feature match: (-0.1557, -0.1504, 1); (-0.0574, -0.1619, 1);
Triangulated point: [-2.3599, -2.3053, 15.1603]

What am I doing wrong here? For the next set of points, triangulatePoints comes up with another weird estimate.