small goal detection refactoring

This commit is contained in:
2018-06-18 20:19:47 +02:00
parent ac69501695
commit 2aac2354f9
2 changed files with 4 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ class GoalFinder(object):
# Final similarity score is just the sum of both
final_score = shape_sim + area_sim
print('Goal:', shape_sim, area_sim, final_score)
print('Candidate:', shape_sim, area_sim, final_score)
return final_score
def find_goal_contour(self, frame):
@@ -68,6 +68,8 @@ class GoalFinder(object):
similarities = [self.goal_similarity(cnt) for cnt in good_cnts]
best = min(similarities)
print('Final score:', best)
print()
if best > 0.35:
return None
# Find the contour with the shape closest to that of the goal

View File

@@ -8,7 +8,7 @@
[
0,
0,
140
159
],
[
180,