Exemple #1
0
        def get_pitch_outline(self):
                '''
                Prompts the user to draw the Pitch outline as a series of points, then users these as
                extreme values to crop the camera image to these points and mask the outer edges to
                remove outer noise.
                '''
                self.get_zone('outline', 'Draw the outline of the pitch. Contine by pressing \'q\'')

                # Setup black mask to remove outside noise
                self.image = tools.mask_pitch(self.image, self.data[self.drawing])

                # Get crop size based on points and crop
                size = tools.find_crop_coordinates(self.image, self.data[self.drawing])
                self.image = self.image[size[2]:size[3], size[0]:size[1]]

                cv2.imshow(FRAME_NAME, self.image)
Exemple #2
0
        def get_pitch_outline(self):
                """
                Let user select points that corespond to the pitch outline.
                End selection by pressing 'q'.
                Result is masked and cropped.
                """
                self.get_zone('outline', 'Draw the outline of the pitch. Contine by pressing \'q\'')

                # Setup black mask to remove overflows
                self.image = tools.mask_pitch(self.image, self.data[self.drawing])

                # Get crop size based on points
                size = tools.find_crop_coordinates(self.image, self.data[self.drawing])
                # Crop
                self.image = self.image[size[2]:size[3], size[0]:size[1]]

                cv2.imshow(FRAME_NAME, self.image)
Exemple #3
0
    def get_pitch_outline(self):
        """
                Let user select points that corespond to the pitch outline.
                End selection by pressing 'q'.
                Result is masked and cropped.
                """
        self.get_zone(
            'outline',
            'Draw the outline of the pitch. Contine by pressing \'q\'')

        # Setup black mask to remove overflows
        self.image = tools.mask_pitch(self.image, self.data[self.drawing])

        # Get crop size based on points
        size = tools.find_crop_coordinates(self.image, self.data[self.drawing])
        # Crop
        #self.image = self.image[size[2]:size[3], size[0]:size[1]]

        cv2.imshow(FRAME_NAME, self.image)