Specifications
Intel
®
Image Processing Library Reference Manual
8-2
8
Erode
Erodes the image.
void iplErode(IplImage*
srcImage
, IplImage*
dstImage
,
int
nIterations
);
srcImage
Thesourceimage.
dstImage
The resultant image.
nIterations
The number of times to erode the image.
Discussion
The function iplErode() performs an erosion of the image
nIterations
times. The way the image is eroded depends on whether it is a binary
image, a gray-scale image, or a color image.
• For a binary input image, the output pixel is set to zero if the
corresponding input pixel or any of its 8 neighboring pixels is a zero.
• For a gray scale or color image, the output pixel is set to the minimum
of the corresponding input pixel and its 8 neighboring pixels.
• For a color image, each color channel in the output pixel is set to the
minimum of this channel’s values at the corresponding input pixel and
its 8 neighboring pixels.
The effect of erosion is to remove spurious pixels (such as noise) and to
thin boundaries of objects on a dark background (that is, objects whose
pixel values are greater than those of the background).