ovl.morphological_functions.morphological_functions module¶
-
ovl.morphological_functions.morphological_functions.
dilation
(mask, kernel=(5, 5), iterations=1, destination=None, anchor=None, border_type=None, border_value=None)[source]¶ - a copy of cv2.dilate with default kernel of 5 by 5
(a logical operation on the binary mask, whether every pixel’s value should stay as it is based on neighboring pixels, which neighbors are chosen by the kernel and its dimensions) Dilation demands at least one chosen neighbors must be True (white) For more information: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html
Parameters: - mask – the binary image where the erosion morphological function should be applied
- kernel – the kernel that should be used
- iterations – Number of times the function should be applied
- destination – where the new image should be saved
- anchor – position of the anchor within the element
- border_value – border value in case of a constant border
- border_type – sets the technique the pixels, that exceed the boundaries of the image for the use of the kernel, are determined with (if they should mirror, copy)
See: https://docs.opencv.org/3.4.2/d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5 :return: the dilated binary mask
-
ovl.morphological_functions.morphological_functions.
erosion
(mask, kernel=None, iterations=1, destination=None, anchor=None, border_type=None, border_value=None)[source]¶ - a copy of cv2.erode with default kernel of 5 by 5
(a logical operation on the binary mask, whether every pixel’s value should stay as it is based on neighboring pixels, which neighbors are chosen by the kernel and its dimensions) Erode demands all chosen neighbors must be True (white) For more information: https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html
Parameters: - mask – the binary image where the erosion morphological function should be applied
- kernel – the kernel that should be used
- iterations – Number of times the function should be applied
- destination – where the new image should be saved
- anchor – position of the anchor within the element
- border_value – border value in case of a constant border
- border_type – Pixel extrapolation technique for the border of the image
see: https://docs.opencv.org/3.4.2/d2/de8/group__core__array.html#ga209f2f4869e304c82d07739337eae7c5 :return: the eroded binary mask