Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black spots on the texture image #961

Open
Sanheiii opened this issue Mar 22, 2023 · 6 comments
Open

Black spots on the texture image #961

Sanheiii opened this issue Mar 22, 2023 · 6 comments

Comments

@Sanheiii
Copy link
Contributor

Undistorted images sometimes have black pixels at the edges, but OpenMVS still uses these parts to generate the texture. After seam leveling as if they were smeared, a large black spot is formed on the texture image.
图片

@cdcseacave
Copy link
Owner

Indeed, this can happen. This would be quite easy to fix. Pls contribute if you have time.

@Sanheiii
Copy link
Contributor Author

I've made some attempts, without changing the MVS format, I think it's possible to give preference to views where the faces are projected closer to the center of the photo or to remove views based on color, but I don't think these are good solutions, they may reduce the quality of the textures and are not very accurate. I think I need to introduce distortion parameters for the MVS format. But you mentioned it's would be quite easy to fix, my programming and math skills are average, so I hope I can ask you for some ideas.

@PxGluz
Copy link
Contributor

PxGluz commented Mar 29, 2023

Hi! I'll give a shot to solving this issue. I'll try to create a mask that would match the image distortion so that TextureMesh would only use pixels from within the mask.

@Sanheiii
Copy link
Contributor Author

Thanks for the suggestion, I misunderstood mask and thought it would only be used in dense restruction, I will try it.

@Sanheiii
Copy link
Contributor Author

Sanheiii commented Apr 6, 2023

#967 would require users to create masks to utilize the fix. Creating masks from distortion parameters is not a terrible idea. Using threshold might clip some of the image without detection of image border.

I filled a white picture and undistorted it, using it as a mask into TextureMesh, there was no significant improvement to the problem, I made the black part of the mask inflate a few pixels later, the black spots were completely gone.

@cdcseacave
Copy link
Owner

PR #968 is automatically generating valid image masks by removing black regions around the undistorted image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants