implemented basic state machine

This commit is contained in:
2018-06-15 13:13:13 +02:00
parent 360fe35759
commit 10d6fbd40b
3 changed files with 197 additions and 142 deletions

View File

@@ -77,6 +77,10 @@ class GoalFinder(object):
def left_right_post(self, contour):
return contour[:,0].min(), contour[:,0].max()
def goal_center(self, contour):
l, r = self.left_right_post(self, contour)
return (l + r) / 2
def draw(self, frame):
goal = self.find_goal_contour(frame)
if goal is not None: