More work on goal-ball alignment

This commit is contained in:
2018-06-23 20:50:28 +02:00
parent 73ca100c83
commit 67a8cccd51
5 changed files with 33 additions and 21 deletions

View File

@@ -39,7 +39,6 @@ class FieldFinder(object):
def mask_it(self, frame, field, inverse=False):
if field is not None:
print(frame.shape)
mask = np.zeros(frame.shape[:2], dtype=np.uint8)
cv2.drawContours(mask, (field,), -1, 255, -1)
if inverse:
@@ -123,6 +122,8 @@ class GoalFinder(object):
def goal_center(self, contour):
l, r = self.left_right_post(contour)
print('Left goal post:', l,
'Right goal post:', r)
return (l + r) / 2
def draw(self, frame, goal):