Giter Club home page Giter Club logo

neka-nat / probreg Goto Github PK

View Code? Open in Web Editor NEW
789.0 21.0 143.0 48.88 MB

Python package for point cloud registration using probabilistic model (Coherent Point Drift, GMMReg, SVR, GMMTree, FilterReg, Bayesian CPD)

License: MIT License

C++ 25.36% Python 74.54% Makefile 0.11%
point-cloud point-cloud-registration coherent-point-drift gaussian-mixture-models filterreg 3d expectation-maximization-algorithm open3d rigid-transformations non-rigid-registration

probreg's Introduction

logo

Build status PyPI version MIT License Documentation Status Downloads

Probreg is a library that implements point cloud registration algorithms with probablistic model.

The point set registration algorithms using stochastic model are more robust than ICP(Iterative Closest Point). This package implements several algorithms using stochastic models and provides a simple interface with Open3D.

Core features

  • Open3D interface
  • Rigid and non-rigid transformation

Algorithms

Transformations

type CPD SVR, GMMReg GMMTree FilterReg BCPD (experimental)
Rigid Scale + 6D pose 6D pose 6D pose 6D pose
(Point-to-point,
Point-to-plane,
FPFH-based)
-
NonRigid Affine, MCT TPS - Deformable Kinematic
(experimental)
Combined model
(Rigid + Scale + NonRigid-term)

CUDA support

You need to install cupy.

pip install cupy

Installation

You can install probreg using pip.

pip install probreg

Or install probreg from source.

git clone https://github.com/neka-nat/probreg.git --recursive
cd probreg
pip install -e .

Getting Started

This is a sample code that reads a PCD file and calls CPD registration. You can easily execute registrations from Open3D point cloud object and draw the results.

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

# load source and target point cloud
source = o3.io.read_point_cloud('bunny.pcd')
source.remove_non_finite_points()
target = copy.deepcopy(source)
# transform target point cloud
th = np.deg2rad(30.0)
target.transform(np.array([[np.cos(th), -np.sin(th), 0.0, 0.0],
                           [np.sin(th), np.cos(th), 0.0, 0.0],
                           [0.0, 0.0, 1.0, 0.0],
                           [0.0, 0.0, 0.0, 1.0]]))
source = source.voxel_down_sample(voxel_size=0.005)
target = target.voxel_down_sample(voxel_size=0.005)

# compute cpd registration
tf_param, _, _ = cpd.registration_cpd(source, target)
result = copy.deepcopy(source)
result.points = tf_param.transform(result.points)

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

Resources

Results

Compare algorithms

CPD SVR GMMTree FilterReg

Noise test

ICP(Open3D) CPD FilterReg

Non rigid registration

CPD SVR Filterreg BCPD

Feature based registration

FPFH FilterReg

Time measurement

Execute an example script for measuring time.

OMP_NUM_THREADS=1 python time_measurement.py

# Results [s]
# ICP(Open3D):  0.0014092829951550812
# CPD:  0.038112225010991096
# SVR:  0.036476270004641265
# GMMTree:  0.10535842599347234
# FilterReg:  0.005098833993542939

Citing

@software{probreg,
    author = {{Kenta-Tanaka et al.}},
    title = {probreg},
    url = {https://probreg.readthedocs.io/en/latest/},
    version = {0.1.6},
    date = {2019-9-29},
}

probreg's People

Contributors

jwindhager avatar kernela avatar neka-nat avatar oscarpellicer avatar pramukta avatar rgabdullin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

probreg's Issues

Initial estimation of sigma2 fails for FilterReg

I am experimenting with probreg for LiDAR scan registration. The scans are from successive UAV measurements and are pre-registered quite well at the start. Using CPD I get an expected result, however using the FilterReg registration the transformation converges to a wrong minimum. For the visualization I use the same callback for both methods in the Open3D viewer (python). It applies the transform that is passed into the callback to the source pointcloud and displays transformed source (green) and target (blue). I use the master branch of both Open3D and probreg. I attached an ascii PLY model of the two point sets. Thank you for any advice!

cpd

filterreg

frames.zip

SVD did not converge!

I'm getting the error "LinAlgError: SVD did not converge". Is it because I'm using source and target point clouds containing different number of points?

Edit:
I was using the registration_cpd function directly without passing the point cloud through the prepare dataset function present in the utils which was causing the error).

Performance degrades with parallel openmp threads

While searching for the cause of #46 I set OMP_NUM_THREADS=1 to exclude any threading issues. Interestingly, the performance increased by about a factor of 6 on this 8-core Intel machine when compared to OMP_NUM_THREADS=8.

CUDA error

Help, I'm getting this error every time I run the cpd_nonrigid3d_cuda.py
1

thanks in advance!

"cannot import name '_math'" problem

thanks for what you have done,but during the test, i got the problem "cannot import name '_math'",,i have no idea how to solve this,thanks for your help!

MemoryError: std::bad_alloc

Tried out probreg.

python 3.7
Open3D 0.9

  File "/home/oliver/sync/probreg/probreg/cpd.py", line 235, in registration_cpd
    w, maxiter, tol)
  File "/home/oliver/sync/probreg/probreg/cpd.py", line 76, in registration
    res = self._initialize(target)
  File "/home/oliver/sync/probreg/probreg/cpd.py", line 98, in _initialize
    sigma2 = mu.squared_kernel_sum(self._source, target)
  File "/home/oliver/sync/probreg/probreg/math_utils.py", line 21, in squared_kernel_sum
    return _math.squared_kernel(x, y).sum() / (x.shape[0] * x.shape[1] * y.shape[0])
MemoryError: std::bad_alloc
(base) ➜  featuremaps-stereo g

problem with install / open3d 0.8.0

I'm trying to install probreg under my env ...
I tried the git method but the setup.py script is looking for the 0.7.0 open3d package..
the pip version install open3d 0.7.0 (I have already the 0.8.0 version and installed..
Then what is the best way to install probreg ?
I think it is really what is missing to Open3d which has no robust icp method.. then thank you for your work !

Question about the Permutohedral Lattice Filter used for FilterReg

Hi,

I noticed FilterReg has a step relying on an edge-aware filter for point-clouds in the expectation step in FilterReg. However, I could not find the source-code for it. I believe the c++ code has only a reference for it. I would like to know if this is the case. If it is, if you could point to it or make available this part.

Thank you,

_maximization_step in DeformableKinematicFilterReg

Hi @neka-nat

If I may, I just wanted to quickly ask about the maximization_step function in the DeformableKinematicFilterReg class. As I see, you are, within each maximization step, itself performing multiple iterations, where in each one you average the neighboring dual quaternions. Can you perhaps give me a reference or something where this type of optimization is described? I am currently trying to implement something resempling DynamicFusion, however I have nowhere found actual code of the optimization itself, so I was wondering :)

Cheers!

BCPD registration

Hi @neka-nat,

I am trying to register two 3d body models using bcpd algorithm, but I keep getting "SVD did not converge" error. Any ideas what I might be doing wrong?

Any help would be appreciated

Update of sigma2 fails for FilterReg

As stated in #36, the initial estimation for the sigma2 parameter fails with the point clouds posted there. Additionally, updating the sigma during the inference fails. If is set sigma2=1.0 the algorithm converges, however if I additionally set update_sigma2=True it fails to converge altogether and performs large transformation updates (mostly rotation) in each step, as seen in the image below.

filterreg-updatesigma

Question about gmmTreeRegEstep function in HGMM Reg

for (Integer i = 0; i < points.rows(); ++i) { Integer search_id = -1; Vector gamma = Vector::Zero(N_NODE); for (Integer l = 0; l < max_tree_level; ++l) { const Integer j0 = child(search_id); for (Integer j = j0; j < j0 + N_NODE; ++j) { gamma[j - j0] = std::get<0>(nodes[j]) * gaussianPdf(points.row(i), std::get<1>(nodes[j]), std::get<2>(nodes[j])); } const Float den = gamma.sum(); if (den > eps) { gamma /= den; } else { gamma.fill(0.0); } gamma.maxCoeff(&search_id); search_id += j0; if (complexity(std::get<2>(nodes[search_id])) <= lambda_c) break; accumulate(moments_private[search_id], gamma[search_id - j0], points.row(i)); } }

Hi. According to the paper, the accumulate function should be outside the for loop, but ProReg is written inside the loop. Was it a mistake in the thesis or a wrong implementation?

twist parametrization terminology / strange results when using pt2pl in filterreg

Hi @neka-nat

I have a confusion in your filterreg code when using the pt2pl mode I was hoping you could help me out with. In the function 'twist_trans' from se3_op.py, you write that it converts from twist representation to transformation matrix. According to various sources I found, this is typically done using e.g. rodrigues formula for the rotation matrix and a similar formula for the translation part as shown e.g. here. Now, while you use rodrigues formula for the rotation part, you simply return tw[3:] as the translation part.

On the other hand, looking at the system of equations you set up in point_to_plane.cc, it seems to me that you're following the technique described in here, in which case, however, the rotation matrix should be obtained from the alpha/beta/gamma using eq.5 in that document, and the representation is not actually a twist representation but instead euler angles?

Bottom line, I can't reconcile my understanding of parametrizing transformations with your code in the above 2 mentioned functions, and I'm asking because I sometimes get very strange results when using pt2pl mode in filterreg. Now, if I'm wrote with what I wrong above, could you please give me some pointers where I can additionally read up on this? I would really appreciate this a lot :)

Kind regards and thanks again for the great work!

issue with building from source

Hi

Thanks again for the awesome project. So far I installed it using pip, however, as I would like to do some modifications, I am now trying to build from source, but when I run pip instell -e . inside the probreg folder, I get the following errors:

` ERROR: Command errored out with exit status 1:
command: /home/matija/bin/anaconda3/envs/test/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/matija/code/python/phd/probreg/setup.py'"'"'; file='"'"'/home/matija/code/python/phd/probreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps
cwd: /home/matija/code/python/phd/probreg/
Complete output (60 lines):
Continuing your build using OpenMP...

Found Eigen version 3.3.7 in: /usr/include/eigen3
Found Eigen version 3.3.7 in: /usr/include/eigen3
Found Eigen version 3.3.7 in: /usr/include/eigen3
Found Eigen version 3.3.7 in: /usr/include/eigen3
Found Eigen version 3.3.7 in: /usr/include/eigen3
Found Eigen version 3.3.7 in: /usr/include/eigen3
running develop
running egg_info
writing probreg.egg-info/PKG-INFO
writing dependency_links to probreg.egg-info/dependency_links.txt
writing requirements to probreg.egg-info/requires.txt
writing top-level names to probreg.egg-info/top_level.txt
reading manifest file 'probreg.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'probreg.egg-info/SOURCES.txt'
running build_ext
gcc -pthread -B /home/matija/bin/anaconda3/envs/test/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/matija/bin/anaconda3/envs/test/include/python3.7m -c /tmp/tmp8tc3k6t6.cpp -o tmp/tmp8tc3k6t6.o -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/matija/bin/anaconda3/envs/test/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/matija/bin/anaconda3/envs/test/include/python3.7m -c /tmp/tmpcte6vckl.cpp -o tmp/tmpcte6vckl.o -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
building 'probreg._ifgt' extension
gcc -pthread -B /home/matija/bin/anaconda3/envs/test/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/matija/bin/anaconda3/envs/test/lib/python3.7/site-packages/pybind11/include -I/home/matija/bin/anaconda3/envs/test/lib/python3.7/site-packages/pybind11/include -I/usr/include/eigen3 -I/home/matija/bin/anaconda3/envs/test/include/python3.7m -c probreg/cc/ifgt_py.cc -o build/temp.linux-x86_64-3.7/probreg/cc/ifgt_py.o -DVERSION_INFO="0.1.9" -std=c++14 -fopenmp -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/matija/bin/anaconda3/envs/test/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/matija/bin/anaconda3/envs/test/lib/python3.7/site-packages/pybind11/include -I/home/matija/bin/anaconda3/envs/test/lib/python3.7/site-packages/pybind11/include -I/usr/include/eigen3 -I/home/matija/bin/anaconda3/envs/test/include/python3.7m -c probreg/cc/ifgt.cc -o build/temp.linux-x86_64-3.7/probreg/cc/ifgt.o -DVERSION_INFO="0.1.9" -std=c++14 -fopenmp -fvisibility=hidden
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
probreg/cc/ifgt.cc: In function ‘probreg::Vector {anonymous}::computeMonomials(probreg::Integer, const Vector&, probreg::Integer, probreg::Integer)’:
probreg/cc/ifgt.cc:70:30: error: ‘seqN’ is not a member of ‘Eigen’
   70 |             monomials(Eigen::seqN(t, n)) = d[i] * monomials(Eigen::seqN(heads[i], n));
      |                              ^~~~
probreg/cc/ifgt.cc:70:68: error: ‘seqN’ is not a member of ‘Eigen’
   70 |             monomials(Eigen::seqN(t, n)) = d[i] * monomials(Eigen::seqN(heads[i], n));
      |                                                                    ^~~~
probreg/cc/ifgt.cc: In function ‘probreg::Vector {anonymous}::computeConstantSeries(probreg::Integer, probreg::Integer, probreg::Integer)’:
probreg/cc/ifgt.cc:88:26: error: ‘seqN’ is not a member of ‘Eigen’
   88 |             cinds(Eigen::seqN(t, n)).array() =
      |                          ^~~~
probreg/cc/ifgt.cc:89:66: error: ‘seqN’ is not a member of ‘Eigen’
   89 |                 (rng.array() < heads[i + 1]).select(cinds(Eigen::seqN(heads[i], n)).array() + 1, 1);
      |                                                                  ^~~~
probreg/cc/ifgt.cc:90:30: error: ‘seqN’ is not a member of ‘Eigen’
   90 |             monomials(Eigen::seqN(t, n)) = 2.0 * monomials(Eigen::seqN(heads[i], n));
      |                              ^~~~
probreg/cc/ifgt.cc:90:67: error: ‘seqN’ is not a member of ‘Eigen’
   90 |             monomials(Eigen::seqN(t, n)) = 2.0 * monomials(Eigen::seqN(heads[i], n));
      |                                                                   ^~~~
probreg/cc/ifgt.cc:91:30: error: ‘seqN’ is not a member of ‘Eigen’
   91 |             monomials(Eigen::seqN(t, n)).array() /= cinds(Eigen::seqN(t, n)).array().cast<Float>();
      |                              ^~~~
probreg/cc/ifgt.cc:91:66: error: ‘seqN’ is not a member of ‘Eigen’
   91 |             monomials(Eigen::seqN(t, n)).array() /= cinds(Eigen::seqN(t, n)).array().cast<Float>();
      |                                                                  ^~~~
probreg/cc/ifgt.cc:91:96: error: expected primary-expression before ‘>’ token
   91 |             monomials(Eigen::seqN(t, n)).array() /= cinds(Eigen::seqN(t, n)).array().cast<Float>();
      |                                                                                                ^
probreg/cc/ifgt.cc:91:98: error: expected primary-expression before ‘)’ token
   91 |             monomials(Eigen::seqN(t, n)).array() /= cinds(Eigen::seqN(t, n)).array().cast<Float>();
      |                                                                                                  ^
error: command 'gcc' failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: /home/matija/bin/anaconda3/envs/test/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/matija/code/python/phd/probreg/setup.py'"'"'; file='"'"'/home/matija/code/python/phd/probreg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
`

Thing is, the Eigen actually does have the seqN in Eigen/src/Core/ArithmeticSequence.h, so I don't see why it can't be found. Or is it stupid to simply run pip install -e . in the folder in the first place? I'd be grateful for any suggestion. Chers!

Question on Variables

Hi,

I have read your documentation and I have a quick question on what these variables actually represents: n_p, p1, pt1, px, q, sigma2, and transformation.
Capture5

Can't compile over linux and mac

Hi,

I'm using linux with ubuntu 16.04.12 and mac with macOs Catalina 10.15.2,
and I get the error below when trying to compile:
'-Wstrict-prototypes' is valid for C/ObjC but not for C++
both from source and using pip.
Can you please help?

Thanks,
Tal

Question about the results

Hi,
This is not an issue I'm facing.. But I'm wondering what exactly are the printed results in filterreg_rigid.py file under the examples folder, especially what is the tf_param.t ?

Non-rigid cpd with bunny point clouds

Hi, I tried using the non-rigid CPD for the bunny point clouds in the example folder and used the following parameters:
lambda= 1.0e-9
maxiter= 100
tol= 0.000000000000001

But, there are 3 points not aligned as shown in the screenshot. How can I make those 3 points align properly?
zoomed in
zoomed out

FilterReg with pt2pl objective crashes

Hi, @neka-nat, thanks for the awesome job you've done.

I'm conducting some experiments with Scannet dataset and I'm facing an issue with 'pt2pl' objective:

File "/home/captaintrunky/workspace/projects/probreg/probreg/filterreg.py", line 81, in expectation_step
vin = np.r_[zeros_md, self._target_normals]
File "/home/captaintrunky/.local/lib/python3.7/site-packages/numpy/lib/index_tricks.py", line 406, in getitem
res = self.concatenate(tuple(objs), axis=axis)
File "<array_function internals>", line 6, in concatenate
ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the array at index 1 has 1 dimension(s)

I'm using 8f0fba6 revision. 'pt2pt' does not crash, but produces pretty inaccurate results. Do you have any idea what could I try to fix it?

GMMTree Registration

Here I am again

When I tried to use the registration_gmmtree, I've found this error:

Traceback (most recent call last):
  File "gmmreg.py", line 15, in <module>
    tf_param, _, _ = gmm.registration_gmmtree(source, target)
ValueError: not enough values to unpack (expected 3, got 2)

The code:

import copy
import numpy as np
import open3d as o3
from probreg import gmmtree as gmm

# load source and target point cloud
source = o3.read_point_cloud('0.pcd')
target = o3.read_point_cloud('1.pcd')

#Downsampling
source = o3.voxel_down_sample(source, voxel_size=0.05)
target = o3.voxel_down_sample(target, voxel_size=0.05)

# compute cpd registration
tf_param, _, _ = gmm.registration_gmmtree(source, target)
result = copy.deepcopy(source)
result.points = tf_param.transform(result.points)

# draw result
source.paint_uniform_color([1, 0, 0])
target.paint_uniform_color([0, 1, 0])
result.paint_uniform_color([0, 0, 1])
o3.draw_geometries([source, target, result])

Installation Error : AttributeError: 'NoneType' object has no attribute 'split'

Hello, thank you for making this great tool. I ran into a problem while installing the module. I tried using both methods but the result is the same. I also tried using a different PC but it also gave me the same error.
This is the error in question :

ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\TV-2-I\Desktop\3d-labeling-tool-Visualization\3d-labeling-tool-Visualization\Python Scripts\probreg\setup.py", line 108, in <module>
    use_omp = _check_for_openmp()
  File "C:\Users\TV-2-I\Desktop\3d-labeling-tool-Visualization\3d-labeling-tool-Visualization\Python Scripts\probreg\setup.py", line 22, in _check_for_openmp
    'CC', distutils.sysconfig.get_config_var('CC')).split()[0]
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------

ERROR: Command "python setup.py egg_info" failed with error code 1

pt2pl objective gets stuck sometimes

pt2pl is amazingly fast for me, however it does not terminate on some pairs of scans. I'm running the algorithm with sigma=0.1 and tol=0.001. I tried to vary the tolerance but the problem persists. I attached an example of the problematic frames as OBJ with normals. If another formats suits you better I can provide that. Thank you in advance.
pt2pl-no-converge.zip

update parameter sigma

Thanks for the code, it's great
I think that there is small bug in the code for filterreg in the following line

sigma2 = ((m0 * np.square(t_source).sum(axis=1) - 2.0 * (t_source * m1).sum(axis=1) + m2) / (m0 + c)).sum()

In equation (17) of the supplementary material there is a small mistake from the first line to the second one, m0 should multiply the whole numerator, I believe that it should be

sigma2 = (m0 *( np.square(t_source).sum(axis=1) - 2.0 * (t_source * m1).sum(axis=1) + m2) / (m0 + c)).sum()

And then

sigma2 /= (3*m0m0.sum())

I check the c++ implementation and it's as I'm suggesting

Let me know!!

Accuracy Measurement

Hi,

How do I calculate the root mean square error of the alignment?

Thanks in advance.

Rigid CPD

In rigid mode is there any way to disable resizing as a valid transformation? This means that only rotations and translations are allowed.

Does not recognize prepare_source_and_target_rigid_3d from util

Hi,

I was executing "gmmtree_rigid.py". I found the following error.

 source, target = utils.prepare_source_and_target_rigid_3d('/home/anindya/bunny.pcd', n_random=0)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 AttributeError: module 'utils' has no attribute 'prepare_source_and_target_rigid_3d'

could you suggest any solution?

regards,
Ani

How to disable update_scale when do rigid transformation

The package looks great. One problem I am facing is that I need to disable the update_scale when runs cpd.registration_cpd(...). However, it seems that scale is not contained in the current parameter list.

Any comment is appreciated.

Number of Iterations

Hi,

  1. How to view how many number of iterations have elapsed?
  2. Even though I have set the max iteration to 1000, the program still end the same amount of time taken for 50 max iterations. My guess is the program still end at 50 iteration. How can I prevent this from happening?

Thanks in advance.

supply w parameter to filterreg

Hi @neka-nat

Thank you so much for this great toolbox! As far as I can see right now, there is no clear way to supply the w parameter when using filterreg. Adding w=0 to the arguments of filterreg.registration_filterreg, and passing the w in frg.registration() should do the trick. or did I miss something?

KeyError: <class 'numpy.object_'> when using cupy

Hi
im getting the error
KeyError: <class 'numpy.object_'>

when using cuda like your example:
https://github.com/neka-nat/probreg/blob/master/examples/cpd_affine3d_cuda.py

it seems to be this part in the AffineCPD class:
def _transform(self, points):
return self.xp.dot(points, self.b.T) + self.t

for some reason self.xp if cupy in the first iteration of registration function in cpd.py, but in the second iteration it changes to numpy, making it crash with the error as the array is cupy.

Problem on Ubuntu 16.04

When I tried to install this repository on my ubuntu version (I can't update this now), I've faced a huge error traceback.

Collecting pybind11>=2.2 (from probreg===0.1.7)
  Using cached https://files.pythonhosted.org/packages/4b/4d/ae1c4d8e8b139afa9682054dd42df3b0e3b5c1731287933021b9fd7e9cc4/pybind11-2.4.3-py2.py3-none-any.whl
Collecting open3d-python (from probreg===0.1.7)
  Using cached https://files.pythonhosted.org/packages/3c/8c/45cc3d3096ab19238910212b723df46b845a3c69a86865d50a09e7a6f32e/open3d_python-0.7.0.0-cp37-cp37m-manylinux1_x86_64.whl
Collecting six (from probreg===0.1.7)
  Using cached https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Collecting transformations (from probreg===0.1.7)
  Using cached https://files.pythonhosted.org/packages/5c/2c/d8cdf93d6dd61e899500ad2798d5633eb4124eca42186aa92559323a1cd6/transformations-2019.4.22.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: 1: svnversion: not found
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^
    _configtest.o: na função `main':
    /tmp/easy_install-u_65z9fb/numpy-1.17.4/_configtest.c:6: referência indefinida para `exp'
    collect2: error: ld returned 1 exit status
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^
    _configtest.c:1:20: fatal error: Python.h: Arquivo ou diretório não encontrado
    compilation terminated.
    non-existing path in 'numpy/distutils': 'site.cfg'
    Searching for numpy>=1.11.3
    Reading https://pypi.python.org/simple/numpy/
    Best match: numpy 1.17.4
    Downloading https://files.pythonhosted.org/packages/ff/59/d3f6d46aa1fd220d020bdd61e76ca51f6548c6ad6d24ddb614f4037cf49d/numpy-1.17.4.zip#sha256=f58913e9227400f1395c7b800503ebfdb0772f1c33ff8cb4d6451c06cabdf316
    Processing numpy-1.17.4.zip
    Writing /tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.cfg
    Running numpy-1.17.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-jgw4vj7m/numpy-1.17.4/egg-dist-tmp-k3jg627z
    /bin/sh: 1: svnversion: not found
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^
    _configtest.o: na função `main':
    /tmp/easy_install-jgw4vj7m/numpy-1.17.4/_configtest.c:6: referência indefinida para `exp'
    collect2: error: ld returned 1 exit status
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^
    _configtest.c:1:20: fatal error: Python.h: Arquivo ou diretório não encontrado
    compilation terminated.
    Running from numpy source directory.
    /tmp/easy_install-u_65z9fb/numpy-1.17.4/setup.py:419: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    /tmp/pip-build-nrquw1a1/transformations/setup.py:90: UserWarning: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
      warnings.warn(str(e))
    /tmp/pip-build-nrquw1a1/transformations/setup.py:92: UserWarning: The _transformations C extension module was not built.
    Using a fallback module with limited functionality and performance.
      'The _transformations C extension module was not built.\n'
    Running from numpy source directory.
    /tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.py:419: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/setup.py", line 444, in <module>
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/setup.py", line 436, in setup_package
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/core.py", line 171, in setup
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
        self.run_command("egg_info")
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 142, in run
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 316, in build_extension_sources
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 369, in generate_sources
      File "numpy/core/setup.py", line 430, in generate_config_h
      File "numpy/core/setup.py", line 49, in check_types
        Extension('transformations._transformations',
      File "numpy/core/setup.py", line 288, in check_types
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-build-nrquw1a1/transformations/setup.py", line 88, in <module>
        setup(ext_modules=ext_modules, **setup_args)
      File "/usr/lib/python3.7/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 663, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 873, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1101, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1087, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 246, in run_setup
        raise
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/setup.py", line 444, in <module>
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/setup.py", line 436, in setup_package
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/core.py", line 171, in setup
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
        self.run_command("egg_info")
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 142, in run
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 316, in build_extension_sources
      File "/tmp/easy_install-u_65z9fb/numpy-1.17.4/numpy/distutils/command/build_src.py", line 369, in generate_sources
      File "numpy/core/setup.py", line 430, in generate_config_h
      File "numpy/core/setup.py", line 49, in check_types
        Extension('transformations._transformations',
      File "numpy/core/setup.py", line 288, in check_types
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.py", line 444, in <module>
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.py", line 436, in setup_package
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/core.py", line 171, in setup
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
        self.run_command("egg_info")
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 142, in run
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 316, in build_extension_sources
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 369, in generate_sources
      File "numpy/core/setup.py", line 430, in generate_config_h
      File "numpy/core/setup.py", line 49, in check_types
        Extension('transformations._transformations',
      File "numpy/core/setup.py", line 288, in check_types
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-nrquw1a1/transformations/setup.py", line 94, in <module>
        setup(**setup_args)
      File "/usr/lib/python3.7/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 663, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 873, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1101, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1087, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 246, in run_setup
        raise
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.py", line 444, in <module>
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/setup.py", line 436, in setup_package
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/core.py", line 171, in setup
      File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 152, in run
        self.run_command("egg_info")
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/egg_info.py", line 26, in run
      File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 142, in run
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 159, in build_sources
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 316, in build_extension_sources
      File "/tmp/easy_install-jgw4vj7m/numpy-1.17.4/numpy/distutils/command/build_src.py", line 369, in generate_sources
      File "numpy/core/setup.py", line 430, in generate_config_h
      File "numpy/core/setup.py", line 49, in check_types
        Extension('transformations._transformations',
      File "numpy/core/setup.py", line 288, in check_types
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    non-existing path in 'numpy/distutils': 'site.cfg'

Someone know how can I fix this?

Test the algorithm in SLAM field

Hi @neka-nat , thanks for sharing such nice work!

Have you tried any test of using your method with point clouds in the LiDAR SLAM field? e.g. compared your algorithm with ICP, NDT. LOAM in the robotics field.

Best,
Weisong,

The result of m0 m1,m2 return from permutohedral.h

c = w / (1.0 - w) * n / m

I'm a little confused about the result of m0 m1,m2 return from "permutohedral.h " in the source code.
Like,
m0 = ph.filter(vin0, m).flatten()[:m]
m1 = ph.filter(vin1, m)[:m]
Has the normalization factor of the normal distribution included in m0 and m1?
If no , c should multiply (2sigma2np.pi)**(D/2).
I try to find the result in the source code ,but failed. Can you help me ,thanks.

How to set the distance threshold in registration

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).

L2-gmmreg goes wrong when translation exists

Hi! I have tested the l2-gmmreg code and I found that it performs weird if translation exits. Detailly, for a fixed rotation R, if the translation is set to 0, then all is fine. However, if the translation is not 0 then the estimated R would be far from the ground truth.

CPD doesn't modify point cloud

I'm trying to align two 3D point clouds where I have the correspondences using non-rigid CPD. The optimizer shows that the loss is decreasing, but no deformation actually occurs. Both point clouds stay in the same place that they were initialized to. To test, I centered and aligned the point clouds and just modified the scale of one, then ran the CPD, but I still encountered the same issue. Is there anything I need to modify for one point cloud to deform to the other based on the correspondences?

This is my code:

`
import copy
import numpy as np
import open3d as o3d
from probreg import cpd, l2dist_regs, bcpd
import sys
import pdb
import logging

log = logging.getLogger('probreg')
log.setLevel(logging.DEBUG)

# Load the data

pcd1_filename = "pcd1_centered.pcd"
pcd2_filename = "pcd2_aligned.pcd"

pcd1 = o3d.io.read_point_cloud(pcd1_filename)
pcd2 = o3d.io.read_point_cloud(pcd2_filename)

pcd2_points = np.asarray(pcd2.points)
pcd2.points = o3d.utility.Vector3dVector(pcd2_points * 0.5)


# compute cpd registration
transform_type = 'nonrigid'
tf_param, _, _ = cpd.registration_cpd(pcd2, pcd1, tf_type_name=transform_type)
result = copy.deepcopy(pcd2)
result.points = tf_param.transform(result.points)

# draw result
pcd1.paint_uniform_color([1, 0, 0])
pcd2.paint_uniform_color(0, 1, 0])
result.paint_uniform_color([0, 0, 1])
o3d.visualization.draw_geometries([pcd1, result])

`

And this is the result that I get out from the scale test. This is exactly how I initialized the clouds; red is initial position of pcd1, green is initial position of pcd2, and blue is the result. The blue and green are overlapping:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.