Activity 8: Morphological Operations
For this activity [1] , we make use of several shapes, namely:
- a 5x5 square
- a 3x3 triangle
- a hollow 10x10 box, 2 units thick
- a 5x5 plus sign, 1 unit thick
to be manipulated by several structuring elements, namely
- 2x2 ones
- 2x1 ones
- 1x2 ones
- 3x3 cross
- 2x2 antidiagonal line
All the shapes were generated by Python’s imaging library (PIL), and the operations were performed using OpenCV. For the shapes, their origin is located at the shape’s geometric center, while for the structuring elements, their origin is located in the lower-left corner. The result for the dilation of the images is shown in Fig. 1, while Fig. 2 shows the result for erosion.
References
- M. N. Soriano, Morphological operations (2019).
Keywords
morphological operation
opencv
dilation
erosion
structuring element