gadomski / cpd

C++ implementation of the Coherent Point Drift point set registration algorithm.
http://www.gadom.ski/cpd
GNU General Public License v2.0
385 stars 122 forks source link

Get scale info from rigid? #102

Closed antithing closed 7 years ago

antithing commented 7 years ago

Hi and thank you for this code. I need to run cpd on two point sets that are at different scales. How do i return the scale difference? I am just running:

     `cpd::Matrix fixed = A;
    cpd::Matrix moving = B;
    cpd::RigidResult result;
    result.scale = true;
    result = cpd::rigid(fixed, moving);

`

But the scale always returns as 1. What am i missing?

Thank you again!

gadomski commented 7 years ago

You'll need to use the cpd::Rigid class and the Rigid::scale setter, e.g.:

cpd::Rigid rigid;
rigid.scale(true);
cpd::RigidResult result = rigid.run(fixed, moving);

I've added a test in e48ccb913a6cba32b183dd40b2f687d1e545cb3a to confirm that things are working as expected, so I'm closing this issue. Please re-open if you find another problem.

Thanks!