From c49c3df5ade55df45702005b97d09d1265545d2f Mon Sep 17 00:00:00 2001 From: hesuicong Date: Fri, 14 Aug 2026 14:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=89=B2=E5=B7=AE=E9=97=AE=E9=A2=98=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/MVS/SceneTexture.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/MVS/SceneTexture.cpp b/libs/MVS/SceneTexture.cpp index aedc304..2e11dd4 100644 --- a/libs/MVS/SceneTexture.cpp +++ b/libs/MVS/SceneTexture.cpp @@ -10406,9 +10406,17 @@ void MeshTexture::GlobalSeamLeveling3() if (a == Color::ZERO) continue; Pixel8U& v = image.at(r,c); + // 替换原来的 RGB2YCBCR → 加减 → YCBCR2RGB 那段 + const float maxAdjY = 25.0f; + const float maxAdjC = 12.0f; + Color clamped_a; + clamped_a[0] = CLAMP(a[0], -maxAdjY, maxAdjY); + clamped_a[1] = CLAMP(a[1], -maxAdjC, maxAdjC); + clamped_a[2] = CLAMP(a[2], -maxAdjC, maxAdjC); + const Color col(RGB2YCBCR(Color(v))); - const Color acol(YCBCR2RGB(Color(col+a))); - for (int p=0; p<3; ++p) + const Color acol(YCBCR2RGB(Color(col + clamped_a))); + for (int p = 0; p < 3; ++p) v[p] = (uint8_t)CLAMP(ROUND2INT(acol[p]), 0, 255); } }