From 31e848e8bbad4be61850fbdb58b27e0d709c8933 Mon Sep 17 00:00:00 2001 From: zhh Date: Mon, 22 Sep 2025 10:41:09 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=89:=20=20=20=E7=81=B0=E8=89=B2sketch=E5=9B=BE=E4=BD=BFpr?= =?UTF-8?q?int=E9=A2=9C=E8=89=B2=E5=8F=98=E6=9A=97=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E6=B5=8B=E8=AF=95=20fix=EF=BC=88=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dbug=EF=BC=89:=20docs=EF=BC=88=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=EF=BC=89:=20refactor=EF=BC=88=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=89:=20test(=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/design_fast/pipeline/print_painting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/service/design_fast/pipeline/print_painting.py b/app/service/design_fast/pipeline/print_painting.py index e38ba95..2c5711b 100644 --- a/app/service/design_fast/pipeline/print_painting.py +++ b/app/service/design_fast/pipeline/print_painting.py @@ -151,7 +151,12 @@ class PrintPainting: img_bg = cv2.bitwise_and(result['pattern_image'], result['pattern_image'], mask=cv2.bitwise_not(print_mask)) mask_mo = np.expand_dims(print_mask, axis=2).repeat(3, axis=2) gray_mo = np.expand_dims(result['gray'], axis=2).repeat(3, axis=2) - img_fg = (img_fg * (mask_mo / 255) * (gray_mo / 255)).astype(np.uint8) + # img_fg = (img_fg * (mask_mo / 255) * (gray_mo / 255)).astype(np.uint8) + # img_fg = (img_fg * (gray_mo / 255)).astype(np.uint8) # 只保留gray影响 - 无效 + img_fg = (img_fg * (mask_mo / 255) * (1.5 * gray_mo / 255)).astype(np.uint8) # 增加系数权重,减轻变暗效果 + + + result['final_image'] = cv2.add(img_bg, img_fg) canvas = np.full_like(result['final_image'], 255) temp_bg = np.expand_dims(cv2.bitwise_not(result['mask']), axis=2).repeat(3, axis=2)