예제 #1
0
    def get_mask(self, im: np.array):
        """
        get_mask(im)
    
        Function to compute the mask of an certain image,in this case is done 
        in RGB system
    
        Parameters   Value
       ----------------------
        'im'          Dataset image
    
        Returns the mask, binary image with the detections.
        """
        # Color segmentation in RGB
        mask, im = segregation(im, 'rgb')

        # Hole filling
        mask = fill_holes(mask)

        # Mask Blurring
        mask = blur(mask)

        # Compute the final mask
        mask = discard_geometry.get_mask(mask)

        return mask, im
예제 #2
0
    def get_mask(self, im: np.array):
        """
        get_mask(im)
    
        Function to compute the mask of an certain image,in this case is done 
        in HSV system
    
        Parameters   Value
       ----------------------
        'im'          Dataset image
    
        Returns the mask, binary image with the detections.
        """

        # Color segmentation in HSV
        mask, im = segregation(im, 'hsv')

        # Mask morpho
        mask = morpho(mask)

        # Hole filling
        mask = fill_holes(mask)

        regions = get_cc_regions(mask)

        # Compute the final mask
        mask, regions = discard_geometry.get_mask(mask, regions)

        return regions, mask, im
예제 #3
0
    def get_mask(self, im: np.array):
        """
        get_mask(im)
    
        Function to compute the mask of an certain image,in this case is done 
        in HSV system to an image with Y-histogram equalised
    
        Parameters   Value
       ----------------------
        'im'          Dataset image
    
        Returns the mask, binary image with the detections.
        """
        # Equalization of the Y channel of the image
        im = histogram_equalization(im, False)

        # Color segmentation in HSV
        mask, im = segregation(im, 'hsv')

        # Mask Blurring
        mask = blur(mask)

        # Hole filling
        mask = fill_holes(mask)

        # Compute the final mask
        mask = discard_geometry.get_mask(mask)

        return mask, im
예제 #4
0
    def get_mask(self, im: np.array):
        # Color segmentation in HSV
        mask, im = segregation(im, 'hsv')

        mask = morpho(mask)
        mask = fill_holes(mask)

        mask, regions = convolution(mask)
        mask, regions = discard_geometry.get_mask(mask, regions)

        return regions, mask, im