diff --git a/sb_vision/tokens.py b/sb_vision/tokens.py index f8b003c..9ecd635 100644 --- a/sb_vision/tokens.py +++ b/sb_vision/tokens.py @@ -89,11 +89,9 @@ def update_pixel_coords( self.homography_matrix = homography_matrix - # The pixel_corners value we expose is in clockwise order starting with - # the bottom left corner of the marker (if it weren't rotated). - # AprilTags returns an array with the first being the top left. thus we need to - # shift the ordering of the values by one to match our output. - self.pixel_corners = [pixel_corners[3]] + pixel_corners[:3] + # pixel corners: counter-clockwise from the bottom-left corner (relative to the marker) of the marker. + # For example, if the marker is upside down, the first corner coordinate will be the in the top right. + self.pixel_corners = pixel_corners # centre of marker: average the corners self.pixel_centre = PixelCoordinate(*np.average(pixel_corners, axis=0))