Main Page | Modules | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages | Search

Ocrxtrapi_public


Files

file  vvxtrAPI.h
 vvxtrAPI.h, Public Interface for OCRShop XTR API

file  vvxtrComm.h
 vvxtrComm.h, Information needed to communicate with the daemon without the client program.

file  vvxtrDefs.h
 vvxtrDefs.h, definitions and enumerations for OCRShop XTR API

file  vvxtrFactory.h
 vvxtrFactory.h, Function declarations for the engine factory.


Compounds

class  vvEngAPI
 Optical Character Recognition Engine API Class. More...

class  vvxtrImage
 An encapsulation of information about a bitmap. More...

struct  vvxtrKeyValuePair

Defines for conditions

Used to construct the vvxtr_state bitstring.

  • State is a bit string corresponding to a bitwise OR of all conditions.
  • Used in vvEngAPI::vvGetCond function.


#define C_READY   0x400
 ready

#define C_OCRSESOPEN   0x200
 OCR session is open.

#define C_OUTDOCOPEN   0x100
 output document is open

#define C_FILEOPEN   0x080
 input image is open

#define C_IMAGELOADED   0x040
 input page is open

#define C_PREPROCDONE   0x020
 preprocessing has been run on the current page

#define C_RECOGDONE   0x010
 recognition has been run on the current page

#define C_DOCREADY   0x008
 output document is ready for aquisition

#define C_SUBIMAGEREADY   0x004
 output subimage is ready for aquisition

#define C_ENGINEBUSY   0x002
 engine is currently busy

#define C_ERROR   0x001
 error


Defines for Error codes

These codes are returned as a vvxtrStatus value when there is an error.

#define VVXTR_KILL_PROCESS   -1000
 Time for the daemon to die.

#define VVXTR_PREVIOUS_ERROR   -1001
 Requesting information on the last error.

#define VVXTR_ERR   -1
 General error.

enum  vvxtrErrorCodes {
  VVXTR_ERR_INVALID_SYNTAX = 1001, VVXTR_ERR_NO_INPUT, VVXTR_ERR_INVALID_STATE, VVXTR_ERR_INITINSTANCE_FAILURE, VVXTR_ERR_ENDINSTANCE_FAILURE, VVXTR_ERR_NO_INPUT_FILE_SPECIFIED, VVXTR_ERR_UNABLE_TO_LOAD_IMAGE_FILE, VVXTR_ERR_IMG_ACQ_FAILED,
  VVXTR_ERR_START_SESSION_FAILED, VVXTR_ERR_RECOGNITION_FAILED, VVXTR_ERR_OPEN_CHAR_SET_FAILURE, VVXTR_ERR_INVALID_SHAPE_PACK_PATH, VVXTR_ERR_BAD_LANGUAGE, VVXTR_ERR_OPENING_LANG_PACK, VVXTR_ERR_LOAD_LANG_FAILED, VVXTR_ERR_CREATE_LANG_GROUP,
  VVXTR_ERR_LANG_NOT_LICENSED, VVXTR_ERR_SET_DEF_LEX_CONSTRAINTS, VVXTR_ERR_WRITE_OUTPUT_FAILED, VVXTR_ERR_OPENING_OUTPUT_FILE, VVXTR_ERR_REGION_ECLIPSED, VVXTR_ERR_COULD_NOT_CONVERT_DEPTH, VVXTR_ERR_GETTING_IMG_REGION, VVXTR_ERR_END_SESSION_FAILED,
  VVXTR_ERR_OUTPUT_INV_REGION, VVXTR_ERR_NOT_IMPLEMENTED, VVXTR_ERR_INV_PDF_FORMAT, VVXTR_ERR_PDF_IMG_OUTPUT, VVXTR_ERR_PDF_END_OUTPUT, VVXTR_ERR_UNABLE_TO_WRITE_PDF, VVXTR_ERR_HOST_LOOKUP_FAILED, VVXTR_ERR_CONNECTION_FAILED,
  VVXTR_ERR_TRANSFER_FAILED, VVXTR_ERR_NO_SUBIMAGE, VVXTR_ERR_PP_FAILED, VVXTR_ERR_SET_OPTIONS_FAILED, VVXTR_ERR_REMOVE_FILE_FAILED, VVXTR_ERR_NO_DOC, VVXTR_ERR_INV_SUBIMG_FORMAT, VVXTR_ERR_SYNCHRONIZATION,
  VVXTR_ERR_NOENGINE, VVXTR_ERR_BUFFER_TOO_SMALL, VVXTR_ERR_INVALID_PAGE, VVXTR_ERR_MISSING_LANG, VVXTR_ERR_ENG_OUT_OF_MEMORY, VVXTR_ERR_INVALID_UOR_COUNT, VVXTR_ERR_INVALID_UOR_STRING, VVXTR_ERR_READONLY_VALUE,
  VVXTR_ERR_INVALID_REGION_ID, VVXTR_ERR_SET_REGION_UNSUCCESSFUL, VVXTR_ERR_REGION_HANDLER, VVXTR_ERR_ENGINE_KILLED, VVXTR_ERR_NO_LICENSE, VVXTR_ERR_NO_LICENSE_MANAGER, VVXTR_ERR_LICENSE_COMM_ERROR, VVXTR_ERR_NO_FEATURE
}
 Time for the daemon to die. More...


Defines

#define VVXTRAPI_H   1
#define commandtable(A, B, C)   A,
#define actiontable(A, B)   xtract_##A,
#define statustable(key, action, type)   dm_##key,
#define TRANSFER_TIMEOUT   25
#define XTR_READY   "xtrReady"
#define VV_DEBUG   1
 To turn on debug messages.

#define tablemacro(key, value, type, kernelFunc, defaultUsed, defaultVal, kernelVal, write)   dm_##key,
#define VVXTRFACTORY_H   1

Typedefs

typedef enum vvxtr_dataType VVXTR_DATATYPE
 Generic XTR datatype.

typedef signed long int vvxtr_state
 Representation of the state as a bit-string.

typedef signed long int vvxtr_cond
 Representation of a single condition in the state bit-string.

typedef signed long int vvxtrStatus
 Representation of the engine status.

typedef void * vvxtr_stdarg
 A generic argument in the XTR API.


Enumerations

enum  vvxtrCommandKeyEnum {
  query_status, get_value, set_value, do_action, upload_block, download_block, get_version, add_word_to_lexicon,
  set_hint, set_lexical_constraints, set_region_properties, force_region_foreground, remove_region, VVXTR_NUM_COMMANDS
}
enum  vvxtrActionEnum {
  xtract_init_instance, xtract_end_instance, xtract_start_ocr_ses, xtract_end_ocr_ses, xtract_start_doc, xtract_spool_doc, xtract_end_doc, xtract_capture_subimage,
  xtract_read_image_data, xtract_open_image_file, xtract_unload_image, xtract_close_image_file, xtract_preprocess, xtract_recognize, xtract_init_values, xtract_kill,
  VVXTR_NUM_ACTIONS
}
enum  vvxtrStatusEnum {
  dm_daemon_state, dm_engine_state, dm_words_seen, dm_words_recognized, dm_characters_seen, dm_characters_recognized, dm_percentage_done, dm_page_number,
  dm_region_number, dm_line_orientation, dm_skew_angle, dm_current_skew_angle, dm_skew_confidence, dm_smotation_angle, dm_text_orientation, dm_min_is_black,
  dm_most_complex, dm_byte_order, dm_error_code, dm_version, dm_bitmap_split, dm_line_doubled, dm_regionview_mode, dm_codepage,
  dm_lexicon, dm_most_cols, dm_most_rows, dm_most_cells, VVXTR_NUM_STATUS_TYPES
}
enum  { vvOcrListenPort = 10101, vvOcrLicensePort = 10102 }
enum  TransferType { ttInvalid = 0, ttDoc, ttImage, ttImageFile, ttDocFile, ttImageFileLocal, ttDocFileLocal }
enum  vvxtr_dataType { vvxtr_none = 0, vvxtr_int, vvxtr_string, vvxtr_pib, vvxtr_ptr }
 Generic XTR datatype. More...

enum  vvxtrResponseEnum { vvNo = 0, vvYes = 1, vvAuto = 2, vvDetect = 3, vvCorrect = 4, vvManual = 5 }
 Generic settings used for many different options. More...

enum  vvxtrOutTextFormatEnum {
  vvTextFormatDefault = -1, vvTextFormatNone = 0, vvTextFormatXdoc = 1, vvTextFormatXdoclite = 3, vvTextFormatXdocplus = 4, vvTextFormatPost = 13, vvTextFormatIso = 102, vvTextFormatPdf = 104,
  vvTextFormat8bit = 105, vvTextFormatUnicode = 106, vvTextFormatHtmlWysiwygP = 107, vvTextFormatHtmlWysiwygS = 108, vvTextFormatHtmlTable = 109, vvTextFormatHtmlSimple = 110
}
 Output text formats. More...

enum  vvxtrOutGraphicsFormatEnum {
  vvSubimageFormatNone = -1, vvSubimageFormatTiff = 0, vvSubimageFormatRas = 1, vvSubimageFormatEpsf = 2, vvSubimageFormatX11 = 3, vvSubimageFormatTiffpack = 4, vvSubimageFormatTiffg31d = 5, vvSubimageFormatTiffg32d = 6,
  vvSubimageFormatTiffg42d = 7, vvSubimageFormatTifflzw = 8, vvSubimageFormatPaltiff = 31, vvSubimageFormatGif = 17, vvSubimageFormatJpeg = 19, vvSubimageFormatPng = 21, vvSubimageFormatXwd = 22, vvSubimageFormatRgb = 23,
  vvSubimageFormatRgbrle = 24, vvSubimageFormatEPdf = 28, vvSubimageFormatVvxtrImage = 30
}
 Output graphics formats. More...

enum  vvxtrFocusAreaEnum { vvFocusAreaPage = 0, vvFocusAreaRegion = 1 }
 How to specify the document area on which to focus. More...

enum  vvxtrVerifierModeEnum { vvVerifierModeWord = 1, vvVerifierModeChar = 0 }
 Verifier mode. More...

enum  vvxtrRecModeEnum { vvRecModeUnspecified = 1, vvRecModeStandard = 2, vvRecModeDegraded = 3 }
 Recognition mode. More...

enum  vvxtrTextOutNewlineEnum { vvTextOutNewlineUnix = 1, vvTextOutNewlineMac = 2, vvTextOutNewlinePC = 3 }
 Newline designation. More...

enum  vvxtrPDFFormatEnum { vvPDFFormatNormal = 1, vvPDFFormatText = 2, vvPDFFormatImgOnly = 3 }
 PDF format. More...

enum  vvxtrRegionTypeEnum {
  vvRegionTypeAny = 3511, vvRegionTypeIgnore = 3512, vvRegionTypeText = 3513, vvRegionTypeImage = 3514, vvRegionTypeVrule = 3515, vvRegionTypeHrule = 3516, vvRegionTypeHidden = 3517, vvRegionTypeRevid = 3518,
  vvRegionTypeHiddenimage = 3519
}
 Region types. More...

enum  vvxtrRegionSubtypeEnum {
  vvRegionSubtypeUnflavored = 0, vvRegionSubtypeTable = 1, vvRegionSubtypeTable_inset = 2, vvRegionSubtypeHeadline = 3, vvRegionSubtypeTimestamp = 4, vvRegionSubtypeLineart = 5, vvRegionSubtypeHalftone = 6, vvRegionSubtypeInset = 7,
  vvRegionSubtypeCaption = 8, vvRegionSubtypePage_footer = 9, vvRegionSubtypePage_header = 10, vvRegionSubtypeVruling = 11, vvRegionSubtypeHruling = 12, vvRegionSubtypeNoise = 13, vvRegionSubtypeIpcorePictureMask = 14
}
 Region subtypes. More...

enum  vvxtrRegionGrammarModeEnum { vvRegGrammarModeWord = 0, vvRegGrammarModeLine = 1 }
 Region grammar modes. More...

enum  vvxtrRegionLexmodeEnum { vvRegionLexmodeNolex = 0, vvRegionLexmodePreference = 1, vvRegionLexmodeAbsolute = 2 }
 Region lexical mode. More...

enum  vvxtrRegionForegroundEnum { vvRegionForegroundBlack = 0, vvRegionForegroundWhite = 1, vvRegionForegroundUnknown = 2 }
 Region foreground specification. More...

enum  vvxtrRegionOpacityEnum { vvRegionOpacityOpaque = 0, vvRegionOpacityTransparent = 1 }
 Region opacity. More...

enum  vvxtrRegionAbutmentEnum { vvRegionAbutmentUnknown = -1, vvRegionAbutmentNone = 0, vvRegionAbutmentLeft = 1, vvRegionAbutmentRight = 2, vvRegionAbutmentLeftAndRight = 3 }
 Region abutment. More...

enum  vvxtrLexicalConstraintModeEnum { vvLexConstraintModeReplace = 0, vvLexConstraintModeAdd = 1 }
 Lexical constraint mode. More...

enum  vvxtrDisplayAlignmentEnum { vvAlign8 = 8, vvAlign16 = 16, vvAlign32 = 32, vvAlign64 = 64 }
 Bit alignment of display. More...

enum  vvxtrVersionLocationEnum { vvLocal = 0, vvRemote = 1 }
 Version location. More...

enum  vvxtrImageSpecificationEnum { vvInputImage = 0, vvProcessedImage = 1 }
 Specify the original or processed image. More...

enum  vvInternalEngineState {
  vvS_NONE = 0x00000000, vvS_IDLE = 0x00000001, vvS_SESSION = 0x00000002, vvS_CANCEL = 0x00000004, vvS_PGCAN = 0x00000008, vvS_ACQUISITION_READY = 0x00000010, vvS_ACQUIRING = 0x00000020, vvS_RECOGNITION_READY = 0x00000040,
  vvS_RECOGNIZING = 0x00000080, vvS_PREPROCESS = 0x00000100, vvS_TEXT_OUTPUT = 0x00000200, vvS_REGION_MAPPING = 0x00000400, vvS_SHAPES_LOADED = 0x00000800, vvS_AWAITING_DRAW = 0x00001000, vvS_AWAITING_VERIFIER = 0x00002000, vvS_PATTERN_LOADED = 0x00008000,
  vvS_BUFFER_FULL = 0x00010000, vvS_UNUSED_2 = 0x00020000, vvS_UNUSED_3 = 0x00040000, vvS_XDOC_LOADED = 0x00080000, vvS_PAGE_ANALYZED = 0x00200000, vvS_ANALYZING_PAGE = 0x00400000, vvS_PAGE_LAID_OUT = 0x00800000, vvS_CHARSET_TABLE_LOADED = 0x02000000,
  vvS_ANY = 0x00ffffff, vvS_ERROR = 0x01000000, vvS_BLOCKED = (vvS_AWAITING_DRAW | vvS_AWAITING_VERIFIER), vvS_READY = (vvS_ACQUISITION_READY | vvS_RECOGNITION_READY), vvS_RECOGNITION = (vvS_RECOGNITION_READY | vvS_RECOGNIZING), vvS_ACQUISITION = (vvS_ACQUISITION_READY | vvS_ACQUIRING), vvS_PROCESSING = (vvS_ACQUIRING | vvS_PREPROCESS | vvS_RECOGNIZING | vvS_REGION_MAPPING | vvS_TEXT_OUTPUT )
}
 The internal engine state bit field values. More...

enum  vvxtrHint { vvHintLocalFilesystem, vvNumberOfHints }
 Hints to improve engine performance. More...

enum  vvxtrEngineVariables {
  dm_min_point, dm_max_point, dm_accept_thresh, dm_quest_thresh, dm_recmode, dm_recomp, dm_no_sloppy_manual, dm_no_hdr_ftr,
  dm_user_specified_order, dm_user_specified_regions, dm_find_headlines, dm_text_out_newline, dm_xdc_wconf, dm_xdc_cconf, dm_xdc_wbox, dm_xdc_cbox,
  dm_xdc_wbox_pixels, dm_metric, dm_pdf_format, dm_pdf_imgthresh, dm_pdf_img_nodict, dm_pdf_img_alphanum, dm_ls_quote, dm_rs_quote,
  dm_ld_quote, dm_rd_quote, dm_document_name, dm_questionable, dm_unrecognized, dm_force_single_col, dm_one_line_table_cells, dm_improved_single_col_detect,
  dm_region_type, dm_region_subtype, dm_region_stacking, dm_region_grammar_mode, dm_region_lexical_constraint_id, dm_region_lexmode, dm_region_foreground, dm_region_out_order,
  dm_region_name, dm_region_frame_left, dm_region_frame_right, dm_region_frame_top, dm_region_frame_bot, dm_region_uor_string, dm_region_uor_count, dm_black_threshold,
  dm_in_xres, dm_in_yres, dm_language, dm_english_chars, dm_char_set, dm_word_lexicon_id, dm_format_analysis, dm_double_dimension,
  dm_current_region, dm_focus_area, dm_pp_remove_halftone, dm_pp_auto_segment, dm_pp_rotate, dm_pp_fax_filter, dm_pp_auto_orient, dm_pp_invert,
  dm_pp_newspaper_filter, dm_pp_deskew, dm_pp_photometric_interp, dm_pp_dotmatrix_filter, dm_pp_autosetdegrade, dm_pp_recognition, dm_pp_segment_lineart, dm_pp_reverse_video,
  dm_pp_analyze_layout, dm_auto_flip, dm_in_filename, dm_in_curr_page, dm_in_num_pages, dm_in_format, dm_region_ids, dm_region_ids_text,
  dm_region_ids_image, dm_out_text_format, dm_out_graphics_format, dm_doc_memory_size, dm_subimage_memory_size, dm_coord_space, dm_output_img_source, dm_recognize_timeout,
  dm_preprocess_timeout, VVXTR_ENGINE_VARIABLE_COUNT
}
 Data values. More...


Functions

vvEngAPIvvxtrCreateLocalEngine ()
 Create a statically-linked (local) instance of the library.

vvEngAPIvvxtrCreateRemoteEngine (const char *host)
 Creates an OCR engine for the calling client program.


Define Documentation

#define VVXTR_KILL_PROCESS   -1000
 

Time for the daemon to die.

No meaning in a statically linked library.

Definition at line 493 of file vvxtrDefs.h.


Typedef Documentation

typedef signed long int vvxtr_state
 

Representation of the state as a bit-string.

State is defined as a bitwise OR of all current conditions:

state =
C_READY | C_OCRSESOPEN | C_OUTDOCOPEN | C_FILEOPEN
C_IMAGELOADED | C_PREPROCDONE | C_RECOGDONE | C_DOCREADY
C_SUBIMAGEREADY | C_ENGINEBUSY | C_ERROR

For a state diagram please see the section Engine State and API call sequencing.

Definition at line 53 of file vvxtrDefs.h.


Enumeration Type Documentation

enum vvInternalEngineState
 

The internal engine state bit field values.

These values are used to construct the engine state returned from vvEngAPI::vvGetStatus, when dm_engine_state is passed as the first parameter. You may decipher the returned engine state by referring to this list.

This internal engine state is not often used by client programs, offering more detailed, internal information than is typically useful. More often a client program finds the vvxtr_state useful.

Enumeration values:
vvS_NONE  no required state
vvS_IDLE  waiting for startup
vvS_SESSION  processing a document
vvS_CANCEL  cancelling recognition
vvS_PGCAN  cancelling text output
vvS_ACQUISITION_READY  ready to acquire an image
vvS_ACQUIRING  getting an image
vvS_RECOGNITION_READY  ready to do recognition (also true during recognition)
vvS_RECOGNIZING  doing recognition
vvS_PREPROCESS  doing image preprocessing
vvS_TEXT_OUTPUT  doing text formatting and output
vvS_REGION_MAPPING  (internal) creating manual image regions
vvS_SHAPES_LOADED  shapes loaded
vvS_AWAITING_DRAW  waiting for user to get draw
vvS_AWAITING_VERIFIER  waiting for user to call verfier
vvS_PATTERN_LOADED  pattern loaded
vvS_BUFFER_FULL  a complete image is in the buffer
vvS_UNUSED_2  not used
vvS_UNUSED_3  not used
vvS_XDOC_LOADED  XDOC loaded.
vvS_PAGE_ANALYZED  page analyzed
vvS_ANALYZING_PAGE  analyzing page
vvS_PAGE_LAID_OUT  page analysis has been run on the current page
vvS_CHARSET_TABLE_LOADED  character set table loaded
vvS_ANY  any state is ok
vvS_ERROR  a fatal error condition exists
vvS_BLOCKED  blocked
vvS_READY  ready
vvS_RECOGNITION  recognition in progress
vvS_ACQUISITION  acquisition in progress
vvS_PROCESSING  currently processing

Definition at line 443 of file vvxtrDefs.h.

enum vvxtr_dataType
 

Generic XTR datatype.

Enumeration values:
vvxtr_none  none
vvxtr_int  integer
vvxtr_string  string
vvxtr_pib  Vividata platform independent bitmap.
vvxtr_ptr  pointer

Definition at line 32 of file vvxtrDefs.h.

enum vvxtrActionEnum
 

Enumeration values:
xtract_init_instance  Initialize an instance of the engine.
xtract_end_instance  End an instance of the engine.

Definition at line 34 of file vvxtrComm.h.

enum vvxtrCommandKeyEnum
 

Enumeration values:
query_status  Query the status of the engine.
get_value  Get a value from the engine.

Queries the engine for a specific value.

See also:
vvxtrStatusEnum
set_value  Set a value in the engine.
do_action  Execute an engine action.

See also:
vvxtrActionEnum

Definition at line 25 of file vvxtrComm.h.

enum vvxtrDisplayAlignmentEnum
 

Bit alignment of display.

  • Used for ::dm_display_alignment
  • Corresponds to directiv.h: <M_ALIGN8|M_ALIGN16|M_ALIGN32|M_ALIGN64>
Enumeration values:
vvAlign8  8 bit alignment
vvAlign16  16 bit alignment
vvAlign32  32 bit alignment
vvAlign64  64 bit alignment

Definition at line 364 of file vvxtrDefs.h.

enum vvxtrEngineVariables
 

Data values.

Enumeration values:
dm_min_point  Minimum point size.

Setting dm_min_point guides the OCR engine in what font sizes to expect. For example, if you set dm_min_point to 14, you effectively tell the engine, "Expect only fonts 14 points and larger."

Setting dm_min_point does NOT tell the engine, "Recognize only fonts 14 points and larger." In other words, if dm_min_point is 14 and the input image includes fonts smaller than 14 points, then the engine still processes all of the page text, including the smaller fonts, but it will not be able to recognize the smaller fonts well because they fall below dm_min_point.

Please note that the resolution of the input image affects what a point size means to the engine. For example, a letter 20 pixels high in an input image with a resolution of 200dpi is a different point size than a letter 20 pixels high in an input image with a resolution of 300dpi.

dm_max_point works in conjunction with dm_min_point.

dm_min_point should be set before the OCR session is started (vvEngAPI::vvStartOCRSes).

  • Type: int
  • Range: 5-72
  • Default: 5

dm_max_point  Maximum point size.

dm_max_point works in conjunction with dm_min_point to specify to the OCR engine what font sizes to expect. For example, if you set dm_max_point to 18, you effectively tell the engine, "Expect only fonts 18 points and smaller."

Setting dm_max_point does NOT tell the engine, "Recognize only fonts 18 points and smaller." In other words, if dm_max_point is 18 and the input image includes fonts larger than 18 points, then the engine still processes all of the page text, including the larger fonts, but it will not be able to recognize the larger fonts well because they fall outside the dm_min_point and dm_max_point range.

Please note that the resolution of the input image affects what a point size means to the engine. For example, a letter 20 pixels high in an input image with a resolution of 200dpi is a different point size than a letter 20 pixels high in an input image with a resolution of 300dpi.

dm_min_point works in a similar manner to dm_max_point.

dm_max_point should be set before the OCR session is started (vvEngAPI::vvStartOCRSes).

  • Type: int
  • Range: 5-72
  • Default: 72

dm_accept_thresh  Acceptability threshold.

The threshold above which a character is always considered acceptable. (XDOC output only)

When xdc_cconf is set to vvYes, XDOC output will include confidence value information for characters when their confidence values are between the questionability and acceptability thresholds.

This value should be set before calling vvEngAPI::vvRecognize.

More information on the XDOC output format is available in the core12xdc.pdf and kdoctxt.h documents, included with the distribution in /opt/Vividata/doc or available upon request.

See dm_quest_thresh, dm_xdc_wconf, dm_xdc_cconf.

  • Type: int
  • Range: 0-999
  • Default: 999

dm_quest_thresh  Questionability threshold.

For XDOC output, when the confidence value for a character is below the questionability threshold, then the questionable character mark is printed in the output file.

When xdc_cconf is set to vvYes, the output will include confidence value information for characters when their confidence values are between the questionability and acceptability thresholds.

This value should be set before calling vvEngAPI::vvRecognize.

More information on the XDOC output format is available in the core12xdc.pdf and kdoctxt.h documents, included with the distribution in /opt/Vividata/doc or available upon request.

See dm_questionable for information on changing the character used to denote a questionable character in certain output formats.

See dm_accept_thresh, dm_xdc_wconf, dm_xdc_cconf.

  • Type: int
  • Range: -1-999
  • Default: 0

dm_recmode  Recognition mode.

dm_recomp  Page recomposition enabled.

Page recomposition (dm_recomp) alters the way some things are written to an XDOC output file. Page recomposition is ONLY applicable to the XDOC output format. When page recomposition is on, captions, headers, and footers are output before the body text of the document. In addition, the structures of the pages will be included in the XDOC output. If page recomposition is off, then headers and footers are output at the end.

dm_no_sloppy_manual  Turn on merging of manual text regions.

dm_no_hdr_ftr  Output headers and footers as text.



dm_user_specified_order  User has specified the read order.

This value is used when automatic page segmentation was not used and page layout analysis is run. In this case, if dm_user_specified_order is on, then page layout analysis will not re-order the regions. Please read the documentation on dm_pp_analyze_layout for more explanation.

Should be set before calling vvEngAPI::vvPreprocess.

See also:
dm_user_specified_regions

dm_user_specified_regions  User has specified the regions.

This value is used when automatic page segmentation was not used and page layout analysis is run. In this case, if ::dm_user_specified_region is on, then page layout analysis will not re-form the regions. Please read the documentation on dm_pp_analyze_layout for more explanation.

Should be set before calling vvEngAPI::vvPreprocess.

See also:
dm_pp_analyze_layout

dm_user_specified_order

dm_find_headlines  Find headlines + out in xdoc.

dm_text_out_newline  Newline designation for output text.

dm_xdc_wconf  Enable word confidence output in XDOC format.

Word confidence values will range from 0 to 999.

Only has an effect when dm_out_text_format is vvTextFormatXdoc, vvTextFormatXdoclite, or vvTextFormatXdocplus.

dm_xdc_cconf  Enable character confidence output in XDOC output format.

Character confidence values will range from 0 to 999.

Only has an effect when dm_out_text_format is vvTextFormatXdoc, vvTextFormatXdoclite, or vvTextFormatXdocplus.

dm_xdc_wbox  Output word bounding boxes in XDOC output format.

Only has an effect when dm_out_text_format is vvTextFormatXdoc, vvTextFormatXdoclite, or vvTextFormatXdocplus.

dm_xdc_cbox  Output character bounding boxes in XDOC output format.

Only has an effect when dm_out_text_format is vvTextFormatXdoc, vvTextFormatXdoclite, or vvTextFormatXdocplus.

dm_xdc_wbox_pixels  Use pixel values for word bounding boxes in XDOC output format.

This should be used in conjunction with dm_xdc_wbox; turning on dm_xdc_wbox_pixels affects the word bounding box measurements but does not turn on the word bounding boxes.

Only has an effect when dm_out_text_format is vvTextFormatXdoc, vvTextFormatXdoclite, or vvTextFormatXdocplus.

dm_metric  Use metric measurements.

Metric measurements are used for the output document, otherwise English measurements are used.

dm_pdf_format  Type of PDF output text document.

Only for use when dm_out_text_format is vvTextFormatPdf. Should be set before calling vvEngAPI::vvRecognize.

See also:
dm_output_img_source for information on how the graphics in the output PDF file will be compressed.

dm_pdf_imgthresh

dm_pdf_img_nodict

dm_pdf_img_alphanum

dm_pdf_imgthresh  Word threshold for imagette output.

Only for use when dm_out_text_format is vvTextFormatPdf. Should be set before calling vvEngAPI::vvRecognize.

Not supported in the current release.

  • Type: int
  • Range: 0-100?
  • Default: 0

dm_pdf_img_nodict  Output imagette if word is not in the dictionary.

Only for use when dm_out_text_format is vvTextFormatPdf. Should be set before calling vvEngAPI::vvRecognize.

Not supported in the current release.

dm_pdf_img_alphanum  Output imagette if word is alphanumeric.

Only for use when dm_out_text_format is vvTextFormatPdf. Should be set before calling vvEngAPI::vvRecognize.

Not supported in the current release.

dm_ls_quote  Left single quote.

Should be set before call to vvEngAPI::vvRecognize.

  • Type: char
  • Default: `

dm_rs_quote  Right single quote.

Should be set before call to vvEngAPI::vvRecognize.

  • Type: char
  • Default: '

dm_ld_quote  Left double quote.

Should be set before call to vvEngAPI::vvRecognize.

  • Type: char
  • Default: "

dm_rd_quote  Right double quote.

Should be set before call to vvEngAPI::vvRecognize.

  • Type: char
  • Default: "

dm_document_name  Document name (read-only).

  • Type: string
  • Default:

dm_questionable  Character to be inserted before each uncertain character.

dm_questionable is applicable to these output formats: vvTextFormatIso, vvTextFormatUnicode, vvTextFormat8bit

In XDOC output, the questionable character cannot be changed, because it is specified in the XDOC specification as Q.

See dm_quest_thresh for information on when a character is uncertain.

  • Type: string (only the first character is used)
  • Default: (none)

dm_unrecognized  Character to be used instead of each unrecognized character.

dm_unrecognized is applicable to these output formats: vvTextFormatIso, vvTextFormatUnicode, vvTextFormat8bit

In XDOC output, the unrecognized character cannot be changed, because it is specified in the XDOC specification as E.

See dm_quest_thresh and dm_accept_thresh.

  • Type: string (only the first character is used)
  • Default: ~ (ASCII 126)

dm_force_single_col  Force a single column.

When turned on, during region segmentation, multiple columns are merged into one single column.

This value must be set before the call to vvEngAPI::vvPreprocess, since it affects the region segmentation.

The effect of turning dm_force_single_col on is most apparent in a document with multiple columns and text output. When dm_force_single_col is off, each column is listed sequentially in the output text file, because the engine determined the columns are logically separate; when dm_force_single_col is on, the columns appear from the left to the right, giving the text file a similar appearance to the input image.

dm_one_line_table_cells  Force one line table cells.

dm_improved_single_col_detect  Improved single column detection.

dm_region_type  Region type.

dm_region_subtype  Region sub-type.

dm_region_stacking  Region stacking order.

Modify this to change how regions overlap each other.

  • Type: int
  • Range: >= 0
  • Default: automatically set

dm_region_grammar_mode  Grammar mode.

dm_region_lexical_constraint_id  Lexical constraint id.

  • Type: int
  • Range:
  • Default:

dm_region_lexmode  Region lexical mode.

dm_region_foreground  Photometric interpretation of region.

dm_region_out_order  Region output order.

Modify this to change the order in which the regions are written to the output.

  • Type: int
  • Range: >= 0
  • Default: set automatically

dm_region_name  Region name.

  • Type: string
  • Default:

dm_region_frame_left  Left frame boundary of the current region, as specified by dm_current_region.

This value is calculated automatically after preprocessing and recognition. The area of a region may be composed of many rectangles, called a "union of rectangles" (UOR), with the result that the region is not rectangular in shape (see dm_region_uor_string). dm_region_frame_left is the coordinate of the left side of the leftmost rectangle in the region's UOR.

  • Type: int
  • Range: 0-2400
  • Default: set automatically

dm_region_frame_right  Right frame boundary of the current region, as specified by dm_current_region.

This value is calculated automatically after preprocessing and recognition. dm_region_frame_right is the coordinate of the right side of the rightmost rectangle in the region's UOR.

  • Type: int
  • Range: > 0
  • Default: set automatically

dm_region_frame_top  Top frame boundary of the current region, as specified by dm_current_region.

This value is calculated automatically after preprocessing and recognition. dm_region_frame_top is the coordinate of the top side of the uppermost rectangle in the region's UOR.

  • Type: int
  • Range: > 0
  • Default: set automatically

dm_region_frame_bot  Bottom frame boundary of the current region, as specified by dm_current_region.

This value is calculated automatically after preprocessing and recognition. dm_region_frame_bot is the coordinate of the lower side of the bottommost rectangle in the region's UOR.

  • Type: int
  • Range: > 0
  • Default: set automatically

dm_region_uor_string  Defines the area covered by a region through a list of rectangles (see the glossary entry on UOR).

The boundary of a region is set by setting:

Then by calling vvEngAPI::vvSetRegionProperties.

Please see the Frequently Asked Questions section of the main documentation page for an example of setting up a new region's boundaries.

One may also query the engine for the UOR string of the current region: Set dm_current_region, then call vvEngAPI::vvGetValue, passing dm_region_uor_string as the value.

  • Type: string
  • Format: x1,y1,x2,y2;x3,y3,x4,y4;x5,y5,x6,y6....
    (Rectangle coordinates are separated by commas; rectangles are separated by semicolons.)
  • Default: NULL string (not a valid setting for a region)

dm_region_uor_count  The number of rectangles in the current region's UOR string.

When setting the dm_region_uor_string for a region, it is critical to correctly set the dm_region_uor_count for that region, otherwise, the dm_region_uor_string will not be interpreted correctly.

The engine may be queried for this value using vvEngAPI::vvGetValue to find out the number of rectangles in the UOR of the current region, specified by dm_current_region.

  • Type: int
  • Range: > 0
  • Default: none

dm_black_threshold  Threshold to binarize multi-bit input image data.

This is the threshold used to determine which pixels are black and which are white on a page when converting an image from multiple bits per pixel to the 1-bit per pixel image processed by the OCR Engine itself.

Additional black_threshold options are provided for more sophisticated translations to a bi-tonal image. These include the value 101 which forces a random threshold to be used and the value 102 which directs the OCR Shop XTR to use the Floyd-Steinberg algorithm to determine which pixels are white and which are black.

Adjusting the black_threshold value can significantly affect the OCR Enginehs recognition of image regions.

  • Type: int
  • Range: 0-102
  • Default: 60

dm_in_xres  Input image x resolution.

Input image resolution. This overrides the resolution specified in the file itself.

The minimum resolution recognized by the OCR Engine is 70 dpi and the maximum is 900 dpi.

  • Type: int
  • Default: 300dpi, unless the input image itself specifies its resolution

dm_in_yres  Input image y resolution.

Input image resolution. This overrides the resolution specified in the file itself.

The minimum resolution recognized by the OCR Engine is 70 dpi and the maximum is 900 dpi.

  • Type: int
  • Default: 300dpi, unless the input image itself specifies its resolution

dm_language  Language pack(s) to load.

The parameter is a string with a comma-separated list of language pack names. (see below)

If multiple languages are specified in the dm_language parameter then they all must use the same set of shapes (same Code Page).

To recognize languages that use different sets of shapes on the same page, regions need to have their language specified separately using vvEngAPI::vvSetLexicalConstraints.*

Note: Some languages produce output which is incompatible with some output formats. For example Russian cannot be represented by ASCII text.

Languages with dictionaries: czech, danish, dutch, english, finnish, french, german, greek, hungar (for Hungarian), italian, norsk, polish, port (for Portuguese), russian, spanish, swedish, turkish

Languages without dictionaries: romanian, estonian, afrikaans, albanian, aymara, basque, breton, bulgarian, byelorussian, croatian, faroese, flemish, friulian, gaelic, galician, greenlandic, hawaiian, icelandic, indonesian, kurdishlat, latin, latvian, lithuanian, sorbianl, macedonianc, malaysian, piginenglish, serbian, ukranian, catalan, sbcroatian, slovak, slovenian, swahili, tahitian, sorbianu, welsh, frisianw, zulu

Languages by Shape Pack/Code Page:

  • Baltic (1257): Estonian, Latvian, Hawaiian, Lithuanian
  • Central Europe (1250): Albanian, Polish, Croatian, Romanian, Slovenian, Czech, Serbo-Croatian, Sorbian - Lower, Hungarian, Slovak, Sorbian - Upper
  • Cyrillic (1251): Bulgarian, Macedonian (Cyrillic), Serbian, Byelorussian, Russian, Ukranian
  • Greek (1253): Greek
  • Latin I (1252): Afrikaans, French, Malaysian, Aymara, Frisian - West, Norwegian, Basque, Friulian, Pigin English, Breton, Gaelic, Portugese, Catalan, Galician, Spanish, Danish, German, Swahili, Dutch, Greenlandic, Swedish, English, Icelandic, Tahitian, Faroese, Indonesian, Welsh, Finnish, Italian, Zulu, Flemish, Latin
  • Turkish (1254): Kurdish (Latin), Turkish

Also see the Technical Specifications documentation.

  • Type: string
  • Default: english

See also:
vvEngAPI::vvStartOCRSes

dm_english_chars  Include the english character set.

For use with character sets other than Latin 1. This allows recognition of Latin characters mixed in with a document containing primarily words written in another language and character set.

dm_char_set  Lexical constraint character set.

If set, the OCR engine will only recognize the characters specified in the dm_char_set string. If the document being recognized only contains a few characters specified by this value, the resulting text file will contain characters from the dm_char_set along with the reject_char character for any characters not in the dm_char_set.

Setting to the null string will cause the OCR Engine to not be constrained.

dm_char_set is case-sensitive. For instance, to recognize both uppercase and lowercase d, both must be specified. Because "s" and "5" have similar character shapes, if "s" (or "S") is specified than the number 5 will also be recognized in the output, even if it is not specified.

dm_char_set must be set before the OCR Session is started (see vvEngAPI::vvStartOCRSes).

Also see the character set documentation.

  • Type: string
  • Default: not set

dm_word_lexicon_id  ID number for the word lexicon.

Should be set before a call to vvEngAPI::vvSetLexicalConstraints. Corresponds to the constraintId passed to vvEngAPI::vvAddWordToLexicon.

  • Type: int
  • Range: 0-?
  • Default: 0

More detailed information:

The dm_word_lexicon_id is used in the vvEngAPI::vvSetLexicalConstraints call, and it affects the recognition portion of the processing.

The dm_word_lexicon_id is the id number for the word lexicon, which identifies a group of words as one lexicon. Having multiple lexicon ids permits you to create several lexicons (groups of words), and then set individual regions or pages to use different word lexicons.

The process of using dm_word_lexicon_id is:

  1. Create a word lexicon by calling the function vvEngAPI::vvAddWordToLexicon once for each word in the lexicon, passing: the word to add, the lexicon's id number.

  2. Set dm_word_lexicon_id to the id number for the lexicon you just created.

  3. Set the focus area (region or page) and for a region, set the current region id number.

  4. Call vvEngAPI::vvSetLexicalConstraints to associate the region or page with the word lexicon you just set up. Note that vvSetLexicalConstraints is used to set other lexical properties as well.


dm_format_analysis  Analyze document format to determine layout of output document.

(Note: Turn format analysis off for correct PDF output.)

dm_double_dimension  Double non-square dimensions.

This value is used for non-square images (e.g., faxes which were transmitted at 200x100 dots per inch). When set, the dimensions of each image will be examined and pixels will be doubled in the dimension with the lower resolution.

If the image is already square (i.e., x-dpi equals y-dpi), no doubling is performed.

Should be set prior to calling

Note: this option is an undocumented feature in the ScanSoft engine.

dm_current_region  Current region.

This is the region the engine is currently focused on. All region-specific settings and actions will affect the region specified by this value.

  • Type: int
  • Range: depends on the region ids in the current document
  • Default: REGION_DEFAULTREGION

:


dm_focus_area  Area on which to focus.

All actions and settings will affect the area set here.

dm_pp_remove_halftone  Preprocessing option to remove image regions from output.

When set to vvYes, the OCR Engine removes all image regions from output including halftone and line art regions.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_auto_segment  Preprocessing option to perform auto segmentation.

When set, the OCR Engine performs the analysis to divide the different image and text areas of the document. These areas are referred to as "regions".

Should be set before calling vvEngAPI::vvPreprocess.

See also:
dm_pp_analyze_layout

dm_current_region

vvEngAPI::vvSetRegionProperties



dm_pp_rotate  Preprocessing option to perform a specific rotation.

Explicitly rotate the input image during pre-processing. Non-orthogonal rotation by an arbitrary angle is not supported by this value.

If dm_pp_auto_orient is set to vvCorrect and rotate is set to a non-zero value, the image will be rotated so that it is upright before recognition, even if this differs from the rotate value specified. The only effect of specifying both values is that the OCR Engine will favor the suggested rotation of the rotate value in determining the orientation of the page.

Should be set before calling vvEngAPI::vvPreprocess.

  • Type: int
  • Range: <0|90|180|270>
  • Default: 0

dm_pp_fax_filter  Preprocessing option to use the fax filter.

If the fax filter is set to vvAuto, the fax filter is only applied when needed.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_auto_orient  Preprocessing option to orient the input document automatically.

When this is set to vvCorrect then the image is automatically rotated to correct its orientation. See the note for the dm_pp_rotate variable above.

Should be set before calling vvEngAPI::vvPreprocess.


See also:
dm_auto_flip

dm_pp_invert  Preprocessing option to invert the image data.

When set, the 1-bit per pixel image is inverted, so that white becomes black and black becomes white for use of the image in the recognition process.

This value affects the recognition process; it does not affect output of individual graphics elements.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_newspaper_filter  Preprocessing option to apply newspaper filters.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_deskew  Preprocessing option to automatically deskew image data.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_photometric_interp  Preprocessing option to detect and/or correct the photometric interpretation.

When set, photometric interpretation is performed, i.e., the OCR Engine determines if the input document is overall reverse or normal video. If the document is mostly reverse video, then the OCR Engine will invert the entire image.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_dotmatrix_filter  Preprocessing option to apply the dotmatrix filter.

Used to improve recognition for documents printed by a dot-matrix printer. When set to vvAuto, the dotmatrix filter is only applied if needed.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_autosetdegrade  Preprocessing option to turn on degraded image processing.

This value affects the preprocessing portion of the program, and should be set before the call to vvEngAPI::vvPreprocess.

Setting dm_pp_autosetdegrade to vvYes turns on a preprocessing mode used for particularly degraded images, and will affect how the image is processed, and as a result the recognition results.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_recognition  Preprocessing recognition flag.

This flag is not required to recognize an image.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_segment_lineart  Preprocessing option to detect lineart regions and add them to the halftone mask, detecting it as an image instead of as text.

This will only have an effect if dm_pp_auto_segment is set to vvYes or the dm_pp_remove_halftone is set to vvYes.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_reverse_video  Preprocessing option to detect reverse video regions.

When set to vvYes, this value detects which regions of the page are reverse video so that the OCR Engine will know to invert the image before recognition. This option will affect the output on pages where reverse-video text exists and is detected.

Text will not be recognized in reverse video regions unless this option is set.

Should be set before calling vvEngAPI::vvPreprocess.

dm_pp_analyze_layout  Preprocessing option to analyze the page layout.

Page layout analysis (dm_pp_analyze_layout) is an intentionally flexible option in order to allow a complicated matrix of different desired features in a product that supports both automatic segmentation and manual segmentation.

Page layout analysis can be thought of as part of automatic page segmentation. Most of it runs before recognition (vvEngAPI::vvRecognize) and in conjunction with other preprocessing functions.

Page layout analysis tries to understand the layout of text on the page, the reading order, the structure of the tables, column structure, captions, headers, footers, insets, etc. In addition, page layout analysis changes the regions that were found by automatic page segmentation. However, if automatic page segmentation was not used, page layout analysis can still run; the regions will not get re-ordered or re-formed if certain other settings are set (dm_user_specified_order and dm_user_specified_regions), but they will be analyzed.

If dm_pp_auto_segment is set, then page layout analysis is automatically run (it is considered part of the functionality of automatic page segmentation) unless dm_pp_analyze_layout is specifically turned off. However, if automatic page segmentation is not run, such as when manual page segmentation is used, page layout analysis must be run explicitly if the results from it are needed later. Page layout analysis can be run alone by setting dm_pp_analyze_layout to vvYes and turning off all of the other preprocessing options before calling vvEngAPI::vvPreprocess.

This value should be set before calling vvEngAPI::vvPreprocess.

  • Type: <vvNo|vvYes>
  • Default: depends on other options

dm_auto_flip  Option to automatically flip upside down images.

This option should be set before calling vvEngAPI::vvRecognize.

When called, it causes recognition to be run a second time, after the first time fails because the image is upside down.


See also:
dm_pp_auto_orient

dm_in_filename  Input image filename.

This is the filename of an image to read from disk. Use along with vvEngAPI::vvOpenImageFile.

  • Type: string
  • Default: none

dm_in_curr_page  Current page of the input document.

Use only with input image files which have multiple pages. Set after an image has been opened with vvEngAPI::vvOpenImageFile, and before a page is opened with vvOpenPage.

This is not relevant for image data passed directly to the engine through the vvPutImage function.

  • Type: int
  • Range: 0-99999
  • Default: 0

dm_in_num_pages  Number of pages in the input image document (read-only).

For PDF and PostScript input, the number of pages can not be determined without cycling through each page individually. For these input filetypes, dm_in_num_pages will be set to a very