Mathematical morphology operations with a structuring element K (the kernel shape). On binary images, erosion thins shapes and dilation thickens them.
Parameters
| Parameter | Meaning |
|---|---|
| Operation | One of the five operations above. |
| Kernel shape | Shape of K: rectangle, inscribed ellipse or cross. |
| Kernel size | Side of K in pixels. |
| Iterations | n: erosion or dilation is repeated n times (for opening, n erosions then n dilations). |
References
- OpenCV 4.x documentation — Image Filtering (GaussianBlur, blur, medianBlur, bilateralFilter, morphologyEx). docs.opencv.org/4.x/d4/d86/group__imgproc__filter.html
- J. Serra. Image Analysis and Mathematical Morphology. Academic Press, 1982.
- R. C. Gonzalez, R. E. Woods. Digital Image Processing, 4th ed. Pearson, 2018.