Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cholmod error: matrix not positive definite #1

Open
Ritchizh opened this issue Jun 18, 2020 · 7 comments
Open

Cholmod error: matrix not positive definite #1

Ritchizh opened this issue Jun 18, 2020 · 7 comments

Comments

@Ritchizh
Copy link

Ritchizh commented Jun 18, 2020

Hi!
When I am trying to run the code with my data: https://drive.google.com/drive/folders/1jr5uoy96BbjG_mH60BWAmdflqgdAPhXq?usp=sharing

I am getting the following error:
11 def choleskySolve(M, b):
---> 13 factor = cholesky_AAt(M.T)
14 return factor(M.T.dot(b)).toarray()
CholmodNotPositiveDefiniteError: ../Cholesky/t_cholmod_rowfac.c:430: not positive definite (code 1)

(With your test data it works fine. )
I assume some values in the decomposition are very close to zero, but negative.
Could you possibly tell what causes this error, how to fix it?

@saikiran321
Copy link
Owner

Hi, Yes this is due to the incorrect point correspondences. Please set the threshold manually according to your data in line 120, in nricp.py file.

This project is still in development phase, If you want to use a better way of obtaining nonrigid transformations please check https://pypi.org/project/pycpd/.

@Ritchizh
Copy link
Author

Thank you for answering!

Varying the distance threshold doesn't seem to work. My distance array parameters are the following: min = 7.8e-05, max = 0.046, mean = 0.0036; distance.shape = (9515, 1)
They vary a bit depending on the threshold. How should the threshold be chosen?

I will also check the library at your link.

@saikiran321
Copy link
Owner

Hey, not sure why, I will have to debug, Can you try solving using SVD or QR decomposition.

@Ritchizh
Copy link
Author

Can this error be connected to my data?
I generated the triangle meshes from point clouds with Open3d o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting method (normals estimated with estimate_normals(o3d.geometry.KDTreeSearchParamHybrid()) method).
Untitled

I'm not sure how to replace cholesky_AAt with SVD: it should take sparse matrix and return factor object.

@akkoumis
Copy link

I tried using the test data but still got the error. I am using Python 3.8 and Open3D 0.13.0. That might be the problem?

@saikiran321
Copy link
Owner

I haven't tested this with newer versions of open3d or python. It is working (example data) with Python 3.6 and Open3d 0.9.

@xuexiaoxiaohu
Copy link

xuexiaoxiaohu commented Oct 27, 2022

I also meet the probelm. i check the distance , the max of the distance is 1.04, min:0.0059,mean : 0.22, when i set mismatches = np.where(distances>1)[0](nricp.py 120 row), it works ok! hope to help you

Thank you for answering!

Varying the distance threshold doesn't seem to work. My distance array parameters are the following: min = 7.8e-05, max = 0.046, mean = 0.0036; distance.shape = (9515, 1) They vary a bit depending on the threshold. How should the threshold be chosen?

I will also check the library at your link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants