Specifications
ImageFiltering
6-18
6
MaxFilter
Applyamaxfiltertothe
image.
voidiplMaxFilter(IplImage*
srcImage
, IplImage*
dstImage
,
int
nCols
, int
nRows
, int
anchorX
, int
anchorY
);
srcImage
Thesourceimage.
dstImage
Theresultantimage.
nCols
Numberofcolumnsintheneighborhoodtouse.
nRows
Numberofrowsintheneighborhoodtouse.
anchorX, anchorY
The [x, y] coordinates of the anchor cell in the
neighborhood.Inthiscoordinatesystem,thetop
leftcornerwouldbe[0,0]andthebottomright
cornerwouldbe[
nCols
-1,
nRows
-1]. For a 3 by
3neighborhood,thecoordinatesofthegeometric
centerwouldbe[1,1].Thisspecificationallows
theneighborhoodtobeskewedwithrespecttoits
geometriccenter.
Discussion
ThefunctioniplMaxFilter()setseachpixelintheoutputimageasthe
maximumvalueofalltheinputimagepixelvaluesintheneighborhoodof
size
nRows
by
nCols
with the anchor cell at that pixel. This has the effect
ofincreasingthecontrastintheimage.