ImgConvolve5x5

Top  Previous  Next

Prototype

 

ImgConvolve5x5(intImageHandle, intM1, intM2, intM3, intM4, intM5, intM6, intM7, intM8, intM9,  intM10, intM11, intM12, intM13, intM14, intM15, intM16, intM17, intM18, intM19, intM20, intM21, intM22, intM23, intM24, intM25, 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... intM25: integer values corresponding to matrix coefficient to use. The values are placed geometrically as:

 

M01 M02 M03 M04 M05

M06 M07 M08 M09 M10

M11 M12 M13 M14 M15

M16 M17 M18 M19 M20

M21 M22 M23 M24 M25

 

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  -1

// -1  -1  -1  -1  -1

// -1  -1  24  -1  -1

// -1  -1  -1  -1  -1

// -1  -1  -1  -1  -1

// divisor 1, bias 0

ImgConvolve(_CurrentImage, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0);