SurfaceMan / surface_match

fast and robust point pair feature
BSD 2-Clause "Simplified" License
38 stars 7 forks source link

The results are different every time. A memory leak? #11

Open mwwzbinf opened 7 months ago

mwwzbinf commented 7 months ago

image image image

I successfully compiled the program, but every time the result is different, or no result, or wrong result, or correct result, and accompanied by an error pop-up window, I do not know why? Is it a problem with openmp? I used my own model and scene, and the model is parasaurolophus_6700.ply in opencv, Can you help me?

SurfaceMan commented 7 months ago

1.1 I have no ideas about the error before. If you have any progress, please let me known. 1.2 Is OpenMP problem? You can try comment OpenMP pragma with //. 1.3 I gauss may std::vector(score & pose) construct(ppf.dll) and destroy(test_ppf.exe) at different place cause this error. 2.1 About result, sometimes got a strange pose before icp, there may need sometime to analyze it.

mwwzbinf commented 7 months ago

The memory leak is indeed due to the third point you mentioned, I am understanding your code, is there a blog that can understand it better?

SurfaceMan commented 7 months ago

The memory leak is indeed due to the third point you mentioned, I am understanding your code, is there a blog that can understand it better?

try reference this issue

mwwzbinf commented 7 months ago

sampleMesh has a significant effect on the results, Perhaps a fixed sampling method would be better

SurfaceMan commented 7 months ago

sampleMesh has a significant effect on the results, Perhaps a fixed sampling method would be better

You mean sample process lead to no result sometime?

mwwzbinf commented 7 months ago

yes, I use parasaurolophus_6700.ply and rs1_normals.ply, you can try image

SurfaceMan commented 7 months ago

I think the main reason is a bug of cluster method which cause this error. the cluster2 method only keep max votes result which maybe not the true result.

mwwzbinf commented 7 months ago

I have some questions 1.Why not use the green part instead of the red part? What is the purpose of the calculation in red part? image 2.Why add a pi and subtract a pi? I think we can just delete them. image image

SurfaceMan commented 7 months ago

1.1 I also not understand yet. The code based opencv surface_match. 1.2 I tested replace with "float alpha = atan2 (mpt (2), mpt (1));", it will lost many result.

  1. alpha angle range is(-pi, pi), the difference of model angle and scene angle is (-2pi, 2pi), we should normalize it to (0, 2pi) then map it to angle index (0, maxAngleIndex)
mwwzbinf commented 7 months ago

one question, the code in samplePointCloud, due to the use of openmp, two points that are very close together (less than the radius) are preserved, Whether there is such a chance? image

SurfaceMan commented 7 months ago

Yes, the multithread lead to random sample result. Because of the big difference between thread count and point count, it looks link uniform.

mwwzbinf commented 7 months ago

Thank you very much. One more question. Is there any article you can refer to about ICP?

SurfaceMan commented 7 months ago

Thank you very much. One more question. Is there any article you can refer to about ICP?

please see first of TODO list

XiaXingLuo commented 4 months ago

I think the main reason is a bug of cluster method which cause this error. the cluster2 method only keep max votes result which maybe not the true result.

How to deal with the problems about not converage?

after cluster has items: 2
sparsePoseRefinement not converge 2
sparsePoseRefinement not converge 2