一、引入
基本的膨胀和腐蚀能够满足二值图像的处理,但是对于灰度图像和彩色图像提供了开运算和闭运算。开运算就是先腐蚀后膨胀,
void cvMorphologyEx( const CvArr* src, CvArr* dst, CvArr* temp, IplConvKernel* element, int operation, int iterations=1 );srcSource image. dstDestination image. tempTemporary image, required in some cases. elementStructuring element. operationType of morphological operation, one of: CV_MOP_OPEN - opening CV_MOP_CLOSE - closing CV_MOP_GRADIENT - morphological gradient CV_MOP_TOPHAT - "top hat" CV_MOP_BLACKHAT - "black hat"iterationsNumber of times erosion and dilation are applied. The function cvMorphologyEx can perform advanced morphological transformations using erosion and dilation as basic operations.Opening:dst=open(src,element)=dilate(erode(src,element),element)Closing:dst=close(src,element)=erode(dilate(src,element),element)Morphological gradient:dst=morph_grad(src,element)=dilate(src,element)-erode(src,element)"Top hat":dst=tophat(src,element)=src-open(src,element)"Black hat":dst=blackhat(src,element)=close(src,element)-srcThe temporary image temp is required for morphological gradient and, in case of in-place operation, for "top hat" and "black hat".
本文转载自:CSDN博客
欢迎加入我爱机器学习QQ14群:336582044
微信扫一扫,关注我爱机器学习公众号