ImgConvolve3x3

Top  Previous  Next

Prototype

 

ImgConvolve3x3(intImageHandle, intM1, intM2, intM3, intM4, intM5, intM6, intM7, intM8, intM9,  intDivisor, intBias)

 

Description

 

Applies a convolution matrix to the image.  Convolutions are used to perform many common image processing operations including sharpening, blurring, noise reduction, embossing, and edge enhancement.

 

Parameters

 

intImageHandle: integer value corresponding to the image handle.

 

intM1... intM9: integer values corresponding to matrix coefficient to use. The values are placed geometrically as:

 

M1 M2 M3

M4 M5 M6

M7 M8 M9

 

intDivisor: integer value corresponding to the divisor.

 

intBias: integer value corresponding to the bias.

 

 

Returned value

 

None.

 

Notes

 

Each image pixel and their neighbors are multiplied by the corresponding matrix values, then divided by divisor and added to bias.  The result is then clipped in the range 0 - 255.

 

Example

 

// Convolution using this matrix:

// -1  -1  -1

// -1   8  -1

// -1  -1  -1

// divisor 1, bias 0

ImgConvolve3x3(_CurrentImage, -1, -1, -1, -1, 8, -1, -1, -1, -1, 1, 0);