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: # 将纯白区域替换为灰色