CloudCompare / CloudCompare

CloudCompare main repository
Other
3.55k stars 1.03k forks source link

Adding possibility to free scale parameters during ICP registration #79

Closed luca-penasa closed 11 years ago

luca-penasa commented 11 years ago

How much is feasible to modify/add the code for being able to free also the scale parameter during ICP registration? This would be needed when dealing with photogrammetric models without scale vs lidar models. One could:

  1. initial registering with 3 points
  2. Standard ICP for fine registration
  3. Scale-free ICP for minor scale adjustment

I was looking at the registration code. And probably I would need to modify code in CClib. In particular everything needed should be in RegistrationTools.cpp, isn't? the class ICPRegistrationTools should contain everything needed for this.

I think I should declare a new type of PointProjectionTools::Transformation with scale, and then pass the scale also to RegistrationTools::RegistrationProcedure (line 300) - it seems like this method yet support scaling. I would also need to define/extend PointProjectionTools::applyTransformation for being able to support scaling.

Also SimpleCloud::applyTransformation would need to be extended with a scale parameter.

And... Also choosing the right center of scale is not trivial. Probably centering the scale operation on a point that yet shows great correspondence could be nice. But seems to be a pretty complex matter. Maybe also using center of mass could be good.

This should be all. Any idea?

If it is not more complex than that I could try :-)

EDIT: it seems like also RegistrationProcedure would need not trivial changes... ??

luca-penasa commented 11 years ago

this seems to be a good reference: http://www.yjschmidt.de/pdf/jschmidt_prip_2005.pdf

ghost commented 11 years ago

Indeed that would be a good option!

The 'ScaledTransformation' should already suits your need? The scale should be applied right after the rotation (as in 'sR+T', which seems to be quite the standard). Look at 'ccPointPairRegistrationDlg::align' to see how to use it (painlessly).

And indeed, a new version of 'applyTransformation' that takes a 'ScaledTransformation' as input could be added to both SimpleCloud and ChunkedPointCloud, as well as PointProjectionTools. I'm not even sure the old version should remain but we'll see that later.

luca-penasa commented 11 years ago

Nice.. I just see the ScaledTransformation yet exists :-) next days I'll try.. for now I have implemented the scale estimation method within RegistrationProcedure - in a RegistrationProcedureWithScale... not sure if it is right.. When I'll have something I'll push a branch so you can see and maybe give a check... Thank you!

luca-penasa commented 11 years ago

Just pushed a new branch SICP that contains a working (S)ICP implementation. Ok for me it seems to work, but maybe the implementation could be more clean... See if it is fine. The user can now chose if to release the scale parameter during ICP or not.

ghost commented 11 years ago

Great! I'll look at this (relatively) soon.

ghost commented 11 years ago

I've finally merged it! I've simplified the code by merging the 'Transformation' and 'ScaledTransformation' structures. This works well on my side.

luca-penasa commented 11 years ago

Thanks Daniel!