siavashk / pycpd

Pure Numpy Implementation of the Coherent Point Drift Algorithm
MIT License
513 stars 115 forks source link

How to fix scale factor and reduce initial displacement #31

Closed clausmichele closed 4 years ago

clausmichele commented 4 years ago

Hi, I am trying to align two small point clouds which do not have to be scaled. How do I set the initial scale closer to 1? Is it possible to fix the final scale to 1? Currently the rigid transform aligns correctly the point clouds. However, it takes too much time since it starts with a very small scale.

Regards, Michele

siavashk commented 4 years ago

Note the original CPD paper only proposes scale + rigid, affine and non-rigid registration methods. This repository is a python implementation of that paper, so these are methods that I am supporting.

With that being said, I have found that the algorithm becomes unstable if with a fixed scale value. This might be due to numerical instability during the SVD solve.

The default initial value for scale is exactly 1.0, see here. If the EM algorithm explores small scale factors during optimization, it is probably doing it because that is what the SVD solve found during the maximization step.

As far as I know the reason for this has to do with the distribution of the source and target point clouds. Maybe you can find the exact reason for this and contribute to point cloud research. :)