影像型能學運算 (Morphological Operations):
形態學主要用於二值化後的影像,根據使用者的目的,用來凸顯影像的形狀特徵,像邊界和連通區域等,同時像細化、像素化、修剪毛刺等技術也常用於圖像的預處理和後處理,
In short: A set of operations that process images based on shapes. Morphological operations apply a structuring element to an input image and generate an output image.
The most basic morphological operations are two: Erosion and Dilation. They have a wide array of uses, i.e. :
- Removing noise
- Isolation of individual elements and joining disparate elements in an image.
- Finding of intensity bumps or holes in an image
膨脹(Dilation)==> 白色區域影像變胖
![Left image: original image inverted, right image: resulting dilatation](https://docs.opencv.org/2.4/_images/Morphology_1_Tutorial_Theory_Dilatation_2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzUo3Zu4ZZulbeGj9An5MFFxl_Cvlpe4DmvlBtxldIJV8MhKzuw0p0gOImgBKA3JsfGWeNlTksSnenMgCXuKRLLAyobofzUM-oA6efyRpiaAEgnrykjp0OsBsZM75t5jIpFD4FDSzTMQ8/s1600/FiltersMorphologicalDilation.jpg)
侵蝕(Erosion) ==> 白色區域影像變瘦
![Left image: original image inverted, right image: resulting erosion](https://docs.opencv.org/2.4/_images/Morphology_1_Tutorial_Theory_Erosion_2.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPdOHXVMgT36dplY3xDOmP5r7kVK5UH9jaBZjNTR4KVnZM1S7eAXQqQva5TPvLtsXMFMolBjY1KLhrrp1YeynhhqhBf4LxP6ma9QJDMOphLHL6y7eUxmrSjq6QeXBzpL1t49Z4I5iK7qc/s1600/FiltersMorphologicalErosion.jpg)
斷開(Opening): 先Erosion再Dilation 可以將硬幣分離
References:
- https://slidesplayer.com/slide/11398438/
- http://monkeycoding.com/?p=577
- http://blog.christianperone.com/2014/06/simple-and-effective-coin-segmentation-using-python-and-opencv/