Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

estimateRigidTransform returns non sensical values

Hi all,

I am trying to estimate an affine transform from two point sets. Here is the sample code that I am running to verify estimateRigidTransform.

std::vector< Point2f > obj1; std::vector< Point2f > scene1; for (int i=0;i<10;i++) { obj1.push_back(Point2f(i,i+10)); scene1.push_back(Point2f(i+10,i+20)); } Mat H1 = estimateRigidTransform(obj1,scene1,false); cout << H1 << endl;

The output I get is: [-4.836697827223e-026, -4.836697827223e-026, -4.836697827223e-026; -4.836697827223e-026, -4.836697827223e-026, -4.836697827223e-026]

What am I doing wrong?

Also, I would like to estimate the transformation robustly. Is there any sample code there for using RANSAC/or other robust methods on top of estimateRigidTransform?

Thanks HIy

click to hide/show revision 2
formated code for better readability

estimateRigidTransform returns non sensical values

Hi all,

I am trying to estimate an affine transform from two point sets. Here is the sample code that I am running to verify estimateRigidTransform.

std::vector< Point2f > obj1;
std::vector< Point2f > scene1;
for (int i=0;i<10;i++)
{
    obj1.push_back(Point2f(i,i+10));
    scene1.push_back(Point2f(i+10,i+20));
}
Mat H1 = estimateRigidTransform(obj1,scene1,false);
cout << H1 << endl;

endl;

The output I get is: is:

[-4.836697827223e-026, -4.836697827223e-026, -4.836697827223e-026;
  -4.836697827223e-026, -4.836697827223e-026, -4.836697827223e-026]

-4.836697827223e-026]

What am I doing wrong?

Also, I would like to estimate the transformation robustly. Is there any sample code there for using RANSAC/or other robust methods on top of estimateRigidTransform?

Thanks HIy