Chapter Contents |
Previous |
Next |
FILTER |
Syntax | |
Details | |
Example |
Syntax |
rc=IMGOP(task-id, 'FILTER', filter-type, matrix); |
'CONVOLUTION'
. Other filter types will be added in the future.
Type: Character
Type: Character
Details |
The FILTER command supports convolution filters that are provided by users. A filter matrix is moved along the pixels in an image, and a new pixel value is calculated and replaced at the pixel that is at the center point of the filter matrix. The new value is determined by weighting nearby pixels according to the values in the filter matrix.
A detailed explanation of the concept and theory behind filtering is beyond the scope of this document. However, it is explained in many textbooks. For example, see Digital Image Processing, by Rafael Gonzalez and Paul Wintz, and The Image Processing Handbook, by John C. Russ.
The equation that FILTER uses is shown in Calculating New Pixel Values.
Example |
Consider the following 3x3 matrix:
-1 -2 -3 4 5 6 -7 8 -9Design the matrix with a divisor of 1 and a zero bias, and use the absolute value of the answer:
matrix="3 -1 -2 -3 4 5 6 -7 8 -9 1 0 1"; rc=imgop(tid,'FILTER',"CONVOLUTION",matrix);
Note: Calculated values that are larger than 255 are normalized to 255, and calculated values that are smaller than zero are normalized to zero. If 1 is set for 'absolute value', then negative numbers are converted to positive numbers before normalization.
A filter selection and creation window is available.
An example of using it is in the image sample catalog (imagedmo) named FILTEXAM.FRAME.
It is essentially the same window that is used in the Image Editor. It
accesses the filters that are shipped with the Image Editor.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.