一、膨胀
void cvErode(IplImage* src,IplImage* dst,IplConvkernel* B = NULL,int iterations = 1);
二、腐蚀
void cvDilate(IplImage* src,IplImage* dst,IplConvKernel* B = NULL,int iterations = 1);
三、自定义核
IplConvKernel* cvCreateStructuringElementEx(int cols,int rows,int anchor_x,int anchor_y,int shape,int* values = NULL);
void cvReleaseStructuringElement(IplConvKernel** element);
IplConvKernel的形状取值
- CV_SHAPE_RECT 核是矩形
- CV_SHAPE_CROSS 核是十字交叉形
- CV_SHAPE_CUSTOM 核是用户自定义的值
四、更通用的形态学
void cvMorphologyEx(const CvArr* src,CvArr* dst,CvArr* temp,IplConvKernel* element,int operation,int iterations = 1);
cvMorphologyEx()操作选项