MeshInspector / MeshLib

Mesh processing library
https://meshlib.io
Other
521 stars 59 forks source link

mesh denoising that can keep sharp features #1215

Open MarcoWang1 opened 1 year ago

MarcoWang1 commented 1 year ago

Do you have plans to write mesh denoising algorithms that can keep sharp features of flat regions and smooth regions. image see the flat regions and the hole in the above image

Fedr commented 1 year ago

It is a good idea to implement something like this. We will evaluation current approaches in this area, and implement one of them. Hope to show you something next week.

MarcoWang1 commented 1 year ago

sharpen flat regions is easy,but also sharpen holes is hard. for example sharpen edges is easy,sharpen holes are hard

Fedr commented 1 year ago

I see, thanks. Please send us test data, if you have some. It will help during development.

MarcoWang1 commented 1 year ago

noisy.zip

Fedr commented 1 year ago

It is going fine. Here are first results.

Your initial mesh: image

Our denoising with keeping of sharp features: image

Full denoised mesh: DenoisedTube.obj.zip

Fedr commented 1 year ago

We have implemented AT-method from the article: Mesh Denoising via a Novel Mumford-Shah Framework

In the code, it is located in MeshLib\source\MRMesh\MRNormalDenoising.h. The function is meshDenoiseViaNormals.

Above result was obtained with the parameters:

    beta = 0.001f;
    gamma = 10.f;
    normalIters = 20;
    pointIters = 20;
    guideWeight = 0.03f;

For this huge mesh, it takes several minutes to solve big linear systems. So I would recommend to decimate your mesh first.

Fedr commented 1 year ago

Thanks. It looks like your mesh does not have any noise, but only discretization artifacts near sharp features. Increasing the number of iterations or other parameters of the proposed method can help, but one hardly can expect 100% quality just by moving vertices (without topology changes: new vertices, other triangulation, etc.) Or there is some other software that can perform better on this input?

MarcoWang1 commented 1 year ago

Yes,do you know nTop software, when the implicit body convert to mesh, they have the option to keep sharp.I think maybe they just convert implicit to mesh,and then mesh denoising

Fedr commented 1 year ago

Thanks for the reference. We will try to evaluate that software, but since it is not freely downloadable, it is hard to promise anything.

For the description, it looks like they have precise implicit representation of the surface (e.g. implicit representation of ball is x*x+y*y+z*z=1), and may use of it to create the surface with sharp edges. I do not believe that they can import already corrupted mesh (as in your example), and can fix it without having precise implicit representation.

Still the mesh can be made much better. Again, on your example: image

Our denoising on maximal settings: image

MarcoWang1 commented 1 year ago

nTop not only have implicit function ,but also implicit body from mesh,it can both keep sharp