Dilates an image by using a specific structuring element.
-
C++:
void
dilate
(InputArray
src, OutputArray
dst, InputArray
kernel, Point
anchor=Point(-1,-1), int
iterations=1, int
borderType=BORDER_CONSTANT, const Scalar&
borderValue=morphologyDefaultBorderValue()
)
-
-
Python:
cv2.
dilate
(src, kernel
[, dst
[, anchor
[, iterations
[, borderType
[, borderValue
]
]
]
]
]
) → dst
-
-
C:
void
cvDilate
(const CvArr*
src, CvArr*
dst, IplConvKernel*
element=NULL, int
iterations=1
)
-
-
Python:
cv.
Dilate
(src, dst, element=None, iterations=1
) → None
-
Parameters: - src – input image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F` or ``CV_64F.
- dst – output image of the same size and type as src.
- element – structuring element used for dilation; if element=Mat() , a 3 x 3 rectangular structuring element is used.
- anchor – position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center.
- iterations – number of times dilation is applied.
- borderType – pixel extrapolation method (see borderInterpolate() for details).
- borderValue – border value in case of a constant border (see createMorphologyFilter() for details).
The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken:
The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
Note
- An example using the morphological dilate operation can be found at opencv_source_code/samples/cpp/morphology2.cpp