Foundation > Image Processing Filters > IlvBitmapFilter: The Image Processing Class > The IlvConvolutionFilter Class
 
The IlvConvolutionFilter Class
The IlvConvolutionFilter class lets you apply a matrix convolution filter effect. A convolution combines pixels in the input image with neighboring pixels to produce a resulting image. A wide variety of imaging operations can be achieved through convolutions, including blurring, edge detection, sharpening, embossing and beveling.
A matrix convolution is based on an n-by-m matrix (the convolution kernel) which describes how a given pixel value in the input image is combined with its neighboring pixel values to produce a resulting pixel value. Each result pixel is determined by applying the kernel matrix to the corresponding source pixel and its neighboring pixels.
To illustrate, suppose you have an input image which is 5 pixels by 5 pixels, whose color values are as follows:
0 20 40 235 235
100 120 140 235 235
200 220 240 235 235
225 225 255 255 255
225 225 255 255 255
and you define a 3-by-3 convolution kernel as follows:
1 2 3
4 5 6
7 8 9
Let us focus on the pixel at the second row and second column of the image (the source pixel value is 120). Then the resulting pixel value will be:
(1* 0 + 2* 20 + 3* 40 +
 
4*100 + 5*120 + 6*140 +
 
7*200 + 8*220 + 9*240) / (1+2+3+4+5+6+7+8+9)
You can specify a divisor (a number by which the result of the matrix convolution is divided) and a bias (a number by which the result of the matrix convolution is added).
The kernel is described by the IlvBitmapDataKernel class.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.