From 6843021a45985ff0330fc83b8a42965ecce202c2 Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Mon, 29 Apr 2024 11:12:49 +0800 Subject: [PATCH] =?UTF-8?q?feat=20generate=20=E4=BF=AE=E6=94=B9=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E7=82=B9=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/generate_image/utils/image_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/generate_image/utils/image_processing.py b/app/service/generate_image/utils/image_processing.py index aeebffd..d4f5974 100644 --- a/app/service/generate_image/utils/image_processing.py +++ b/app/service/generate_image/utils/image_processing.py @@ -167,7 +167,7 @@ def stain_detection(image, spot_size=100): # 寻找轮廓 contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # 过滤非连续的纯白区域 - filtered_contours = [cnt for cnt in contours if cv2.contourArea(cnt) >= 30] # 根据面积进行过滤,这里假设面积大于30的为连续区域 + filtered_contours = [cnt for cnt in contours if cv2.contourArea(cnt) >= 300] # 根据面积进行过滤,这里假设面积大于30的为连续区域 # 如果有连续的纯白区域存在 if filtered_contours: # 将纯白区域替换为灰色