I have a point cloud of a statue made by photogrammetry so 360 ° and a point cloud by structured light so only one face. The two points clouds don't have the same scale.
I tried the method used by the unit test "similarityTransform" but it find a scale near 0 to flatten the geomtry!
Do you have a solution to do that considering the different scale?
I can send the point coulds if needed!
I didn't play with the similarityTransform yet, but your problem seems general to all point cloud registrations. If your prior transformation is too far, you will converge to a local minima. In the case of a transformation with scale, an obvious one is the zero scale.
You can use a software like Paraview to pre-align your point cloud manually. I would suggest you to use the inspector VTKFileInspector at first to understand what happen during the minimization process.
You should use your own calibration file to customize your solution with that part in it:
There are tons of reasons why a point cloud registration could fail. The best advice I can give you is to learn how to debug your solution with the visual tools we implemented in the library.
Can we close this issue?
Thank you for your reply! Yes we can close it!
I have one more question related to that issue.
Can we avoid the algorithm to use one point more than once?! Because it find me a solution with a reprojection error near to 0.00000001, but with a scale near to 0.0000001. Every points in the second point cloud are scale to match on the same point in the first point cloud!
Can we avoid it?
Hello, I still have my problem!
I tried serveral starts with different angle (Every 22.5° in each direction so 729 starts) and i want to keep the best solution. But the best (with the lowest getMeanError), is wrong. The scale is so small, every point are match on only one point in the second point cloud.
Can we avoid this?
Or at least to bounded the scale between 2 values.
For exemple I have 2 points cloud nearly to the same scale but the higher scale it find me is 0.3
Is there some parameters I can configure to fix this?
You can send your point clouds as attachments and I will check what is going on.
From what I understand, there is no parameters for the PointToPointSimilarityErrorMinimizer implementation.
You can also play with the knn parameter for the matching step.
The parameter knn controls the number of points to be matched. This could reduce the probability of all point from the reading to match with a single point from the reference.
This is my point clouds :
I tried :
but it crash!
Should I translate the two point clouds to be closed? or it is already done in icp?
Ok, that's what I suspected. Your statue is 0.8 m high and your second scan is roughly 3 m away and flipped by 180 degrees. ICP in general is a local solution, not a global one. You need either a human, another sensor or another algorithm to roughly position your scans not too far away.
Prior too far away:
Better prior achieved by using Paraview to manually align the scans:
It's even more critical for a registration with scale as the other degree of freedom produce even more local minimas during the minimization. In the following animation you see that the head first move toward the shoulder before scaling properly. This is an indication that the registration almost converge to a local minima. The animation was done using VTKFileInspector in the yaml file.
The complet yaml file for this registration is:
This issue is more in a range of technical support than a problem with libpointmatcher. I did it completely only because I did tried myself the new PointToPointSimilarityErrorMinimizer module. In general, we don't have time to support application specific problems.
Thank you very much for your reply!
I applied icp, but first I translated one point cloud on the other and rotated in every direction(bruteforce) and I kept the best solution.
I will try with your yaml!