优化操作逻辑

This commit is contained in:
2025-03-03 12:28:44 +08:00
parent 6767b5dcff
commit 207dc8a06a
3 changed files with 46 additions and 31 deletions

View File

@@ -25,7 +25,7 @@ def ShapeDetection(img:cv2.typing.MatLike):
percentage=nonzero_num/img_obj.size
# print(f"nonzero_num:{nonzero_num},size={img_obj.size}, pos:{percentage}")
# 通过计算图像白值的比例来判断实心还是空心
if(percentage>0.55):
if(percentage>0.63):
boll_count+=1
return (all_cont,boll_count)