nonrigid_icp icon indicating copy to clipboard operation
nonrigid_icp copied to clipboard

Cholmod error: matrix not positive definite

Open Ritchizh opened this issue 4 years ago • 7 comments

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?

Ritchizh avatar Jun 18 '20 15:06 Ritchizh

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

saikiran321 avatar Jun 19 '20 10:06 saikiran321

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.

Ritchizh avatar Jun 19 '20 16:06 Ritchizh

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

saikiran321 avatar Jun 20 '20 11:06 saikiran321

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.

Ritchizh avatar Jun 23 '20 09:06 Ritchizh

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?

akkoumis avatar Jul 19 '21 11:07 akkoumis

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.

saikiran321 avatar Jul 19 '21 17:07 saikiran321

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.

xuexiaoxiaohu avatar Oct 27 '22 09:10 xuexiaoxiaohu