Exemplo n.º 1
0
    def bottom_hat_transform(image):
        """
            Method calculates the bottom hat transformation of a given imaeg
        """

        #image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        structure = np.array([[1., 1., 1., 1., 1., 1.],
                              [1., 1., 1., 1., 1., 1.],
                              [1., 1., 1., 1., 1., 1.]])
        return morphology.black_tophat(image, size=80)
Exemplo n.º 2
0
    def bottom_hat_transform(image):
        """
            Method calculates the bottom hat transformation of a given imaeg
        """

        #image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        structure = np.array([[1., 1., 1., 1., 1.,
                               1.], [1., 1., 1., 1., 1., 1.],
                              [1., 1., 1., 1., 1., 1.]])
        return morphology.black_tophat(image, size=80)
Exemplo n.º 3
0
def enhance(image):
    image = image.copy()
    image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    image = cv2.bilateralFilter(image, 9, 175, 175)
    image_top = morphology.white_tophat(image, size=400)
    image_bottom = morphology.black_tophat(image, size=80)
    image = cv2.add(image, image_top)
    image = cv2.subtract(image, image_bottom)
    clahe_obj = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(16, 16))
    image = clahe_obj.apply(image)
    return image
Exemplo n.º 4
0
def bottom_hat_transform(img):
    """Calculates the bottom-hat transformation of a given image.
    This transformation enhances the darker structures in the image.

    Args:
        img: A grayscale dental x-ray image.

    Returns:
        The top-hat transformation of the input image.

    """
    return morphology.black_tophat(img, size=80)
Exemplo n.º 5
0
def blackhat(image, size=60):
    return morphology.black_tophat(image, size)
Exemplo n.º 6
0
def bottom_hat_transform(img):
    return morphology.black_tophat(img, size=80)