Ask Your Question
0

estimateRigidTransform returns an empty matrix

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

Isa gravatar image

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

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...

mPointSetA.fromList(ListOfPointsA);

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
0

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

berak gravatar image

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

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

Comments

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

Isa gravatar imageIsa ( 2014-03-19 10:48:53 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 3,912 times

Last updated: Mar 19 '14