def average_goal_matching(contour):
global DEFINITE_GOALS
total_score = 0
min_score = 9999999999999999
# number_of_things = 0
if len(contour) < 8:
return 9999999999999999
for definite_goal in DEFINITE_GOALS:
# number_of_things += 1
this_score = cv2.matchShapes(contour, definite_goal, 1, 0.0)
# print("Score:", this_score)
total_score += this_score
if this_score < min_score:
min_score = this_score
# print(number_of_things)
# print("Smallest score:", min_score)
# return total_score / DEFINITE_GOALS.size
return min_score
vision_processing.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录