cdcseacave / openMVS

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

Texture "pass through" to occluded faces when texture mapping #903

Open Woolseyyy opened 2 years ago

Woolseyyy commented 2 years ago

Describe the bug It seems that the texture color pass through the front faces and map to both the front faces and the occluded faces when texture mapping. For example: image

cdcseacave commented 2 years ago

The occlusion is normally taken into account; pls share debug data (scene and images)

Woolseyyy commented 2 years ago

The occlusion is normally taken into account; pls share debug data (scene and images)

https://www.dropbox.com/s/bsd8jgm17r01dys/hotdog_my.7z?dl=0

Woolseyyy commented 2 years ago

I have another problem... My purpose is to map recovered diffuse albedo and roughness map to a given mesh. However, a new obj would be produced at TextureMesh. What' s worse, I find that if I run TextureMesh with the same command and different images twice, the uv of the produced mesh is different. Hence, my roughness map and diffuse albedo cannot be shared with the same mesh...

Woolseyyy commented 2 years ago

The occlusion is normally taken into account; pls share debug data (scene and images)

I think I find the reason. It seems there are tinny bias of my mesh or camera poses so when I map texture, a little texture near the boundary of the mesh would pass through. At the same time, I set --global-seam-leveling and --local-seam-leveling as 1 so the middle area would be blended. Hence, a big area is "passed through".

cdcseacave commented 2 years ago

nor sure what you mean by pass through, I did run texturing on my machine and all looks good; how do you know it is wrong?

alb

pls use latest develop branch, and the command line u use should simply be:

InterfaceCOLMAP .
TextureMesh scene.mvs --mesh-file scene_mesh.ply

where scene_mesh.ply is the known mesh

As for different uv mapping, I think that is caused by multi thrreading, pls try using only one thread --max-threads 1

Woolseyyy commented 2 years ago

nor sure what you mean by pass through, I did run texturing on my machine and all looks good; how do you know it is wrong?

alb alb

pls use latest develop branch, and the command line u use should simply be:

InterfaceCOLMAP .
TextureMesh scene.mvs --mesh-file scene_mesh.ply

where scene_mesh.ply is the known mesh

As for different uv mapping, I think that is caused by multi thrreading, pls try using only one thread --max-threads 1

Can you have a check with "roughness" folder? I meet the problem mainly with the roughness data. Thank you about the answer about uv mappling! I will have a try.

cdcseacave commented 2 years ago

the algorithm is the same regardless of what the images contain

Woolseyyy commented 2 years ago

--max-threads 1

ok... In my results, it still remains some "pass through" at the bottom of bread:

image

Woolseyyy commented 2 years ago

nor sure what you mean by pass through, I did run texturing on my machine and all looks good; how do you know it is wrong?

alb alb

pls use latest develop branch, and the command line u use should simply be:

InterfaceCOLMAP .
TextureMesh scene.mvs --mesh-file scene_mesh.ply

where scene_mesh.ply is the known mesh

As for different uv mapping, I think that is caused by multi thrreading, pls try using only one thread --max-threads 1

I tried --max-threads 1 in InterfaceCOLMAP , ReconstructMesh , and TextureMesh, but the uv issue still remains.

cdcseacave commented 2 years ago

again, how do u know is not seen by an image, for ex this one image

cdcseacave commented 2 years ago

u do not need ReconstructMesh

Woolseyyy commented 2 years ago

InterfaceCOLMAP

I use

InterfaceCOLMAP .  --max-threads 1
TextureMesh scene.mvs --mesh-file scene_mesh.ply  --max-threads 1

with the latest realse version https://github.com/cdcseacave/openMVS/releases/tag/v2.0.1 but still the uv issue remains.

Woolseyyy commented 2 years ago

InterfaceCOLMAP

I use

InterfaceCOLMAP .  --max-threads 1
TextureMesh scene.mvs --mesh-file scene_mesh.ply  --max-threads 1

with the latest realse version https://github.com/cdcseacave/openMVS/releases/tag/v2.0.1 but still the uv issue remains.

I will have a try with https://github.com/cdcseacave/openMVS/pull/892

Woolseyyy commented 2 years ago

u do not need ReconstructMesh

I try with the latest code in 'develop' branch, and use

InterfaceCOLMAP .  --max-threads 1
TextureMesh scene.mvs --mesh-file scene_mesh.ply  --max-threads 1

but the uv issue still remains... The data and results are https://www.dropbox.com/s/zf0xhniveqbdsu3/hotdog_my.7z?dl=0

Woolseyyy commented 2 years ago

About the "pass through", I think there still exsit some problems. Have a look at this case: image

I think the clues are clear in this input image: diffuse_albedo-089

However, the recovered results look like that the apple is projected to the plane.

The data and results are in https://www.dropbox.com/s/6hgapbjtfddmfjy/fruit.7z?dl=0

cdcseacave commented 2 years ago

I agree, something is not right here; do you have time to look into what images are projecting there bellow the objects? you have to check ListCameraFaces() where a list of images seeing each triangle is made; check some of the triangles that have wrong texture by which images are seen

cdcseacave commented 2 years ago

I found the problem in this case: the mesh has some triangles too big; I remeshed it and the result is ok image scene_mesh.zip

Woolseyyy commented 2 years ago

I found the problem in this case: the mesh has some triangles too big; I remeshed it and the result is ok image scene_mesh.zip

I see. Thank you very much!