Nicomsoft OCR: Developer's Guide |
BT_DEFAULT | 0x00 | Used only for the Cfg_GetOption and Cfg_SetOption functions to access the "Default" configuration section. See the NSOCR Configuration section for details. |
BT_OCRTEXT | 0x01 | The block contains machine-printed text. |
BT_ICRDIGIT | 0x02 | The block contains handwritten digits. |
BT_CLEAR | 0x03 | The block is for clearing its image area (removes block area from recognition). |
BT_PICTURE | 0x04 | The block contains a picture. |
BT_ZONING | 0x05 | The block is for detecting zones (text and picture blocks). |
BT_OCRDIGIT | 0x06 | The block contains machine-printed digits. |
BT_BARCODE | 0x07 | The block contains a barcode. |
BT_TABLE | 0x08 | The block contains a table. |
BT_MRZ | 0x09 | The block contains MRZ, the machine-readable zone (ISO/IEC 7501-1). |
BMP_24BIT | 0x00 | The image is 24-bit (color). |
BMP_8BIT | 0x01 | The image is 8-bit (grayscale). |
BMP_1BIT | 0x02 | The image is 1-bit (black-white). |
BMP_32BIT | 0x03 | The image is 32-bit (color). |
BMP_BOTTOMTOP | 0x100 | The image is bottom up and starts at the bottom-left corner. |
FMT_EDITCOPY | 0x00 | The text will be formatted for editing: unnecessary line breaks will be removed, divided words will be combined, etc. |
FMT_EXACTCOPY | 0x01 | The text will be returned exactly as it appears in the image. |
OCRSTEP_FIRST | 0x00 | The first step in the OCR process. It only marks the OCR process as started. |
OCRSTEP_PREFILTERS | 0x10 | Applies image filters: image scaling, inversion, rotation, mirroring, and deskewing algorithms. See the "ImgAlizer" section in the configuration file for possible options. This step is performed only once, you cannot call it twice. |
OCRSTEP_BINARIZE | 0x20 | Calculates the binarized image. See the "Binarizer" section in the configuration file for possible options. If necessary, this step can be called several times with different parameters. |
OCRSTEP_POSTFILTERS | 0x50 | Applies filters to the binarized image. See such options as "BigGarbageMinWidth" or "SmallGarbageMaxPixCnt". If necessary, this step can be called several times with different parameters. |
OCRSTEP_REMOVELINES | 0x60 | Finds lines and removes them from the image. If necessary, this step can be called several times with different parameters. |
OCRSTEP_ZONING | 0x70 | If the image doesn’t have any defined blocks or has the BT_ZONING blocks, the page will be analyzed, and text and picture blocks will be created automatically. If necessary, this step can be called several times. |
OCRSTEP_OCR | 0x80 | Performs OCR of the image. If necessary, this step can be called several times with different parameters. |
OCRSTEP_LAST | 0xFF | The last step in the OCR process. It only marks the OCR process as finished. |
OCRFLAG_NONE | 0x00 | Does OCR in blocking mode. The Img_OCR will return when the OCR process is complete. |
OCRFLAG_THREAD | 0x01 | Does OCR in nonblocking mode. The Img_OCR will return immediately. You need to call Img_OCR again with the OCRFLAG_GETRESULT flag repeatedly until the function returns a value different from ERROR_PENDING. |
OCRFLAG_GETRESULT | 0x02 | Gets the status of the OCR process. Returns ERROR_PENDING if OCR is not complete. |
OCRFLAG_GETPROGRESS | 0x03 | Gets the OCR progress as a percentage. Returns 0 ... 100 or an error code. |
OCRFLAG_CANCEL | 0x04 | Cancels the OCR process. Returns immediately. You need to call Img_OCR again with the OCRFLAG_GETRESULT flag repeatedly until the function returns a value different from ERROR_PENDING. |
DRAW_NORMAL | 0x00 | Draws the original image. After the OCRSTEP_PREFILTERS step, it draws an intermediate image with possible scaling, inversion, rotation, etc. |
DRAW_BINARY | 0x01 | Draws a binarized image. Can be used only after the OCRSTEP_BINARIZE step. |
DRAW_GETBPP | 0x100 | Retrieves the bits-per-pixel value for the selected mode (use this flag with DRAW_NORMAL or DRAW_BINARY to specify the mode). The possible return values are 8 and 24. In the DRAW_BINARY mode, it will always return 8. In the DRAW_NORMAL mode, it will return 24 for color images, and 8 for black-white or grayscale images. |
BLK_INVERSE_GET | -1 | Gets the current block’s inversion state. |
BLK_INVERSE_SET0 | 0x00 | Disallows inversion of the block (black text and white background). |
BLK_INVERSE_SET1 | 0x01 | Inverts the block (white text and black background). |
BLK_INVERSE_DETECT | 0x100 | Detects the inversion state automatically. Note that the OCRSTEP_BINARIZE step must be done before using this value. |
BLK_ROTATE_GET | -1 | Gets the current block’s rotation state. |
BLK_ROTATE_NONE | 0x00 | Disallows rotation of the block. |
BLK_ROTATE_90 | 0x01 | Rotates the block 90° clockwise. |
BLK_ROTATE_180 | 0x02 | Rotates the block 180° clockwise. |
BLK_ROTATE_270 | 0x03 | Rotates the block 270° clockwise. |
BLK_ROTATE_ANGLE | 0x100000 | Rotates the block clockwise through the specified angle. The angle is specified in degrees, multipled by 1000. For example, to rotate the block 10 degrees clockwise, use Blk_Rotation(BlkObj, BLK_ROTATE_ANGLE | (10 * 1000)). Negative values are not allowed; to rotate the block 20 degrees counterclockwise, use Blk_Rotation(BlkObj, BLK_ROTATE_ANGLE | ((360-20) * 1000)). |
BLK_ROTATE_DETECT | 0x100 | Detects the rotation (0°/90°/180°/270°) automatically. Note that the OCRSTEP_BINARIZE step must be done before using this value. |
BLK_MIRROR_GET | -1 | Gets the current block’s mirror state. |
BLK_MIRROR_NONE | 0x00 | Disallows mirroring of the block. |
BLK_MIRROR_H | 0x01 | Mirrors the block horizontally. |
BLK_MIRROR_V | 0x02 | Mirrors the block vertically. |
FONT_STYLE_UNDERLINED | 0x01 | Underlined text |
FONT_STYLE_STRIKED | 0x02 | Stricken text |
FONT_STYLE_BOLD | 0x04 | Bold text (currently not supported in the public release) |
FONT_STYLE_ITALIC | 0x08 | Italic text (currently not supported in the public release) |
SVR_FORMAT_PDF | 0x01 | Adobe PDF format (PDF) |
SVR_FORMAT_RTF | 0x02 | Microsoft Rich Text format (RTF) |
SVR_FORMAT_TXT_ASCII | 0x03 | ASCII Text format (TXT) |
SVR_FORMAT_TXT_UNICODE | 0x04 | Unicode Text format (TXT) |
SVR_FORMAT_XML | 0x05 | XML format |
SVR_FORMAT_PDFA | 0x06 | Adobe PDF/A-1a or PDF/A-1b format (PDF/A) |
SCAN_GETDEFAULTDEVICE | 0x01 | The function will return the default TWAIN scanner index. |
SCAN_SETDEFAULTDEVICE | 0x100 | The function will set the default TWAIN scanner (Flags = SCAN_SETDEFAULTDEVICE | ScannerIndex). |
SCAN_NOUI | 0x01 | Scans without displaying the scanner preview dialog. Always enabled for WIA devices. |
SCAN_SOURCEADF | 0x02 | Uses an ADF (Automatic Document Feeder) as a document source. |
SCAN_SOURCEAUTO | 0x04 | Detects the document source automatically. |
SCAN_DONTCLOSEDS | 0x08 | Disallows the closing of the TWAIN Document Source (DS) after scanning. In most cases, you do not need to use this option. |
SCAN_FILE_SEPARATE | 0x10 | Used for the Scan_ScanToFile function only: When an ADF is used and several pages are scanned, it saves every page to a separate file. |
IMG_PROP_DPIX | 0x01 | Resolution (DPI) X |
IMG_PROP_DPIY | 0x02 | Resolution (DPI) Y |
IMG_PROP_BPP | 0x03 | Color depth (bits per pixel) |
IMG_PROP_WIDTH | 0x04 | Original image width |
IMG_PROP_HEIGHT | 0x05 | Original image height |
IMG_PROP_INVERTED | 0x06 | The image inversion flag after the OCRSTEP_PREFILTERS step |
IMG_PROP_SKEW | 0x07 | The image skew angle, multipled by 1000, after the OCRSTEP_PREFILTERS step |
IMG_PROP_SCALE | 0x08 | The image scale factor, multipled by 1000, after the OCRSTEP_PREFILTERS step |
IMG_PROP_PAGEINDEX | 0x09 | The image page index for a multi-page document |
REGEX_SET | 0x00 | Sets the regular expression. |
REGEX_CLEAR | 0x01 | Clears the regular expression. |
REGEX_CLEAR_ALL | 0x02 | Clears all regular exressions for the block. |
REGEX_DISABLE_DICT | 0x04 | Disallows the use of the dictionary; only the regular expression will be checked. |
REGEX_CHECK | 0x08 | Checks if the specified string matches the current regular expression. |
INFO_PDF_AUTHOR | 0x01 | Sets the "author" info field for a PDF file. |
INFO_PDF_CREATOR | 0x02 | Sets the "creator" info field for a PDF file. |
INFO_PDF_PRODUCER | 0x03 | Sets the "producer" info field for a PDF file. |
INFO_PDF_TITLE | 0x04 | Sets the "title" info field for a PDF file. |
INFO_PDF_SUBJECT | 0x04 | Sets the "subject" info field for a PDF file. |
INFO_PDF_KEYWORDS | 0x04 | Sets the "keywords" info field for a PDF file. |
BARCODE_TYPE_EAN8 | 0x01 | EAN8 barcode |
BARCODE_TYPE_UPCE | 0x02 | UPCE barcode |
BARCODE_TYPE_ISBN10 | 0x03 | ISBN10 barcode |
BARCODE_TYPE_UPCA | 0x04 | UPCA barcode |
BARCODE_TYPE_EAN13 | 0x05 | EAN13 barcode |
BARCODE_TYPE_ISBN13 | 0x06 | ISBN13 barcode |
BARCODE_TYPE_ZBAR_I25 | 0x07 | ZBAR_I25 barcode |
BARCODE_TYPE_CODE39 | 0x08 | CODE39 barcode |
BARCODE_TYPE_QRCODE | 0x09 | QRCODE barcode |
BARCODE_TYPE_CODE128 | 0x0A | CODE128 barcode |
BARCODE_TYPE_MASK_EAN8 | 0x01 | EAN8 barcode |
BARCODE_TYPE_MASK_UPCE | 0x02 | UPCE barcode |
BARCODE_TYPE_MASK_ISBN10 | 0x04 | ISBN10 barcode |
BARCODE_TYPE_MASK_UPCA | 0x08 | UPCA barcode |
BARCODE_TYPE_MASK_EAN13 | 0x10 | EAN13 barcode |
BARCODE_TYPE_MASK_ISBN13 | 0x20 | ISBN13 barcode |
BARCODE_TYPE_MASK_ZBAR_I25 | 0x40 | ZBAR_I25 barcode |
BARCODE_TYPE_MASK_CODE39 | 0x80 | CODE39 barcode |
BARCODE_TYPE_MASK_QRCODE | 0x100 | QRCODE barcode |
BARCODE_TYPE_MASK_CODE128 | 0x200 | CODE128 barcode |
IMG_FORMAT_BMP | 00 | BMP format |
IMG_FORMAT_JPEG | 02 | JPEG format |
IMG_FORMAT_PNG | 13 | PNG format |
IMG_FORMAT_TIFF | 18 | TIFF format |
IMG_FORMAT_FLAG_BINARIZED | 0x100 | Merge this flag to save binarized image |