形状描边修复

This commit is contained in:
2025-12-13 20:22:13 +08:00
parent 1f887aeaf6
commit 5e01e086f2
2 changed files with 9 additions and 18 deletions

View File

@ -1191,6 +1191,10 @@ class ImageFilterImplement:
# 创建描边图像
stroke_img = np.zeros_like(img)
# 如果没有轮廓,直接返回原图
if not expanded_contours[0].any():
return image
cv2.fillPoly(stroke_img, expanded_contours, ColorHandle.parse_color(stroke_color) + (255,))
# 轮廓图像转为PIL格式