surface_match icon indicating copy to clipboard operation
surface_match copied to clipboard

The results are different every time. A memory leak?

Open mwwzbinf opened this issue 1 year ago • 14 comments

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?

mwwzbinf avatar Mar 05 '24 12:03 mwwzbinf

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.

SurfaceMan avatar Mar 05 '24 14:03 SurfaceMan

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?

mwwzbinf avatar Mar 07 '24 00:03 mwwzbinf

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

SurfaceMan avatar Mar 07 '24 12:03 SurfaceMan

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

mwwzbinf avatar Mar 08 '24 14:03 mwwzbinf

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?

SurfaceMan avatar Mar 08 '24 14:03 SurfaceMan

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

mwwzbinf avatar Mar 08 '24 15:03 mwwzbinf

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.

SurfaceMan avatar Mar 08 '24 15:03 SurfaceMan

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

mwwzbinf avatar Mar 10 '24 00:03 mwwzbinf

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

SurfaceMan avatar Mar 10 '24 14:03 SurfaceMan

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

mwwzbinf avatar Mar 12 '24 13:03 mwwzbinf

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

SurfaceMan avatar Mar 12 '24 14:03 SurfaceMan

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

mwwzbinf avatar Mar 12 '24 14:03 mwwzbinf

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

please see first of TODO list

SurfaceMan avatar Mar 12 '24 14:03 SurfaceMan

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

XiaXingLuo avatar Jun 19 '24 02:06 XiaXingLuo