diff --git a/libs/MVS/SceneTexture.cpp b/libs/MVS/SceneTexture.cpp index ebb8f76..edf9757 100644 --- a/libs/MVS/SceneTexture.cpp +++ b/libs/MVS/SceneTexture.cpp @@ -16623,6 +16623,8 @@ bool MeshTexture::RasterizeVirtualFaces( // 计算重心坐标 float b0, b1, b2; bool inside = ComputeBarycentric(u, v_coord, uv[0], uv[1], uv[2], b0, b1, b2); + if (!inside) + continue; // // 统一用宽松容差判断 // const float EPS_BARY = 1e-2f; @@ -16733,7 +16735,7 @@ bool MeshTexture::RasterizeVirtualFaces( } // 再与 mainFloat 混合(低频占主导,主视图补充细节) - // cv::Mat finalPatch = filledLowFreq * 0.7f + mainFloat * 0.3f; + cv::Mat finalPatch = filledLowFreq * 0.7f + mainFloat * 0.3f; // cv::Mat finalPatch = filledLowFreq * 0.85f + highFreq * 0.15f; // 对高频做 soft clamp,防止个别极端值拉白发白 @@ -16741,7 +16743,7 @@ bool MeshTexture::RasterizeVirtualFaces( cv::max(highFreq, -0.2f, highFreqClamped); cv::min(highFreqClamped, 0.2f, highFreqClamped); - cv::Mat finalPatch = filledLowFreq * 0.8f + highFreqClamped * 0.2f; + // cv::Mat finalPatch = filledLowFreq * 0.8f + highFreqClamped * 0.2f; // cv::Mat finalPatch = mainFloat; // cv::Mat finalPatch = lowFreqPatch; @@ -16761,9 +16763,11 @@ bool MeshTexture::RasterizeVirtualFaces( for (int x = 0; x < patchW; ++x) { cv::Vec3b color = finalPatch8U.at(y, x); - float mx = mapX.at(y, x); - float my = mapY.at(y, x); - if (mx < 0 || my < 0) continue; // 真正的空洞才跳过 + // float mx = mapX.at(y, x); + // float my = mapY.at(y, x); + // if (mx < 0 || my < 0) continue; // 真正的空洞才跳过 + + if (color[0] == 0 && color[1] == 0 && color[2] == 0) continue; int atlasX = x + minX, atlasY = y + minY; if (atlasX<0||atlasX>=textureSize||atlasY<0||atlasY>=textureSize) continue;