For December 1's session, the session revolved around 2 topics: Filtering via Spatial Filters, and Morphological Operations.
Spatial Filters
Filters are basically matrices that apply a specific value onto a pixel based on their neighbors. In order to apply these matrices, convolution is done.
Here is the original image shown in class:
![](https://static.wixstatic.com/media/1eb675_687ff2e33a3b4d54baff83f54042ec4f~mv2.png/v1/fill/w_240,h_241,al_c,q_85,enc_avif,quality_auto/1eb675_687ff2e33a3b4d54baff83f54042ec4f~mv2.png)
The appearance of the image can be changed by simply applying filters to all the pixels. Some filters applied are shown below:
The top left shows a Horizontal Sabel Filter, where most of the elements that have horizontal features are highlighted, while the image on its right shows a Vertical Sabel Filter, where Vertical elements are highlighted.
On the other hand, a sharpening filter can be seen on the lower left, while a Gaussian Blur is found on the right side.
Morphological Operations
Aside from applying filters to the images, Morphological Operations also apply matrices to pixels. However, a "structuring element" is taken into account instead, where image elements are cleaned up based on the correctness or completeness of the object.
Here, an object will be transformed based on a reference structure. Two basic morphological operations (erosion and dilation) can demonstrate the effect of the process.
Erosion - Reducing the structural element based on the reference structure
Dilation - Expanding the structural element based on the reference structure
Original Image
![](https://static.wixstatic.com/media/1eb675_297804c43fc5418da192ddc9c26e3505~mv2.png/v1/fill/w_248,h_250,al_c,q_85,enc_avif,quality_auto/1eb675_297804c43fc5418da192ddc9c26e3505~mv2.png)
Erosion Based from left reference structure
Dilation based from left reference structure
Dilation based from right reference structure
Advanced Morphological operations are also available, such as successive erosion dilation operations. These are called Opening and Closing.
Opening - Removing white spots from images, much like removing salt particles from pepper
Closing - Removing dark spots from images, much like removing pepper particles from salt
Reference Image and Opening Effect
Reference Image and Closing Effect
Comments