Ask Your Question

estimateRigidTransform returns an empty matrix

asked 2014-03-19 10:07:07 -0500

Isa gravatar image

updated 2014-03-19 10:32:36 -0500

berak gravatar image

Hey all,

I'm trying to use estimateRigidTransform in my program to find the best transformation matrix between two point sets using only translation, rotation & uniform scaling.

My two point sets are of type

MatOfPoint2f mPointSetA;
MatOfPoint2f mPointSetB;

and are both of size 20. (They do have 20 rows) For those who wonder, I get them like this:

LinkedList<Point> listOfPointsA;
// fill list with points...


Now I'm calling:

Mat R = Video.estimateRigidTransform(mPointSetA, mPointSetB, false);

But the R that I get is of size 0x0! Could anybody tell me what I'm missing here?

Thanks in advance for any help! Isa

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-03-19 10:31:43 -0500

berak gravatar image

updated 2014-03-19 10:34:25 -0500

an empty Mat is actually a valid result.

it could not find a ransac estimation for your pointsets, so it returned an empty matrix.

try again with better data.

and you probably should check for M.empty()

edit flag offensive delete link more


I see, thats even better. But I thought, estimateRigidTransform doesn't use RANSAC?

Isa gravatar imageIsa ( 2014-03-19 10:48:53 -0500 )edit

to be honest, i just stepped through it in c++ using some dummy data, and ended up here

berak gravatar imageberak ( 2014-03-19 11:10:19 -0500 )edit

Question Tools


Asked: 2014-03-19 10:07:07 -0500

Seen: 3,508 times

Last updated: Mar 19 '14