digital_image_processing.morphological_operations.erosion_operation

Attributes

lena_path

Functions

erosion(→ numpy.ndarray)

Return eroded image

gray_to_binary(→ numpy.ndarray)

Return binary image from gray image

rgb_to_gray(→ numpy.ndarray)

Return gray image from rgb image

Module Contents

digital_image_processing.morphological_operations.erosion_operation.erosion(image: numpy.ndarray, kernel: numpy.ndarray) numpy.ndarray

Return eroded image

>>> erosion(np.array([[True, True, False]]), np.array([[0, 1, 0]]))
array([[False, False, False]])
>>> erosion(np.array([[True, False, False]]), np.array([[1, 1, 0]]))
array([[False, False, False]])
digital_image_processing.morphological_operations.erosion_operation.gray_to_binary(gray: numpy.ndarray) numpy.ndarray

Return binary image from gray image

>>> gray_to_binary(np.array([[127, 255, 0]]))
array([[False,  True, False]])
>>> gray_to_binary(np.array([[0]]))
array([[False]])
>>> gray_to_binary(np.array([[26.2409, 4.9315, 1.4729]]))
array([[False, False, False]])
>>> gray_to_binary(np.array([[26, 255, 14], [5, 147, 20], [1, 200, 0]]))
array([[False,  True, False],
       [False,  True, False],
       [False,  True, False]])
digital_image_processing.morphological_operations.erosion_operation.rgb_to_gray(rgb: numpy.ndarray) numpy.ndarray

Return gray image from rgb image

>>> rgb_to_gray(np.array([[[127, 255, 0]]]))
array([[187.6453]])
>>> rgb_to_gray(np.array([[[0, 0, 0]]]))
array([[0.]])
>>> rgb_to_gray(np.array([[[2, 4, 1]]]))
array([[3.0598]])
>>> rgb_to_gray(np.array([[[26, 255, 14], [5, 147, 20], [1, 200, 0]]]))
array([[159.0524,  90.0635, 117.6989]])
digital_image_processing.morphological_operations.erosion_operation.lena_path