图像腐蚀和图像膨胀是图像中两种最基本形态学操作。
void erode( const Mat& src, Mat& dst, const Mat& element,Point anchor=Point(-,-), int iterations=,int borderType=BORDER_CONSTANT,
const Scalar& borderValue=morphologyDefaultBorderValue() );
void dilate( const Mat& src, Mat& dst, const Mat& element,Point anchor=Point(-,-), int iterations=,int borderType=BORDER_CONSTANT,
const Scalar& borderValue=morphologyDefaultBorderValue() );
可见,腐蚀和膨胀的参数完全一样。
参数:
src:原图像。
dst:目标图像。
element:腐蚀操作的内核。 如果不指定,默认为一个简单的
矩阵。否则,我们就要明确指定它的形状,可以使用函数getStructuringElement().
anchor:默认为Point(-1,-1),内核中心点。省略时为默认值。
iterations:腐蚀次数。省略时为默认值1。
borderType:推断边缘类型,具体参见borderInterpolate函数。默认为BORDER_DEFAULT,省略时为默认值。
borderValue:边缘值