Commands Used with the IMGCTRL, IMGOP and PICFILL Functions |
Syntax | |
Details |
Syntax |
rc=IMGOP(task-id, 'THRESHOLD', value); |
is a threshold value for converting standard RGB values to monochrome. Value can be:
1...255 |
sets the threshold that determines whether a color maps to black or white |
0 | |
-1 |
calculates the threshold value by averaging all pixels in the image. |
Details |
The THRESHOLD command acts on either the currently selected image or on the image specified by task-id. It enables documents that are scanned in color to be converted to monochrome for applying optical character recognition (OCR) and for other purposes. Dithering is not a good technique for converting images when OCR is used.
The threshold is a color value that acts as a cut-off point for converting colors to black and white. All colors greater than the threshold value map to white, and all colors less than or equal to the threshold value map to black.
The algorithm weights the RGB values, using standard intensity calculations for converting color to gray scale.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.