cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.38k stars 911 forks source link

A slight improvement in SceneTexture #693

Open WinterCodeForEverything opened 3 years ago

WinterCodeForEverything commented 3 years ago

I experiment Texture a lot using OpenMVS, the result is pretty good except a small problem,when the mesh is dense and doesn't have enough images( or views ), there are a lot of small diffused triangles without texture (or textured with empty color). I read the code carefully and think the problem may be in the FaceViewSelection( in SceneTexture.cpp), after choosing the label for each triangle using LBP algorithm, maybe we could check if triangles arond one triangle have the same label and this triangle has different label or ilegal label, and change the triangle's label makes them same, maybe it can solve the above problem. is it right or is there any simpler way to solve the problem? please tell me and maybe we could improve it together.

cdcseacave commented 3 years ago

That is doable, but i think the real solution here is decimation: the mesh should be simplified a bit before, and all small triangles will be removed without affecting the accuracy. That will not only solve this issue , but will significantly speed up the entire process.

WinterCodeForEverything commented 3 years ago

Thanks for reply, Yeah, simplify mesh may ease the problem but can't solve it totally, and more important, beacuse of shadow and background light, color will be more incorrect in the global or local leveling as mesh is more simple. Because I get pointcloud from structurelight not SfM, the point is always more dense compared with the image resolution. And I don't know how to simplify mesh in order to balance the above side effect. here are same models in different point number(25w,11w,6w). the number is smaller, the hole is less but the color is more dark. 25w.zip 11w.zip 6w.zip

I try my idea but has bug, where's error: image image

cdcseacave commented 3 years ago

Simplifying the mesh should not result in texture problem. Use a good mesh simplification algorithm.

The code above has at least 2 problems:

  1. you should assign label only to faces that do not have one (label == NO_ID)
  2. the second FOREACH should be using indices in the vector, not the vector data, so that you check idx+1 the next adjacent face
WinterCodeForEverything commented 3 years ago

thanks alot ,I will check it.

CanCanZeng commented 2 years ago

Hi, did you fix this function finally? @WinterCodeForEverything

WinterCodeForEverything commented 2 years ago

Hi, did you fix this function finally? @WinterCodeForEverything

No, there are other bugs when fixing it

zxxsam commented 1 year ago

Is the problem finally solved? Can you give me some advice, thank you very much!

cdcseacave commented 1 year ago

pls decimate the mesh before texturing so that the triangles size increases a bit to match the images resolution