Comments (11)
I think the following changes should be correct? Executing accumulate function before break.
accumulate(moments_private[search_id], gamma[search_id - j0], points.row(i)); if (complexity(std::get<2>(nodes[search_id])) <= lambda_c) break;
from probreg.
Hi @SpriteLin-ZJU ,
Thanks you for the report!
You're right, the implementation is wrong.
I think the following implementation is correct.
for (Integer i = 0; i < points.rows(); ++i) {
Integer search_id = -1;
Vector gamma = Vector::Zero(N_NODE);
Integer j0 = 0;
for (Integer l = 0; l < max_tree_level; ++l) {
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[search_id], gamma[search_id - j0], points.row(i));
}
I also confirmed that it works.
from probreg.
@neka-nat Thanks for reply.
I think it workd now.
But I am still puzzled by the registration E step in the paper. Why does the algorithm only calculate the moments of the leaf node, but not the moments of the parent node?
from probreg.
My guess is that updating just the leaf node or the whole thing would make little difference to the results.
Since the parent's node information is the sum of the children node information, it would be no different than using only the child's information.
from probreg.
@neka-nat
I think you are right.
I still have a few questions about the code implementation:
-
In the buildGmmTree(const MatrixX3& points):
auto idxs = (n_total * Vector::Random(n_total)).array().abs().cast();
Maybe you mean
auto idxs = (points.rows() * Vector::Random(n_total)).array().abs().cast(); -
For a large point cloud (200k), calculating the sig2 is too time-consuming.
-
Also in buildGmmTree:
The variable q will increase as the number of points in the point cloud increases, and may eventually increase to several orders of magnitude more than lambda_s. As a result, the convergence speed is slow or even unable to converge when building trees. It may be more effective to choose a variable that can dynamically change with the number of points instead of a fixed value.
from probreg.
Thank you for reporting.
I've fixed each bug and pushed to master.
- n_total -> points.rows()
- I removed the points.rows() loop and initialize the covariance matrix in the n_total loop.
- I added lamda_s parameter.
from probreg.
Please check if the second modification is correct, it gives the wrong result in my test data.
Here is my test data.
waymo.pcd.zip
from probreg.
I used the following code to initialize the covariance matrix. But it seems that the randomness of the results has become greater, and sometimes the registration fails. I don't know what caused this.
#pragma omp parallel for num_threads(THREAD_NUM)
for (Integer j = 0; j < n_total; ++j)
{
std::get<0>(nodes[j]) = 1.0 / N_NODE;
std::get<1>(nodes[j]) = points.row(idxs[j]);
MatrixX3 tmp = (points.rowwise() - points.row(idxs[j])).matrix();
std::get<2>(nodes[j]) = tmp.transpose() * tmp / points.rows();
}
from probreg.
The initialization has been improved to take the tree structure into account.
The results still depend on the initial values, but can be stabilized by adjusting parameters, tree_level and maxiter.
Please try the latest master.
from probreg.
Hi, @neka-nat ,
I haven't tested the effect of different initialization methods on the registration effect, but I think the following modifications should be made in the nodes initialization function.
1.for (Integer j = 0; j < max_tree_level * N_NODE; ++j)
------->
for (Integer j = 0; j < std::pow(N_NODE, max_tree_level); ++j)
2.for (Integer j = 0; j < N_NODE * (l + 1); ++j)
------->
for (Integer j = 0; j < std::pow(N_NODE, l+1); ++j)
from probreg.
Thanks for the correction.
I've pushed the fix to master.
The results have been more stable for the stanford bunny.
from probreg.
Related Issues (20)
- Performance metric HOT 3
- ImportError: cannot import name '_math' HOT 1
- Contrained nonrigid CPD not moving points coherently
- Question about initialization of nonrigid transformation
- calculate the deformation field of point cloud and apply it to the 3D CT image
- bcpd_nonrigid.py does not consider local shapes.
- rigid 2d point set alignment doesn't converge well enough
- performance improvements for CPD HOT 1
- One important parameter is missing HOT 1
- scaling issue with registration_bcpd
- GMM-Tree Code. HOT 1
- [BUG] Error encountered using registration_cpd when using cuda HOT 2
- ImportError: cannot import name '_math' from partially initialized module 'probreg' (most likely due to a circular import) (/home/optics/file/shp/probreg-master/probreg/__init__.py) HOT 3
- bcpd_nonrigid.py
- 3D CPD registration example issue
- Non-rigid CPD/BCPD fails to scale points properly
- Implementation of LSG-CPD
- Impelemtation of Generalized CPD
- error when import probreg after pip installtion on ubuntu 20.04 + python3.6 HOT 1
- cpd.NonRigidCPD issue with swapping source and target
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from probreg.