ImageEn, unit imageenproc

TImageEnProc.Convolve

TImageEnProc.Convolve


Declaration

procedure Convolve(Kernel: array of double; KernelWidth, KernelHeight: Integer; Factor: Double);


Description

Convolve the specified kernel over the selected region.

Parameter Description
Kernel The convolution kernel (just a matrix made array)
KernelWidth The kernel matrix width (number of columns)
KernelHeight The kernel matrix height (number of rows)
Factor Multiplication factor (>0)

Note: If the image PixelFormat is not ie24RGB, it will be converted


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Examples

// performs "blur" effect using 5x5 kernel
ImageEnView1.Proc.Convolve( [0.0, 0.0, 1.0, 0.0, 0.0,
                             0.0, 1.0, 1.0, 1.0, 0.0,
                             1.0, 1.0, 1.0, 1.0, 1.0,
                             0.0, 1.0, 1.0, 1.0, 0.0,
                             0.0, 0.0, 1.0, 0.0, 0.0],
                            5, 5, 1/13);


// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

  

// Convolve the specified kernel over the selection (3x3 blur)
ImageEnView1.Proc.Convolve( [0.0, 1.0, 0.0,
                             1.0, 1.0, 1.0,
                             0.0, 1.0, 0.0],
                            3, 3, 1/5);