PICTools Programmer's Reference
SB_PARMS

SB_PARMS: OP_BINARIZE

 
Copy Code
typedef struct {
   DWORD               Reserved0;
   BYTE PICHUGE*       Reserved1;
   BYTE PICHUGE*       Reserved2;
   BYTE PICHUGE*       Reserved3;
   BYTE PICHUGE*       Reserved4;
   BYTE PICHUGE*       Reserved5;
   BYTE PICHUGE*       Reserved6;
   BYTE PICHUGE*       Reserved7;
   BYTE PICHUGE*       Reserved8;
   PICFLAGS            PicFlags;
   PICFLAGS            PicFlags2;  
   LONG                Subcode;
   LONG                LoThreshold;   
   LONG                HiThreshold;       
   LONG                GridAngle;
   LONG                GridPitch;
   LONG                Eccentricity;
   LONG                Mode;                         
   LONG                LCEFactor;
   LONG                Blur;
} SB_PARMS;

Fields:

Name Description

Reserved0

Reserved1

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

Reserved8

PicFlags

PicFlags2

These fields are not currently used and must be set to 0.

Subcode

Further qualify the auto-binarization mode by setting subcode to one of the following values. The preferred value is zero (default), which selects the most dynamically adaptive autobinarization. Autobinarization using either of the global thresholding subcodes is faster and performs well for images bimodal in nature or with large features, whereas adaptive with local thresholding generally yields higher accuracy.

  • 0 - use adaptive with local thresholding for autobinarization.
  • BIN_MODE_AUTO_SUBCODE_USE_GLOBAL_THRESHOLD - use legacy global thresholding for autobinarization (deprecated).
  • BIN_MODE_AUTO_SUBCODE_USE_ADV_GLOBAL_THRESHOLD - use advanced global thresholding for autobinarization.

LoThreshold

(Quick-text mode only) Must lie between 0 and 255. Controls background sensitivity. Should generally be set as high as possible without exceeding the brightness of any part of the background.

HiThreshold

(Quick-text mode only) Must lie between LoThreshold and 255. Controls letter and figure thickness. A suggested value is HiThreshold=(LoThreshold+255)/2.

Black noise appearing in the background can generally be eliminated by lowering the value of LoThreshold. Too-thick letters and figures can generally be improved by lowering the value of HiThreshold. Too-thin letters and figures can generally be improved by raising the value of LoThreshold and/or HiThreshold.

GridAngle

(Photo-halftone mode only) Orientation of the halftone grid from the horizontal, measured in degrees clockwise.

GridPitch

(Photo-halftone mode only) Must lie between 1 and 32. Distance from the center of a black dot in the halftone grid to the nearest white dot, measured in pixels.

Description: Description: f5

 

The white-dot/black-dot offset vector is rounded to the nearest integer pixel multiple (restricting the realizable angle/pitch combinations).

A natural tension exists between the ability to reproduce many gray levels (wide grid spacing) and reproducing fine image detail (narrow grid spacing).

Eccentricity

Ranges from -256 to 256. This affects the shape of the halftone grid. At the extremes -256 and 256, the grid becomes a linear grid. At the midpoint, the grid consists of circles/squares. Intermediate values give intermediately-shaped elliptical grid dots.

Examples:

 

Description: Description: f6

GridAngle = 0, GridPitch = 4, Eccentricity = 0

 

Description: Description: F7

GridAngle = 0, GridPitch = 4, Eccentricity = -256

 

Description: Description: F8

GridAngle = 0, GridPitch = 4, Eccentricity = 256

 

Description: Description: F9

GridAngle = 0, GridPitch = 4, Eccentricity = 72

 

Description: Description: F10

GridAngle = -45, GridPitch = 4, Eccentricity = 192

 

Description: Description: F11

GridAngle = 22, GridPitch = 8, Eccentricity = 0

 

Mode

Selects the binarization mode. Must be one of the following:

  • BIN_MODE_QUICK_TEXT                           Quick-text mode
  • BIN_MODE_PHOTO_HALFTONE                    Photo-halftone mode
  • BIN_MODE_GRAY                                      No binarization-grayscale output
  • BIN_MODE_AUTO                                      Auto-binarization mode

LCEFactor

Must lie between 0 and 255. If value 0, local contrast enhancement is not performed. Values from 1 to 255 control the sensitivity of local contrast enhancement to faint features; lower values yield less sensitivity.

 

Local contrast enhancement with LCEFactor = 246:

Description: Description: f4b

 

Local contrast enhancement with LCEFactor = 26:

Description: Description: F4e

 

Blur

Must be one of 0, BIN_BLUR_GAUSSIAN, or BIN_BLUR_SMART. Value 0 performs no blur.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback