PICTools Programmer's Reference
SCANFIX

SCANFIX: OP_SCANFIX

 
Copy Code
typedef struct {
   DWORD                            Reserved0;
   ScanFixReportData PICHUGE*       ReportingData;
   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                             Stride;
   BITMAPINFOHEADER                 BiOut;
   RGBQUAD                          PadColor;
   LONG                             OutputStride;
   LONG                             Confidence;
   LONG                             CountOfFeaturesFound;
   LONG                             DetectionQuality;
   LONG                             RectX;
   LONG                             RectY;
   LONG                             RectWidth;
   LONG                             RectHeight;
   LONG                             ReservedA;
   LONG                             ReservedB;
   LONG                             ReservedC;
   LONG                             ReservedD;
   LONG                             ReservedE;
   LONG                             ReservedF;
   LONG                             ReservedG;
   LONG                             ReservedH;
   union {
      SCANFIX_SC0                   SC0;
      SCANFIX_SC1                   SC1;
      SCANFIX_SC2                   SC2;
      SCANFIX_SC3                   SC3;
      SCANFIX_SC7                   SC7;
      SCANFIX_SC7                   SC8;
      SCANFIX_SC7                   SC9;
      SCANFIX_SC7                   SC10;
      SCANFIX_SC13                  SC13;
      SCANFIX_SC14                  SC14;
      SCANFIX_SC15                  SC15;
      SCANFIX_SC16                  SC16;
      SCANFIX_SC17                  SC17;
      SCANFIX_SC18                  SC18;
      SCANFIX_SC19                  SC19;
      SCANFIX_SC20                  SC20;
      SCANFIX_SC21                  SC21;
      SCANFIX_SC23                  SC23;
      SCANFIX_SC24                  SC24;
      SCANFIX_SC26                  SC26;
      SCANFIX_SC29                  SC29;
      SCANFIX_SC30                  SC30;
      SCANFIX_SC31                  SC31;
      SCANFIX_SC32                  SC32;
      SCANFIX_SC33                  SC33;
      SCANFIX_SC52                  SC52;
      SCANFIX_SC53                  SC53;
      SCANFIX_SC54                  SC54;
      SCANFIX_SC58                  SC58;
      } u;
} SCANFIX; 
 
Copy Code
typedef struct {
   double      DetectedHorizontalAngle;
   double      DetectedVerticalAngle;
   LONG        DetectedVariation;
} SCANFIX_SC0;
 
Copy Code
typedef struct {
   LONG        SpeckWidth;
   LONG        SpeckHeight;
} SCANFIX_SC1;
 
Copy Code
typedef struct {
   double      MinimumAspectRatio;
   LONG        MinimumLength;
   LONG        MaximumThickness;
   LONG        MaximumGap;
   LONG        MaximumCharacterRepairSize;
   LONG        EdgeCleaning;
   LONG        Reserved1;
   LONG        Reserved2;
   LONG        Reserved3;
   LONG        Reserved4;
   LONG        Reserved5;
   LONG        Reserved6;
   LONG        Reserved7;
} SC2_LINE_PARAMS;
 
Copy Code
typedef struct {
   SC2_LINE_PARAMS         HorizontalLine;
   SC2_LINE_PARAMS         VerticalLine;
} SCANFIX_SC2;
 
Copy Code
typedef struct {
   double      HorizontalRotationAngle;
   double      VerticalRotationAngle;
   BOOL        MaintainOriginalSize;
} SCANFIX_SC3;
 
Copy Code
typedef struct {
   LONG        AmountOfEffectLeft;
   LONG        AmountOfEffectRight;
   LONG        AmountOfEffectUp;
   LONG        AmountOfEffectDown;
} SCANFIX_SC7;
 
Copy Code
typedef struct {
   LONG        BlankDetectMinContrast;
   LONG        BlankDetectMinObjectDimension;
   LONG        BlankDetectGapFill;
   BOOL        BlankDetectIgnoreBorder;
   BOOL        BlankDetectIsBlank;
   LONG        MarginTop;
   LONG        MarginLeft;
   LONG        MarginRight;
   LONG        MarginBottom;
} SCANFIX_SC13;
 
Copy Code
typedef struct {
   LONG        BlankDetectMinContrast;
   LONG        BlankDetectMinObjectDimension;
   LONG        BlankDetectGapFill;
   BOOL        BlankDetectIgnoreBorder;
   BOOL        BlankDetectIsBlank;
} SCANFIX_SC14;
 
Copy Code
typedef struct {
   LONG        MinimumPixelCount;
   LONG        MaximumPixelCount;
   LONG        MinimumDensity;
} SCANFIX_SC15;
 
Copy Code
typedef struct {
   double     HorizontalMagnification;
   double     VerticalMagnification;
} SCANFIX_SC16;
 
Copy Code
typedef struct {
   LONG        MinimumAreaWidth;
   LONG        MinimumAreaHeight;
   LONG        VerticalSizeAdjustment;
   LONG        HorizontalSizeAdjustment;
   LONG        DensityAdjustment;
   LONG        MaximumDotSize;
   LONG        MaximumVerificationHeight;
} SCANFIX_SC17;
 
Copy Code
typedef struct {
   LONG        MinimumAreaWidth;
   LONG        MinimumAreaHeight;
   LONG        MinimumBlackOnEdges;
   LONG        Density;
} SCANFIX_SC18;
 
Copy Code
typedef struct {
   LONG        Amount;
} SCANFIX_SC19;
 
Copy Code
typedef struct {
   LONG        ImageIsNormal;
} SCANFIX_SC20;
 
Copy Code
typedef struct {
   LONG        BorderSpeckSize;
   LONG        PageSpeckSize;
   LONG        MinimumPageWidth;
   LONG        MaximumPageWidth;
   LONG        MinimumPageHeight;
   LONG        MaximumPageHeight;
   double      DetectedHorizontalAngle;
   double      DetectedVerticalAngle;
   LONG        PageX;
   LONG        PageY;
   LONG        PageWidth;
   LONG        PageHeight;
   LONG        AmountToExpandPage;
   BOOL        DeskewBorder;
   BOOL        ReplaceBorder;
   BOOL        RemoveBorder;
} SCANFIX_SC21;
 
Copy Code
typedef struct {
   LONG        MinimumCombLength;
   LONG        CombHeight;
   LONG        CombSpacing;
   LONG        HorizontalLineThickness;
   LONG        VerticalLineThickness;
   LONG        MinimumConfidence;
} SCANFIX_SC23;
 
Copy Code
typedef struct {
   LONG        FeedbackLinesRemoved; /* Output: number of lines removed */
   LONG        ResultantMargin; /* Desired left/top margin */
   LONG        SkipDistance;
   LONG        MinBackground;
   LONG        MinForeground;
   LONG        MinActivity;
   LONG        ToLineMinLineLength;
   LONG        ToLineMaxLineGap;
   LONG        ToLineMaxLineThickness;
   BOOL        Active;
   BOOL        CentralFocus;
   BOOL        AddOnly;
   BOOL        IgnoreHoles;
   BOOL        SkipActive;
   BOOL        ToLineActive;
   BOOL        ToLineCheckThinLinesActive;
   LONG        Reserved1;
   LONG        Reserved2;
   LONG        Reserved3;
   LONG        Reserved4;
   LONG        Reserved5;
   LONG        Reserved6;
   LONG        Reserved7;
} SC24_REGISTER_PARAMS;
 
Copy Code
typedef struct {
   SC24_REGISTER_PARAMS      HorizontalRegister;
   SC24_REGISTER_PARAMS      VerticalRegister;
} SCANFIX_SC24;
 
Copy Code
typedef struct {
   DWORD       Radius;
   DWORD       Flags;
   RGBQUAD     Color;
} SCANFIX_COLOR_REGION;
 
Copy Code
typedef struct {
   DWORD       Radius;
   DWORD       Flags;
   BYTE        Hue;
   BYTE        Reserved1;
   BYTE        Reserved2;
   BYTE        Reserved3;
} SCANFIX_HUE;
 
Copy Code
typedef struct  {
   BYTE         TargetBrightness;
   BYTE         TargetContrast;
   BYTE         TargetVariance;
   BYTE         Reserved1;
   DWORD        Correction;
   LONG         MinPercentile;
   LONG         MaxPercentile;
   BYTE         ContrastLimitDark;
   BYTE         ContrastLimitMid;
   BYTE         ContrastLimitLight;
   BYTE         Reserved2;
   DWORD        Method;        /* adaptive or global */
   BYTE         *PercentileGraph;
   BYTE         AverageBackground;
   BYTE         BackgroundVariance;
   BYTE         NoiseRadius;
   BYTE         AverageContrast;
} SCANFIX_SC26;
 
Copy Code
typedef struct {
   DWORD                     ColorCount;
   RGBQUAD                   DropToColor;
   BOOL                      Extract;
   SCANFIX_COLOR_REGION      *ColorList;
} SCANFIX_SC29;
 
Copy Code
typedef struct {
   DWORD       Type;        /* User, Gaussian, unsharp, box, median */
   DWORD       Width;
   DWORD       Height;
   LONG        CenterX;
   LONG        CenterY;
   LONG        Divisor;
   LONG        Offset;
   LONG        *Weights;
} SCANFIX_SC30;
 
Copy Code
typedef struct {
   DWORD                    ColorCount;
   BOOL                     Automatic;
   SCANFIX_COLOR_REGION     *ColorList;
} SCANFIX_SC31;
 
Copy Code
typedef struct {
   DWORD           HueCount;
   BOOL            Extract;
   SCANFIX_HUE     *HueList;
} SCANFIX_SC32;
 
Copy Code
typedef struct {
   BOOL        IgnorePaperColor;
   DWORD       MinimumSize;
   BOOL        GenerateBoxes;
   BYTE        BoxOverlap;
   BYTE        MinimumSaturation;
   BYTE        MinimumBrightness;
   BYTE        Sensitivity;
   BOOL        IsColor;
   DWORD       Reason;
   LONG        BigObjects;
   LONG        SmallObjects;
   LONG        AverageSaturation;
   DWORD       BoxCount;
   LONG        *BoxCoords;  /* x, y, w, h, ... */
} SCANFIX_SC33;
 
Copy Code
typedef struct  {
   DWORD        MethodUsed;
   LONG         MinPercentileUsed;
   LONG         MaxPercentileUsed;
   BYTE         ContrastLimitDarkUsed;
   BYTE         ContrastLimitMidUsed;
   BYTE         ContrastLimitLightUsed;
   BYTE         Reserved2;
   BYTE         *PercentileGraph;
   BYTE         AverageBackground;
   BYTE         BackgroundVariance;
   BYTE         NoiseRadius;
   BYTE         AverageContrast;
} SCANFIX_SC52;
 
Copy Code
typedef struct {
   LONG        X;
   LONG        Y;
   LONG        Width;
   LONG        Height;   
} SC53_BOUNDING_BOX;
 
Copy Code
typedef struct {
   SC53_BOUNDING_BOX PICHUGE*     PunchLocation;
   LONG PICHUGE*                  PunchConfidence;
} SCANFIX_SC53;
 
Copy Code
typedef struct  {
   LONG         X;
   LONG         Y;
   LONG         Width;
   LONG         Height;
} SC54_INVERSE_REGION;
 
Copy Code
typedef struct  {
   BOOL                     PerformCorrection;
   SC54_INVERSE_REGION      *InverseRegions;
} SCANFIX_SC54;
 
Copy Code
typedef struct  {
   LONG         DegreesToRotate;
   BOOL         DisallowSideways;
} SCANFIX_SC58;

Fields:

Name Description

Reserved0

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

Reserved8

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

ReportingData

This field is used to provide a pointer to a structure used n RES_QUERY calls to the defer function, currently supported by line, comb, and blob removal.  If set to a non-NULL value, the defer function will be called with a value of RES_QUERY, and the structure pointed to by ReportingData will be filled with information about each object detected.

PicFlags

May set PF_NoDibPad to force no padding when Stride is set to zero.

PicFlags2

May set PF2_ActOnRectangle to force subcodes SF_SUBCODE_DETECT_BLANK_PAGE (13). and SF_SUBCODE_REMOVE_COMBS (23) to operate on a subset of the image, as defined in RectX, RectY, RectWidth, and RectHeight.

Subcode

Set as indicated by the following table:

Subcode

Operation

SF_SUBCODE_DETECT_SKEW
(0)

Detect image skew

SF_SUBCODE_DESPECKLE
(1)

Remove black specks

SF_SUBCODE_REMOVE_LINES
(2)

Remove horizontal and vertical lines

SF_SUBCODE_ROTATE
(3)

Rotate

SF_SUBCODE_MIRROR
(4)

Mirror

SF_SUBCODE_FLIP
(5)

Flip

SF_SUBCODE_NEGATE
(6)

Negate

SF_SUBCODE_DILATE
(7)

Dilate

SF_SUBCODE_ERODE
(8)

Erode

SF_SUBCODE_DIAGONAL_DILATE
(9)

Diagonal dilate

SF_SUBCODE_DIAGONAL_ERODE
(10)

Diagonal erode

SF_SUBCODE_GET_RECTANGLE
(11)

Get a rectangle of pixels from an image

SF_SUBCODE_SMOOTH_ZOOM
(12)

Smoothly double the width and height of an image

SF_SUBCODE_DETECT_BLANK_PAGE
(13)

Blank page detection

SF_SUBCODE_DETECT_BLANK_RECTANGLE
(14)

Blank rectangle detection

SF_SUBCODE_REMOVE_BLOBS
(15)

Blob or hole punch removal

SF_SUBCODE_SCALE
(16)

Scale

SF_SUBCODE_REMOVE_DOT_SHADING
(17)

Remove dot shading

SF_SUBCODE_CORRECT_INVERSE_TEXT
(18)

Correct inverse text

SF_SUBCODE_SMOOTH_OBJECTS
(19)

Smooth objects

SF_SUBCODE_DETECT_NEGATIVE_PAGE
(20)

Detect negative page

SF_SUBCODE_REMOVE_BORDER
(21)

Auto border crop

SF_SUBCODE_REMOVE_COMBS
(23)

Remove combs

SF_SUBCODE_REGISTER
(24)

Register image (adjust margins)

SF_SUBCODE_CORRECT_CONTRAST

(26)

Analyze and/or correct brightness and contrast

SF_SUBCODE_COLORDROP

(29)

Drop out or change specific colors in a color image

SF_SUBCODE_FILTER

(30)

Apply various filters to color and gray images

SF_SUBCODE_IMAGEDETERGENT

(31)

Color based noise removal

SF_SUBCODE_VIRTUALBULB

(32)

Drop out or extract certain hues from color images (dropout scanner emulation)

SF_SUBCODE_DETECT_COLOR

(33)

Determine if an image contains primarily monochromatic data, and return the locations of saturated data

SF_SUBCODE_AUTO_DESPECKLE
(51)

Analyze and remove black specks

SF_SUBCODE_AUTO_CORRECT_CONTRAST

(52)

Automatically correct brightness and contrast

SF_SUBCODE_AUTO_REMOVE_HOLEPUNCHES

(53)

Automatically remove hole punches

SF_SUBCODE_AUTO_CORRECT_INVERSE_TEXT

(54)

Automatically correct inverse text

SF_SUBCODE_AUTO_COLOR_DESPECKLE

(55)

Analyze and remove specks and texture from color and grayscale document images

SF_SUBCODE_AUTO_ORIENT_DETECT

(58)

Automatically determine page orientation

SF_SUBCODE_AUTO_REMOVE_DOT_SHADING

(59)

Remove dot shading (automatic algorithm)

Stride

Set to the image line width in bytes including padding at the end of the line width. If the stride is left 0 and PF_NoDibPad is not set in PicFlags, the stride will be calculated  [ (((Width *BitCount)+31)&(~31))/8 ] to be 32-bit aligned. If the stride is left 0 and PF_NoDibPad is set in PicFlags, the stride will be calculated  [ (Width *BitCount)/8 ] to be byte aligned.

BiOut

The new image dimensions will be returned in this Bitmap header structure after a successful completion of the REQ_INIT portion of the OP_SCANFIX operation.

PadColor

Parameter is used with SF_SUBCODE_ROTATE (3) and SF_SUBCODE_GET_RECTANGLE (11). This parameter controls the color used when pixels must be added to the original image. It must be either pure black or pure white.

OutputStride

The stride of the output image will be returned in this value after a successful completion of the REQ_INIT portion of the OP_SCANFIX operation. If the operation will not change the size of the image, then this value will be equal to Stride (or the implicit value if Stride is zero). If the operation does change the size of the image, this value will be set to [ (Width *BitCount)/8 ] if PF_NoDibPad is set in PicFlags and to [ (((Width *BitCount)+31)&(~31))/8 ] if it is not set.

Confidence

Parameter is used with Detect Image Skew (Subcode = 0). The confidence of the detection operation will be returned in this value after a successful completion of the REQ_EXEC portion of the OP_SCANFIX operation. The value will be between 0 and 100 inclusive with 0 indicating no confidence in the detected result and 100 indicating complete confidence.

CountOfFeaturesFound

Parameter is used with Remove Black Specks (Subcode = 1) and Remove Horizontal and Vertical Lines (Subcode = 2). The number of lines or specks found (and subsequently removed) will be returned in this value after a successful completion of the REQ_EXEC portion of the OP_SCANFIX operation. The value may be zero, indicating that the image was not modified.

DetectionQuality

Parameter is used with SF_SUBCODE_DETECT_SKEW(0), SF_SUBCODE_DETECT_NEGATIVE_PAGE(20), SF_SUBCODE_REMOVE_BORDER(21), and SF_SUBCODE_CORRECT_CONTRAST(26). This parameter controls the amount of effect exerted to produce the correct result. The value must be between 0 and 100 inclusive with 0 indicating minimal effort should be exerted and 100 meaning maximal effort should be exerted. Lower values will cause the detection process to run in less time, while higher values will cause the detection process to produce more accurate results.

RectX

Parameter is used with SF_SUBCODE_GET_RECTANGLE (11) , SF_SUBCODE_DETECT_BLANK_RECTANGLE (14), and SF_SUBCODE_REMOVE_COMBS (23). Set to upper left horizontal pixel offset location of area. Setting the Q_REVERSE flag in the GET QFlags parameter indicates that the image is bottom up and the coordinates offsets will be applied accordingly.

RectY

Parameter is used with SF_SUBCODE_GET_RECTANGLE (11) , SF_SUBCODE_DETECT_BLANK_RECTANGLE (14), and SF_SUBCODE_REMOVE_COMBS (23). Set to upper left vertical pixel offset location of area. Setting the Q_REVERSE flag in the GET QFlags parameter indicates that the image is bottom up and the coordinates offsets will be applied accordingly.

RectWidth

Parameter is used with SF_SUBCODE_GET_RECTANGLE (11) , SF_SUBCODE_DETECT_BLANK_RECTANGLE (14), and SF_SUBCODE_REMOVE_COMBS (23). Set to the area width in pixels and value must be greater than 0.

RectHeight

Parameter is used with SF_SUBCODE_GET_RECTANGLE (11) , SF_SUBCODE_DETECT_BLANK_RECTANGLE (14), and SF_SUBCODE_REMOVE_COMBS (23). Set to the area height in pixels and value must be greater than 0.

ReservedA

ReservedB

ReservedC

ReservedD

ReservedE

ReservedF

ReservedG

ReservedH

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

u

A union containing structure with subcode-specific parameters and return values. Each structure is defined in the remainder of this section.

u.SC0

A structure containing values returned by SF_SUBCODE_DETECT_SKEW (0).

Name Description

u.SC0.DetectedHorizontalAngle

The amount of rotation (in degrees counter-clockwise) needed to correct the skew of horizontal lines will be placed in this value after a successful completion of the REQ_EXEC portion of the OP_SCANFIX operation. The value will range from -20 to +20.

u.SC0.DetectedVerticalAngle

The amount of rotation (in degrees counter-clockwise) needed to correct the skew of vertical lines will be placed in this value after a successful completion of the REQ_EXEC portion of the OP_SCANFIX operation. The value will range from -20 to +20.

u.SC0.DetectedVariation

The amount of skew variation will be placed in this value after a successful completion of the REQ_EXEC portion of the OP_SCANFIX operation. The value will range from 0 to 100 with 0 indicating that the detected skew was very uniform across the image and 100 indicating that the detected skew varied substantially from place to place on the image. The operation produces this value in order to assist in manual analysis of low confidence images. If the value is high, indicating that there may be no single correct skew, the operation will automatically reduce Confidence.

u.SC1

A structure containing parameters used by SF_SUBCODE_DESPECKLE (1).

Name Description

u.SC1.SpeckWidth

This parameter controls the maximum width, in pixels, of black specks that will be removed from the image. Any black object wider than this value will remain after the image has been processed. The value must be between 1 and 100 inclusive.

u.SC1.SpeckHeight

This parameter controls the maximum height, in pixels, of black specks that will be removed from the image. Any black object taller than this value will remain after the image has been processed. The value must be between 1 and 100 inclusive.

u.SC2

A structure containing parameters used by SF_SUBCODE_REMOVE_LINES (2).

Name Description

u.SC2.HorizontalLine.MinimumAspectRatio

u.SC2.VerticalLine.MinimumAspectRatio

These parameters control the minimum aspect ratio of lines that will be removed from the image. The aspect ratio of a line is the length, in pixels, divided by the thickness, in pixels. Any lines whose aspect ratio is less than this value will remain after the image has been processed. The value must be a floating point value between 1.0 and 1000.0 inclusive.

u.SC2.HorizontalLine.MinimumLength

u.SC2.VerticalLine.MinimumLength

These parameters control the minimum length, in pixels, of lines that will be removed from the image. Any lines whose length is less than this value will remain after the image has been processed. The value must be between 10 and 20,000 inclusive.

u.SC2.HorizontalLine.MaximumThickness

u.SC2.VerticalLine.MaximumThickness

These parameters control the maximum thickness, in pixels, of lines that will be removed from the image. Any lines whose thickness is larger than this value will remain after the image has been processed. The value must be between 1 and 50 inclusive.

u.SC2.HorizontalLine.MaximumGap

u.SC2.VerticalLine.MaximumGap

These parameters control the largest allowable gap, in pixels, of lines that will be removed from the image. A gap larger than this value will cause a line to be treated as two (or more) separate lines, each of which must meet the criteria specified for line removal. In particular, if any segment of the broken line is less than the minimum length, it will remain after the image has been processed. The value must be between 0 and 20 inclusive.

u.SC2.HorizontalLine.MaximumCharacterRepairSize

u.SC2.VerticalLine.MaximumCharacterRepairSize

These parameters control the maximum width and height, in pixels, of intersecting objects that will be restored after the line has been removed. The value must be between 0 and 100 inclusive.

u.SC2.HorizontalLine.EdgeCleaning

u.SC2.VerticalLine.EdgeCleaning

These parameters control the maximum distance, in pixels, to search for and remove noise near a line that has been removed. The value must be between 0 and 100 inclusive.

u.SC3

A structure containing parameters used by SF_SUBCODE_ROTATE (3).

Name Description

u.SC3.HorizontalRotationAngle

This parameter controls the amount of rotation, in degrees counter-clockwise, applied to horizontal lines. The value must be between -360 and +360 inclusive. For a typical rotation, this should be set to the same value as u.SC3.VerticalRotationAngle. Setting it to a different value will introduce some amount of shear to the rotation. The difference between this value and u.SC3.VerticalRotationAngle must be no more than 70 degrees.

u.SC3.VerticalRotationAngle

This parameter controls the amount of rotation, in degrees counter-clockwise, applied to vertical lines. The value must be between -360 and +360 inclusive. For a typical rotation, this should be set to the same value as u.SC3.HorizontalRotationAngle. Setting it to a different value will introduce some amount of shear to the rotation. The difference between this value and u.SC3.HorizontalRotationAngle must be no more than 70 degrees.

u.SC3.MaintainOriginalSize

This parameter controls the size of the rotated image. If it is TRUE, the rotated image will be the same size of the original image. Typically, that will cause portions of each corner to be clipped. If it is FALSE, the rotated image will be the smallest possible size which can still contain every pixel from the original image. Typically, the rotated image will be larger than the original. In both cases, the center of the original image will be placed in the center of the rotated image.

u.SC7

u.SC8

u.SC9

u.SC10

Structures containing parameters used by SF_SUBCODE_DILATE (7), SF_SUBCODE_ERODE (8), SF_SUBCODE_DIAGONAL_DILATE (9), and SF_SUBCODE_DIAGONAL_ERODE (10).

Name Description

u.SC7.AmountOfEffectLeft

u.SC8.AmountOfEffectLeft

u.SC9.AmountOfEffectLeft

u.SC10.AmountOfEffectLeft

This parameter controls the extension (dilation) or reduction (erosion) applied to the left side of all black objects in the image. For SF_SUBCODE_DIAGONAL_DILATE (9) and SF_SUBCODE_DIAGONAL_ERODE (10), only two directions can be set to a non-zero value. One of those two directions must be horizontal and the other must be vertical. In addition, they must be set to the same values. The value must be between 0 and 500 inclusive.

u.SC7.AmountOfEffectRight

u.SC8.AmountOfEffectRight

u.SC9.AmountOfEffectRight

u.SC10.AmountOfEffectRight

This parameter controls the extension (dilation) or reduction (erosion) applied to the right side of all black objects in the image. For SF_SUBCODE_DIAGONAL_DILATE (9) and SF_SUBCODE_DIAGONAL_ERODE (10), only two directions can be set to a non-zero value. One of those two directions must be horizontal and the other must be vertical. In addition, they must be set to the same values. The value must be between 0 and 500 inclusive.

u.SC7.AmountOfEffectUp

u.SC8.AmountOfEffectUp

u.SC9.AmountOfEffectUp

u.SC10.AmountOfEffectUp

This parameter controls the extension (dilation) or reduction (erosion) applied to the top edge of all black objects in the image. For SF_SUBCODE_DIAGONAL_DILATE (9) and SF_SUBCODE_DIAGONAL_ERODE (10), only two directions can be set to a non-zero value. One of those two directions must be horizontal and the other must be vertical. In addition, they must be set to the same values. The value must be between 0 and 500 inclusive.

u.SC7.AmountOfEffectDown

u.SC8.AmountOfEffectDown

u.SC9.AmountOfEffectDown

u.SC10.AmountOfEffectDown

This parameter controls the extension (dilation) or reduction (erosion) applied to the bottom edge of all black objects in the image. For SF_SUBCODE_DIAGONAL_DILATE (9) and SF_SUBCODE_DIAGONAL_ERODE (10), only two directions can be set to a non-zero value. One of those two directions must be horizontal and the other must be vertical. In addition, they must be set to the same values. The value must be between 0 and 500 inclusive.

u.SC13

A structure containing parameters used by SF_SUBCODE_DETECT_BLANK_PAGE (13).

Name Description

u.SC13.MarginTop

This parameter sets the distance from the top edge, in pixels, of the region of interest.  Only the given region will be examined for data.  If the entire image is to be processed, set this to 0.

u.SC13.MarginBottom

This parameter sets the distance from the bottom edge, in pixels, of the region of interest.  Only the given region will be examined for data.  If the entire image is to be processed, set this to 0.

u.SC13.MarginLeft

This parameter sets the distance from the left edge, in pixels, of the region of interest.  Only the given region will be examined for data.  If the entire image is to be processed, set this to 0.

u.SC13.MarginRight

This parameter sets the distance from the right edge, in pixels, of the region of interest.  Only the given region will be examined for data.  If the entire image is to be processed, set this to 0.

u.SC13.BlankDetectMinContrast

This parameter indicates the minimum level of contrast (on a scale of 1 to 255) between the background and foreground for color and gray images.  This parameter is ignored for bitonal images.

u.SC13.BlankDetectMinObjectDimension

This parameter controls the minimum size (width or height) of an object group that is to be considered data.

u.SC13.BlankDetectGapFill

This parameter controls the amount of allowable space between adjacent objects for them to be considered a group.

u.SC13.BlankDetectIgnoreBorder

invokes a simple, fast border detection function.  If a border is found, then the margins are measured from the border.  This function only detects clean borders, and will fail on noisy borders.  For noisy borders, a dedicated border detection or cropping method should be used before invoking blank page detection.

u.SC14

A structure containing parameters used by SF_SUBCODE_DETECT_BLANK_RECTANGLE (14).

Name Description

u.SC14.BlankDetectMinContrast

This parameter indicates the minimum level of contrast (on a scale of 1 to 255) between the background and foreground for color and gray images.  This parameter is ignored for bitonal images.

u.SC14.BlankDetectMinObjectDimension

This parameter is the minimum size (width or height) of an object group that is to be considered data.

u.SC14.BlankDetectGapFill

This parameter is the amount of allowable space between adjacent objects for them to be considered a group.

u.SC14.BlankDetectIgnoreBorder

This parameter controls a fast, simple border detection function. If a border is found, the RectX and RectY values will be shifted by the top and left portions of the detected border. If the shifted rectangle overlaps the left and/or bottom border, then the width and height will be clipped to fit in the borders. This function only detects clean borders, and will fail on noisy borders. For noisy borders, a dedicated border detection or cropping method should be used before involving blank page detection.

u.SC14.BlankDetectIsBlank

This parameter is set, during REQ_EXEC, to true (1) or false (0) based on whether any objects over the size threshold were found in the given region.

u.SC15

A structure containing parameters used by SF_SUBCODE_REMOVE_BLOBS (15).

Name Description

u.SC15.MinimumPixelCount

This parameter is set to the minimum number of pixels an object must contain to be considered for removal.

u.SC15.MaximumPixelCount

This parameter is set to the maximum number of pixels an object must contain to be considered for removal.

u.SC15.MinimumDensity

This parameter is set to the minimum density, as a percentile in the range [0 - 100], that an object must have to be removed. The density is defined as the number of black pixels in the object divided by the area of the convex hull of the object. Solid convex objects such as circles and squares will have densities approaching 100 (with some variation due to rounding in the hull calculation), while hollow or concave objects like the letters "O" and "C" will have low densities.

u.SC16

A structure containing parameters used by SF_SUBCODE_SCALE (16).

Name Description

u.SC16.HorizontalMagnification

This parameter controls the amount of horizontal magnification applied. Values above 1.0 will increase the width of the image, while values between 0.0 and 1.0 will reduce the size of the image. The new width will be equal to the original width, multiplied by this parameter. Valid values are floating point numbers between 0.0001 and 10,000 inclusive.

u.SC16.VerticalMagnification

This parameter controls the amount of vertical magnification applied. Values above 1.0 will increase the height of the image, while values between 0.0 and 1.0 will reduce the size of the image. The new height will be equal to the original height, multiplied by this parameter. Valid values are floating point numbers between 0.0001 and 10,000 inclusive.

u.SC17

A structure containing parameters used by SF_SUBCODE_REMOVE_DOT_SHADING (17).

Name Description

u.SC17.MinimumAreaWidth

This parameter controls the width of the smallest dot-shaded area that the opcode processes. Valid values are from 0 to 20,000, with 100 being a good default value.

u.SC17.MinimumAreaHeight

This parameter controls the height of the smallest dot-shaded area that the opcode processes. Valid values are from 0 to 20,000, with 50 being a good default value.

u.SC17.VerticalSizeAdjustment

This parameter controls the vertical component of the dot shading removal feature. Set to 1 if some tall dots survive the Dot-Shading Removal process; this causes the dot removal feature to remove dots 1 pixel taller than the size specified in SC17.MaximumDotSize. Set to -1 or -2, if text is being degraded (leaving vertical white streaks). Valid values are from -100 to +100, with 0 being a good default.

u.SC17.HorizontalSizeAdjustment

This parameter controls the horizontal component of the dot shading removal feature. Set to 1 if some wide dots survive the Dot-Shading Removal process; this causes the dot removal feature to remove dots 1 pixel wider than the size specified in u.SC17.MaximumDotSize. Set to -1 or -2, if text is being degraded (leaving horizontal white streaks). Valid values are from -100 to +100, with 0 being a good default.

u.SC17.DensityAdjustment

This parameter controls the expected density of shaded areas. Negative numbers instruct the opcode to search for shaded areas with more white pixels than black pixels and positive numbers instruct the opcode to search for shaded areas with more black pixels than white ones. Valid values are -50 to +50, with 0 being a good default and values from -5 to +5 covering nearly all typical cases.

u.SC17.MaximumDotSize

This parameter controls the maximum size of individual dots that make up the dot shading. Dots up to, and including, this size are removed. Valid values are from 0 to 20, with 5 being a good default.

u.SC17.MaximumVerificationHeight

This parameter controls the maximum height of shaded areas that will be double-checked for proper detection. Double-checking zones will cause detection to run slower. Valid values are from 0 to 20,000, with 20,000 being a good default.

u.SC18

A structure containing parameters used by SF_SUBCODE_CORRECT_INVERSE_TEXT (18).

Name Description

u.SC18.MinimumAreaWidth

This parameter controls the height of the smallest inverse area that the opcode processes. Valid values are from 0 to 20,000, with 50 being a good default value.

u.SC18.MinimumAreaHeight

This parameter controls the width of the smallest inverse area that the opcode processes. Valid values are from 0 to 20,000, with 300 being a good default value.

u.SC18.MinimumBlackOnEdges

This parameter controls the smallest horizontal distance between the edges of an inverse text zone and the inverse text itself. Use a lower value if inverse zones are missed. Use a higher value if normal text is being treated as inverse. Valid values are from 0 to 100, with 10 being a good default.

u.SC18.Density

This parameter controls the maximum number of white pixels per 100 black pixels within a given area. Valid values are from 0 to 20,000, with 200 being a good default. You should use a higher value to detect lighter zones.

u.SC19

A structure containing parameters used by SF_SUBCODE_SMOOTH_OBJECTS (19).

Name Description

u.SC19.Amount

This parameter controls the amount of smoothing. Valid values are 1 to 1000, with 3 being a good default.

u.SC20

A structure containing parameters used by SF_SUBCODE_DETECT_NEGATIVE_PAGE (20).

Name Description

u.SC20.ImageIsNormal

The opcode will place its decision in this value. TRUE will indicate that the image is 'normal' (background is white and foreground is black). FALSE will indicate that the image is inverted (background is black and foreground is white.)

u.SC21

A structure containing parameters used by SF_SUBCODE_REMOVE_BORDER (21).

Name Description

u.SC21.BorderSpeckSize

This parameter controls the width or height, in pixels, of specks that reside within the border. Valid values range from 0 to 20. A good default value is 3.

u.SC21.PageSpeckSize

This parameter controls the width or height, in pixels, of specks that reside within the border. Valid values range from 0 to 20. A good default value is 3.

u.SC21.MinimumPageWidth

This parameter controls the minimum expected width, in pixels, of the page. Valid values range from 0 to 2,147,483,647. If the width of the page is unknown, this value should be set to 0. If no page can be found of the expected size, the detected page may lie outside the specified size. Typically, the confidence will be low in that case.

u.SC21.MaximumPageWidth

This parameter controls the maximum expected width, in pixels, of the page. Valid values range from 0 to 2,147,483,647. If the width of the page is unknown, this value should be set to 2,147,483,647. If no page can be found of the expected size, the detected page may lie outside the specified size. Typically, the confidence will be low in that case.

u.SC21.MinimumPageHeight

This parameter controls the minimum expected height, in pixels, of the page. Valid values range from 0 to 2,147,483,647. If the height of the page is unknown, this value should be set to 0. If no page can be found of the expected size, the detected page may lie outside the specified size. Typically, the confidence will be low in that case.

u.SC21.MaximumPageHeight

This parameter controls the maximum expected height, in pixels, of the page. Valid values range from 0 to 2,147,483,647. If the height of the page is unknown, this value should be set to 2,147,483,647. If no page can be found of the expected size, the detected page may lie outside the specified size. Typically, the confidence will be low in that case.

u.SC21.DetectedHorizontalAngle

During REQ_INIT, the opcode will set this value to the amount of rotation (in degrees counter-clockwise) needed to correct the skew of horizontal lines in the image. Generally, this will be identical to, or nearly identical to u.SC21.DetectedVerticalAngle. This value will always be in the range -20 to +20 inclusive.

u.SC21.DetectedVerticalAngle

During REQ_INIT, the opcode will set this value to the amount of rotation (in degrees counter-clockwise) needed to correct the skew of vertical lines in the image. Generally, this will be identical to, or nearly identical to u.SC21.DetectedHorizontalAngle. This value will always be in the range -20 to +20 inclusive.

u.SC21.PageX

During REQ_INIT, the opcode will set this value to the X coordinate of the top left corner of the detected page. This value will usually be between 0 and the width of the input image, in pixels. In rare cases, this value may be negative, indicating that the page was clipped during scanning.

u.SC21.PageY

During REQ_INIT, the opcode will set this value to the Y coordinate of the top left corner of the detected page. This value will usually be between 0 and the height of the input image, in pixels. In rare cases, this value may be negative, indicating that the page was clipped during scanning.

u.SC21.PageWidth

During REQ_INIT, the opcode will set this value to the width of the detected page. This value will be between 0 and the width of the input image.

u.SC21.PageHeight

During REQ_INIT, the opcode will set this value to the height of the detected page. This value will be between 0 and the height of the input image.

u.SC21.AmountToExpandPage

This parameter controls the number of pixels to expand each of the four page edges. If this value is set to a negative value, additional pixels will be removed from the image. This value should have a small positive value if some part of the border is desired in the output image. Valid values range from -1000 to 1000, with zero being a good default. In some situations, it is important that the output image have some small visual indication of the location of a border that was removed. For those situations, this value can be set to a small positive value, such as 10. In other situations, it is important that all sign of the border be removed. For those situations, this value can be set to a small negative value, such as -5. Note that this value must be set before REQ_INIT so the size of the output image can be determined.

u.SC21.DeskewBorder

This parameter controls part of the method used to remove the border. It must be set to true to indicate that the image should be deskewed (based on the angle of the detected border.) Valid values are true and false.

u.SC21.ReplaceBorder

This parameter controls part of the method used to remove the border. It must be set to true to indicate that border pixels (which remain in the output image) should be replaced with pixels that match PadColor. Valid values are true and false.

u.SC21.RemoveBorder

This parameter controls part of the method used to remove the border. It must be set to true to indicate that border pixels should be removed from the output image. Since pages are rarely perfectly rectangular, some border pixels will usually remain after the border is removed.

u.SC23

A structure containing parameters used by SF_SUBCODE_REMOVE_COMBS (23).

Name Description

u.SC23.MinimumCombLength

This parameter is set to a value that indicates the minimum length of an individual comb, in pixels. Combs smaller than this length will not be removed. Valid values are 10 to 2,147,483,647, with the best value being a little lower than the length of the smallest comb present in an actual document.

u.SC23.CombHeight

This parameter is set to the typical height of a comb, in pixels. Valid values are from 4 to 1000, with the best value being the average height of a comb (measured from the top of the horizontal line to the top of the vertical line.)

u.SC23.CombSpacing

This parameter is set to the typical spacing, in pixels, between the vertical marks that comprise a comb. Valid values are from 10 to 1000, with the best value being the average distance between adjacent vertical marks of a comb.

u.SC23.HorizontalLineThickness

This parameter is set to the typical thickness, in pixels, of the horizontal portion of a comb. Valid values are from 1 to 20 , with 5 being a good default.

u.SC23.VerticalLineThickness

This parameter is set to the typical thickness, in pixels, of the vertical marks of a comb. Valid values are from 1 to 20 , with 5 being a good default value.

u.SC23.MinimumConfidence

This parameter is set to the minimum confidence for an individual comb. Internally, the opcode computes a confidence for each comb. Combs with confidences equal to or above this value will be removed, while combs with confidences below this value will remain. Valid values are from 1 to100, with 100 being a good default value.

u.SC24

A structure containing parameters used by SF_SUBCODE_REGISTER (24).

Name

Description

u.SC24.HorizontalRegister.FeedbackLinesRemoved

u.SC24.VerticalRegister.FeedbackLinesRemoved

This is an output value indicating the number of lines to be removed in horizontal or vertical registration. This value may be positive or negative; positive vales indicate that the image was cropped while negative values indicate the margin was extended. Possible use of the add-only option (see AddOnly below) is ignored; thus if this value is positive and the Add-Only option in invoked then the associated horizontal or vertical margin is actually unchanged.

u.SC24.HorizontalRegister.Active

u.SC24.VerticalRegister.Active

Set this value to true if you want to horizontally/vertically register the image. This feature automatically positions text horizontally and/or vertically on the page, providing a consistent left and/or top margin for documents. Registration control is helpful for Document Imaging and Forms Processing applications where accurate positioning is critical, since it makes OCR zoning of text fields in forms much more reliable. At least one of these values must be true if the subcode value is 24 or error condition ERR_BAD_REG_ACTIVE.

For vertical registration, the topmost edge of the text is located, and positioned a fixed distance from the top edge of the image. For horizontal registration, the leftmost edge of the text is located, and positioned a fixed distance from the left edge of the image.

When using registration, we recommend that you first deskew the image, unless you know the original is perfectly straight. We recommend you set both VerticalRegister.Active and HorizontalRegister.Active when you are preparing an image for processing.

You can activate and set the parameters for horizontal and vertical registration separately. For most operations where you require a consistent left margin, you should activate horizontal registration. In many cases, you can leave vertical registration deactivated. For applications where precise text location is important, both horizontal and vertical registration should be activated.

u.SC24.HorizontalRegister.ResultantMargin

u.SC24.VerticalRegister.ResultantMargin

This parameter determines how many pixels will remain as a left or top margin after processing. Setting this value to 0 places text flush with the left or top edge of the image. A negative value crops the specified number of pixels from the left or top edge of the text. Valid values are -20000 (minimum) to +20000 (max).

u.SC24.HorizontalRegister.SkipActive

u.SC24.VerticalRegister.SkipActive

Setting this value to true lets you skip a set number of rows or columns of the image before the opcode starts looking for valid information for registration. You can set and activate horizontal and vertical values separately.

The skip feature is particularly valuable for dealing with unwanted data on the edge of an image. In some cases, you may want to skip over a form line or margin note that the opcode "sees" as valid data. In other cases, this feature can be useful to skip over scanner artifacts that look like lines or data. Valid values are true or false.

u.SC24.HorizontalRegister.SkipDistance

u.SC24.VerticalRegister.SkipDistance

This value lets you skip a set number of scan lines before the opcode starts looking for valid information for registration. You can set and activate horizontal and vertical values separately.

The skip feature is particularly valuable for dealing with unwanted data on the edge of an image. In some cases, you may want to skip over a form line or margin note that the opcode "sees" as valid data. In other cases, this feature can be useful to skip over scanner artifacts that look like lines or data. Valid values are 0 (minimum) to 20000 (max).

u.SC24.HorizontalRegister.MinBackground

u.SC24.VerticalRegister.MinBackground

The ScanFix opcode looks at white space (gaps between black pixels) to decide how dense and consistent image data actually is. This option sets the level of consistency the opcode considers edge noise. A recommended default value is 5. A higher value can cause the opcode to treat valid data as edge noise. A lower value can cause the opcode to treat edge noise as valid data. Valid values are 2 (minimum) to 1000 (max).

u.SC24.HorizontalRegister.MinForeground

u.SC24.VerticalRegister.MinForeground

This option controls how much activity the opcode needs to see to consider it valid data. A recommended default value is 5. Individual characters are usually about 20 pixels wide, so values around 20 (on a 300 dpi image) often work well, consistently ignoring perpendicular lines. Lower values make the opcode more likely to register to edge noise. You may need to use values as low as 1 when you are dealing with dot matrix print. Valid values are 1 (minimum) to 1000 (max).

u.SC24.HorizontalRegister.MinActivity

u.SC24.VerticalRegister.MinActivity

This option controls how intense the activity has to be for the opcode to consider it real activity. A recommended default value for this option is 3. Setting this value higher can improve performance when you find the program registering to edge noise. Valid values are 1 (minimum) to 1000 (max).

u.SC24.HorizontalRegister.CentralFocus

u.SC24.VerticalRegister.CentralFocus

This feature causes the opcode to register using only the middle portion of the image border. CentralFocus is useful for ignoring edge noise, letterheads, and logos. Valid values are true or false. HorizontalRegister.CentralFocus has no effect in conjunction with HorizontalRegister.ToLineActive. VerticalRegister.CentralFocus has no effect in conjunction with VerticalRegister.ToLineActive.

u.SC24.HorizontalRegister.AddOnly

u.SC24.VerticalRegister.AddOnly

If set to true, this value causes the new margin value to be the larger of the existing margin size and the new value specified by the ResultantMargin parameter.In no case will the margin be reduced in size. Valid values are true or false.

u.SC24.HorizontalRegister.IgnoreHoles

Activating this feature causes the opcode to ignore binder holes and other left-edge noise when analyzing the margin. Leave this feature off unless you have holes or similar noise to avoid. This feature applies only to horizontal registration. Valid values are true or false.

u.SC24.VerticalRegister.IgnoreHoles

This parameter has no effect in the current version. It should be set to zero for compatibility with future versions.

u.SC24.HorizontalRegister.ToLineActive

u.SC24.VerticalRegister.ToLineActive

This is a powerful feature for precise registration on forms, especially on forms with edge noise. Instead of using what it believes to be the edge of the text, the opcode will position the text in the image based on the position of a vertical line (for horizontal registration) or a horizontal line (for vertical registration). This line should be significantly larger than any text characters (in particular, those characters to the left of this line). If no vertical/horizontal line is detected, the left/top margin will be unchanged. Valid values are true or false.

u.SC24.HorizontalRegister.ToLineCheckThinLinesActive

u.SC24.VerticalRegister.ToLineCheckThinLinesActive

Set this property to TRUE if the line you wish to register to is very thin (1 or 2 pixels). Valid values are true or false. This parameter has no effect unless HorizontalRegister.ToLineActive or VerticalRegister.ToLineActive, respectively, is set.

u.SC24.HorizontalRegister.ToLineMaxLineGap

u.SC24.VerticalRegister.ToLineMaxLineGap

This property lets you invoke the Super-Line technology with the ToLine registration feature. With a value less than or equal to 3 the opcode simply ignores short gaps. However, setting this value over 3 tells the opcode to employ its Super-Line algorithms. These algorithms re-assemble broken lines into a whole line for registration purposes, and can dramatically improve the success rate with the ToLine registration feature. Valid values are 0 (minimum) to 50 (max).

u.SC24.HorizontalRegister.ToLineMaxLineThickness

u.SC24.VerticalRegister.ToLineMaxLineThickness

The opcode scans across or down your image looking for lines. In some cases, especially with the Super-Line technology active, the opcode can mistake dense text for a line. This parameter lets you select the maximum thickness to consider when registering to a vertical line so you can set the maximum line thickness lower than the width of your text. You can activate and set the horizontal and vertical values separately. Valid values are 0 (minimum) to 100 (max). A recommended default value is 22.

u.SC24.HorizontalRegister.ToLineMinLineLength

u.SC24.VerticalRegister.ToLineMinLineLength

Set this parameter to a value larger than the height of characters but less than the length of the line. The opcode will examine the image from left to right until it locates a vertical/horizontal line segment larger than the specified value or until it reaches one quarter the image width. It then shifts the image so that the line is the distance from the left edge of the image as specified by the value of ResultantMargin. Valid values are 0 (minimum) to 20000 (max). A recommended default value is 300.

u.SC24.HorizontalRegister.Reserved1

u.SC24.VerticalRegister.Reserved1

These parameters have no effect in the current version and should be set to zero for compatibility with future versions.

u.SC26

A structure containing parameters used by SF_SUBCODE_CORRECT_CONTRAST (26).

Name Description

u.SC26.TargetBrightness 

The target brightness of the image background, expressed in the range of 0 to 255, with 255 being the brightest.

u.SC26.TargetContrast

The target contrast between foreground and background of the image, expressed as a range of 1 to 255

u.SC26.TargetVariance

The largest possible variance in brightness across the image, expressed as a range from 0 to 255

u.SC26.Correction

The Method of correction to use; may be SCANFIX_NO_FIX_CONTRAST, SCANFIX_AUTO_CONTRAST, SCANFIX_FORCE_ADAPTIVE_CONTRAST, or SCANFIX_FORCE_GLOBAL_CONTRAST.

u.SC26.MinPercentile

The image percentile that will be forced to black.  Range from -1 (no negative change) to MaxPercentile.

u.SC26.MaxPercentile

The image percentile that will be forced to white.  Range from MinPercentile to 101 (no positive change)

u.SC26.ContrastLimitDark

u.SC26.ContrastLimitMid

u.SC26.ContrastLimitLight

The maximum amount of change that will be allowed for a pixel of a certain range of brightness.  A value of 1 means the brightness of a pixel may only be changed by 1 out of 255.  Large values may distort the image severely, while small values may result in less than the desired enhancement.  Limits are set for dark, midrange, and light pixels, and interpolated smoothly to provide limits for each level of brightness.

u.SC26.AverageBackground

Returns the average brightness of the image background.

u.SC26.BackgroundVariance 

Returns the variance in background brightness across the image.

u.SC26.NoiseRadius 

Returns the average amount of brightness variation within the background.

u.SC26.AverageContrast 

Returns the average contrast between the background and foreground.

u.SC26.Method

Returns the suggested method of correction:  valid values may be SCANFIX_OK_CONTRAST, indicating no change is needed; _SCANFIX BAD_CONTRAST indicates that the image has insufficient contrast-to-noise to enhance; SCANFIX_ADAPTIVE_CONTRAST indicates that the adaptive correction should be used; SCANFIX_GLOBAL_CONTRAST indicates that the global correction should be used.

u.SC26.PercentileGraph

This returns the percentile graph for the overall image.  There are 101 values, each in the range of [0 - 255] and representing the brightness of the pixels at percentiles 0 (darkest pixel sampled) through 100 (brightest pixel sampled). 

u.SC29

A structure containing parameters used by SF_SUBCODE_COLORDROP (29).

Name Description

u.SC29.ColorCount 

The number of colors in the drop list.

u.SC29.DropToColor 

The RGB value to which the selected colors will be changed.

u.SC29.Extract 

Set to true to extract the specified colors, and drop all other colors to the DropToColor.

u.SC29.ColorList 

A pointer to an array of RGB values and radii indicating all the regions of color to be used.

u.SC30

A structure containing parameters used by SF_SUBCODE_FILTER (30).

Name Description

u.SC30.Type

Specifies the type of filter to use.  Valid values are the following types:  SCANFIX_FILTER_GAUSSIAN, SCANFIX_FILTER_UNSHARP, SCANFIX_FILTER_MEDIAN, SCANFIX_FILTER_DILATE, SCANFIX_FILTER_ERODE, SCANFIX_FILTER_OPEN, SCANFIX_FILTER_CLOSE, SCANFIX_FILTER_AVERAGE, SCANFIX_FILTER_USER, SCANFIX_FILTER_GAUSSIAN3X3, SCANFIX_FILTER_GAUSSIAN5X5, SCANFIX_FILTER_LAPLACIAN3X3, SCANFIX_FILTER_PREWITTV3X3, SCANFIX_FILTER_PREWITTH3X3, SCANFIX_FILTER_SOBELV3X3, SCANFIX_FILTER_SOBLEH3X3.  Filters with a 3X3 or 5X5 in the name are fixed size filters, and a width, height, and center point are not needed and will be ignored.  Other filters require a width and height, except the SCANFIX_FILTER_USER, which requires all parameters be set.  The user defined filter is a convolution filter, and it requires that the Weights parameter point to an array of values containing the weights to be used in the convolution.

u.SC30.Width 

The width of the filter, required for non-fixed size filters.

u.SC30.Height 

The height of the filter, required for non-fixed size filters.

u.SC30.CenterX 

The center point of the filter, required for variable size and user defined filters.  Set to -1 to automatically set to the center (width / 2).

u.SC30.CenterY 

The center point of the filter, required for variable size and user defined filters.  Set to -1 to automatically set to the center (height / 2).

u.SC30.Divisor 

The divisor used by the user defined filter.  This weighted sum of the filtered pixels is divided by this divisor.

u.SC30.Offset 

The offset added to the output of the convolution, used to bias the result up or down.

u.SC30.Weights 

The matrix of weights used in the user defined filter.  The size of the array should be Width * Height, and the values are stored left to right, top to bottom.

u.SC31

A structure containing parameters used by SF_SUBCODE_IMAGEDETERGENT (31).

Name Description

u.SC31.ColorCount 

The number of colors to be cleaned.

u.SC31.Automatic 

Set to true if colors are to be selected automatically.  The dominant colors of the image, up to the number selected in ColorCount, will be chosen and cleaned.

u.SC31.ColorList 

If Automatic is false, this should contain ColorCount color region entries.

u.SC32

A structure containing parameters used by SF_SUBCODE_VIRTUALBULB (32).

Name Description

u.SC32.HueCount 

The number of hues to drop.

u.SC32.Extract 

Set true when the given hues are to be extracted instead of dropped.

u.SC32.HueList 

A pointer to a list of HueCount hues.

u.SC33

A structure containing parameters used by SF_SUBCODE_DETECT_COLOR (33).

Name Description

u.SC33.IgnorePaperColor 

Set true to indicate that a colored background should be considered 'not color'.

u.SC33.MinimumBrightness

A value in the range of 0 to 255 indicating the minimum brightness ('V' in the HSV colorspace) required for a pixel to be considered 'color'.

u.SC33.MinimumSaturation

A value in the range of 0 to 255 indicating the minimum saturation required for a pixel to be considered 'color'.

u.SC33.MinimumSize

The minimum size, length and width, required for a saturated object to be considered colored data.

u.SC33.Sensitivity

A value from 0 to 100 indicating how many saturated objects are required for a high confidence 'is color' result.

u.SC33.GenerateBoxes

Set true to generate bounding boxes for all saturated objects over the minimum size.

u.SC33.BoxOverlap 

The percentage of area (of the smaller box) that must intersect before bounding boxes are merged.

u.SC33.Reason

A bit field set with flags indicating why the image was determined to be 'color' or 'not color'.

u.SC33.IsColor

Returns the true if the image is determined to be 'color'.

u.SC33.BoxCount 

The number of bounding boxes returned.

u.SC33.BoxCoords

A pointer to a list of values representing the bounding boxes; organized as (x, y, width, height, ...).

u.SC33.BigObjects

Returns the weighted count of colored objects over the minimum size found in the image.

u.SC33.SmallObjects

Returns the weighted count of objects near, but less than, the minimum size found in the object.

u.SC33.AverageSaturation

Returns the saturation of the average image color.

u.SC52

A structure containing parameters used by SF_SUBCODE_AUTO_CORRECT_CONTRAST (52).

Name Description

u.SC52.MethodUsed

Returns the method of correction used:  values may be SCANFIX_OK_CONTRAST, indicating no change was needed; _SCANFIX BAD_CONTRAST indicates that the image has insufficient contrast-to-noise to enhance; SCANFIX_ADAPTIVE_CONTRAST indicates that the adaptive correction was used; SCANFIX_GLOBAL_CONTRAST indicates that the global correction was used.

u.SC52.MinPercentileUsed

The image percentile that was forced to black.  Range from -1 (no negative change) to MaxPercentile.

u.SC52.MaxPercentileUsed

The image percentile that was forced to white.  Range from MinPercentile to 101 (no positive change)

u.SC52.ContrastLimitDarkUsed

u.SC52.ContrastLimitMidUsed

u.SC52.ContrastLimitLightUsed

The maximum amount of change that was allowed for a pixel of a certain range of brightness.  Limits are set for dark, midrange, and light pixels, and interpolated smoothly to provide limits for each level of brightness.

u.SC52.AverageBackground

Returns the average brightness of the image background.

u.SC52.BackgroundVariance 

Returns the variance in background brightness across the image.

u.SC52.NoiseRadius 

Returns the average amount of brightness variation within the background.

u.SC52.AverageContrast 

Returns the average contrast between the background and foreground.

u.SC52.PercentileGraph

This returns the percentile graph for the overall image.  There are 101 values, each in the range of [0 - 255] and representing the brightness of the pixels at percentiles 0 (darkest pixel sampled) through 100 (brightest pixel sampled).

u.SC53

A structure containing parameters used by SF_SUBCODE_AUTO_REMOVE_HOLEPUNCHES (53).

Name Description

u.SC53.PunchLocation

This returns the list of detected hole punch locations in the form of bounding boxes.

u.SC53.PunchConfidence

This returns the list of confidence values of detected hole punches.

u.SC54

A structure containing parameters used by SF_SUBCODE_AUTO_CORRECT_INVERSE_TEXT (54).

Name Description

u.SC54.PerformCorrection

Controls whether inverse regions a just identified or identified and corrected.  Set to TRUE to correct identified regions.

u.SC54.InverseRegions

Returns the list of detected inverse regions.

u.SC58

A structure containing parameters used by SF_SUBCODE_AUTO_ORIENT_DETECT (58).

Name Description

u.SC58.DegreesToRotate

Number of degrees image should be rotated counterclockwise to be right-side up.

u.SC58.DisallowSideways

Force result of Auto-detect orientation operation to be a multiple of 180 degrees.

  

 
Copy Code
typedef struct {
   LONG                 Subcode;
   BOOL                 Stop;            
   union {
      LineReportData    LineData;
      CombReportData    CombData;
      BlobReportData    BlobData;
   } u;
} ScanFixReportData;
 
Copy Code
typedef struct  {
   LONG         X;                
   LONG         Y;
   LONG         Length;           
   LONG         Thickness;        
   LONG         Orientation;      
   BOOL         DeleteLine;       
} LineReportData;
 
Copy Code
typedef struct  {
   LONG         X;                
   LONG         Y;                
   LONG         Width;            
   LONG         Height;           
   LONG         Spacing;          
   LONG         Teeth;                                          
   LONG         Confidence;       
   BOOL         DeleteComb;       
} CombReportData;
 
Copy Code
typedef struct  {
   LONG         X;                
   LONG         Y;          
   LONG         Width;            
   LONG         Height;           
   LONG         Density;          
   LONG         Pixels;           
   LONG         PointCount;       
   SFPoint      *ConvexHull;      
   BOOL         DeleteBlob;       
} BlobReportData;
 
Copy Code
typedef struct  {
   LONG         X;
   LONG         Y;
} SFPoint;

Fields:

Name Description

Subcode

This indicates which subcode was used when the ScanFix opcode was in use when the defer function was invoked.  Current subcodes which use RES_QUERY are SF_SUBCODE_REMOVE_LINES, SF_SUBCODE_REMOVE_BLOBS, and SF_SUBCODE_REMOVE_COMBS.  This value indicates which member of the union should be used to interpret the query data.

Stop

When set to true, this terminates processing after the current object.  All objects than have been selected for removal prior to this point will be removed, and any objects not yet processed will remain in the image.

u.LineReportData.X

This is the horizontal coordinate of the line endpoint, given an origin in the upper left corner of the image.

u.LineReportData.Y

This is the vertical coordinate of the line endpoint, given an origin in the upper left corner of the image.

u.LineReportData.Length

This is length of the line in pixels.

u.LineReportData.Thickness

This is the thickness of the line in pixels

u.LineReportData.Orientation

This indicates the orientation of the line.  Valid values are:

Constant

Meaning

SCANFIX_LINE_ORIENTATION_HORIZONTAL
(0)

Line is horizontally oriented; X, Y refer to left endpoint

SCANFIX_LINE_ORIENTATION_VERTICAL

(1)

Line is vertically oriented; X, Y refer to top endpoint

u.LineReportData.DeleteLine

This value is set to a non-zero value to indicate that the line should be deleted.

u.CombReportData.X

This is the horizontal coordinate of the upper left coordinate of the bounding box of the detected object, given an origin in the upper left corner of the image.

u.CombReportData.Y

This is the vertical coordinate of the upper left coordinate of the bounding box of the detected object, given an origin in the upper left corner of the image.

u.CombReportData.Width

This is the width of the bounding box of the detected object, in pixels.

u.CombReportData.Height

This is the height of the bounding box of the detected object, in pixels.

u.CombReportData.Spacing

This is the spacing between teeth in the comb in pixels.

u.CombReportData.Teeth

This is the number of teeth found in the suspected comb.  A count of Width / Spacing indicates that all probably locations for teeth contained a suitable line.

u.CombReportData.Confidence

This is a value in the range of 0 (no confidence) to 100 (high confidence) indicating how likely the detected object is a comb.

u.CombReportData.DeleteComb

This value is set to a non-zero value to indicate that the comb should be deleted.

u.BlobReportData.X

This is the horizontal coordinate of the upper left coordinate of the bounding box of the detected object, given an origin in the upper left corner of the image.

u.BlobReportData.Y

This is the vertical coordinate of the upper left coordinate of the bounding box of the detected object, given an origin in the upper left corner of the image.

u.BlobReportData.Width

This is the width of the bounding box of the detected object, in pixels.

u.BlobReportData.Height

This is the height of the bounding box of the detected object, in pixels.

u.BlobReportData.Density

This is the density of the detected object, expressed as a percentage of the convex hull consisting of black pixels; values range from 0 to 100.

u.BlobReportData.Pixels

This is the number of 4-way connected pixels in the detected object.

u.BlobReportData.PointCount

This is the number of points in the convex hull bounding the detected object.

u.BlobReportData.ConvexHull

This is a pointer to an array of SFPoint structures containing the points of the convex hull bounding the pixels in the detected object.

u.BlobReportData.ConvexHull[].X

This is the horizontal coordinate of the point, given an origin in the upper left corner of the image.

u.BlobReportData.ConvexHull[].Y

This is the vertical coordinate of the point, given an origin in the upper left corner of the image.

u.BlobReportData.DeleteBlob

This value is set to a non-zero value to indicate that the blob should be deleted.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback