Specifications
Image Filtering
6-9
6
nKernels
The number of kernels in the array
kernel
.The
value of
nKernels
can be 1 or more.
combineMethod
The way in which the results of applying each
kernel should be combined. This argument is
ignored when a single kernel is used. The
following combinations are supported:
IPL_SUM Sums the results.
IPL_SUMSQ Sums the squares of the results.
IPL_SUMSQROOT Sums the squares of the results
and then takes the square root.
IPL_MAX Takes the maximum of the results.
IPL_MIN Takes the minimum of the results.
Discussion
Functions iplConvolve2D() and iplConvolve2D() are used to convolve
an image with a set of convolution kernels. The results of using each kernel
are then combined using the
combineMethod
argument; see Example 6-1.
Example 6-1 Computing the 2-dimensional Convolution
int example61( void ) {
IplImage *imga, *imgb;
int one[9] = {1,0,1, 0,0,0, 1,0,1}; // a kernel to check
IplConvKernel* kernel; // REFLECT border mode
__try {
int i;
imga= iplCreateImageHeader( 1, 0, IPL_DEPTH_8U, "GRAY",
"GRAY", IPL_DATA_ORDER_PIXEL, IPL_ORIGIN_TL,
IPL_ALIGN_DWORD, 4, 4, NULL, NULL, NULL, NULL);
continued
☞