neka-nat / probreg

Python package for point cloud registration using probabilistic model (Coherent Point Drift, GMMReg, SVR, GMMTree, FilterReg, Bayesian CPD)
MIT License
854 stars 148 forks source link

How to set the distance threshold in registration #26

Closed LogWell closed 4 years ago

LogWell commented 4 years ago

I need to register a full-body mesh to the point cloud recovered from the depth map, if there is no distance threshold, the result is not so good (the point cloud will be in the middle of the human body).

neka-nat commented 4 years ago

Hi @LogWell ,

Thank you for reporting. Which method do you use? (CPD, GMMReg, SVR, GMMTree or Filterreg)

LogWell commented 4 years ago

ss left: probreg

tf_param, _, _ = cpd.registration_cpd(source, target, 'rigid', callbacks=cbs)

right: open3d, with threshold=0.02

data: please change .txt to .ply 0_0_00 (copy).txt bch0002hd2o01p01sresult2s (copy).txt

registration with scale is very useful

neka-nat commented 4 years ago

Thank you for the data. I noticed that this data are deformable objects, so I tried affine transformation registration. It's a little better, I think, isn't it?

import copy
import numpy as np
import open3d as o3
from probreg import cpd

source = o3.io.read_point_cloud('data1.ply')
target = o3.io.read_point_cloud('data2.ply')
source = source.voxel_down_sample(voxel_size=0.02)
target = target.voxel_down_sample(voxel_size=0.02)
result = copy.deepcopy(source)

tf_param, _, _ = cpd.registration_cpd(source, target, 'affine')
result.points = tf_param.transform(result.points)

target.paint_uniform_color([0, 1, 0])
result.paint_uniform_color([0, 0, 1])
o3.visualization.draw_geometries([target, result])

affine

LogWell commented 4 years ago

If a complete mesh is registered with an incomplete point cloud, a distance threshold is still needed (to eliminate some incorrect corresponding points), right?

For the mesh of human body, if we want to compare the results of different algorithms, we need to register first. Generally, we only need to rotate, scale and translate. The affine transformation will make the comparison unfair.

neka-nat commented 4 years ago

As you say, in ICP you can set a distance threshold on the distance between the source point and the nearest neighbor point of the target point, but in CPD it is difficult because it expresses the distance between points with probability. Take a look at the paper if you like. The paper also lists registration results with incomplete data (Fig.6), so isn't the distance threshold the only thing that matters?

If you want to make a fair comparison, it may be better to use rigid deformation data. Because when shown the above comparison, you can't categorically say that the right one is better. The result on the left is certainly a bit of a leaner body part, but it looks more like it is trying to align their left foot.

LogWell commented 4 years ago

I see. Thank you very much~