4
« on: August 05, 2025, 02:34:29 AM »
In the example Marcin has shown there is a boat hull photographed from both sides - outside and inside.
Depth maps from both sides show there is a surface, but the result of meshing has holes. It is probably because there is a small misalignment of the photographs taken inside, where is darker. The curvature of the inside is most likely a bit different than the curvature on the ouside, so depth maps on one side partially intersect with depth maps from the opposing side creating holes in the areas of intersection.
What we need to fix it is the algorithm prioritising creating a surface without holes. So in situation like this we have a group of depth maps from the outside that clearly show a surface and another group of depth maps facing roughly the opposite direction also showing a surface. For the algorithm this should be an indication there must be a surface there, not holes. So the way I see it work is:
1. The algorithm sees a group of depth maps facing roughly the same direction and together creating a surface.
2. It also sees a group of depth maps roughly facing the opposite direction also creating a surface together. (The opposite direction can be defined as a range of angels like 150 - 220 degrees, to make sure the fix is not used everywhere in the model, but only in the right areas of it)
3. It determines there must be a surface without holes if depth maps on both sides show a surface without holes.
4. It establishes which side is more important. I would say the one that has either more depth maps or depth maps with a higher level of confidence.
5. Then in detects the areas where depth maps from the prioritised side intersect with depth maps from the less important side.
6. In those areas only the depth maps from the prioritised side are taken into consideration for creating a surface and the parts of depth maps from less important side that intersect are ignored.
(7. Or better, not completely igronred, but later projected on top of the mesh created based on the prioritised side, to still add some small details similarily to "refine mesh". But they shoud not cancel out the depth maps from the opposite side.)
This way a continuous surface is always created based on more important side and still has plenty of details also on the other side, just maybe not in the areas where less important depth maps intersected with more important depth maps. But in the end it is better to have less details in some areas on one side than holes on both sides. Furthermore, if depth maps do not intersect anywhere, then a surface is created anyway with full details on both sides, because no part of less important side gets ignored.
This kind of algorithm modification could be manually activated only when needed, as an additional option in model generation called something like "fix holes in thin walls" or "prioritise surfaces over holes".