#include <vvxtrAPI.h>
Public Member Functions | |
| virtual | ~vvEngAPI () |
| Destructor. | |
| virtual vvxtrStatus | vvKill ()=0 |
| Kill the engine. | |
| virtual vvxtrStatus | vvInitInstance ()=0 |
| Initialize OCR engine instance. | |
| virtual vvxtrStatus | vvEndInstance ()=0 |
| End OCR engine instance. | |
| virtual vvxtrStatus | vvStartOCRSes ()=0 |
| Start an OCR session. | |
| virtual vvxtrStatus | vvEndOCRSes ()=0 |
| End an OCR session. | |
| virtual vvxtrStatus | vvStartDoc ()=0 |
| Start an output document. | |
| vvxtrStatus | vvStartDoc (int fileFormat) |
| Start an output document. | |
| virtual vvxtrStatus | vvSpoolDoc ()=0 |
| Spool recognized data to the output doc. | |
| virtual vvxtrStatus | vvEndDoc ()=0 |
| End the output document. | |
| virtual vvxtrStatus | vvAcquireDocMemory (void *memPtr, int bufsize)=0 |
| Get the document output through memory. | |
| virtual vvxtrStatus | vvAcquireDocFile (const char *filename)=0 |
| Get the document output as a file. | |
| virtual vvxtrStatus | vvCaptureSubimage ()=0 |
| Capture a subimage. | |
| vvxtrStatus | vvCaptureSubimage (int regionID) |
| Capture a subimage. | |
| virtual vvxtrStatus | vvAcquireSubimageMemory (void *memPtr, int bufsize)=0 |
| Get the image output through memory. | |
| virtual vvxtrStatus | vvAcquireSubimageFile (const char *filename)=0 |
| Write the image output to a file. | |
| virtual vvxtrStatus | vvOpenImageFile ()=0 |
| Open an input image document in the OCR engine. | |
| vvxtrStatus | vvOpenImageFile (const char *fileName) |
| Open the input image file passed as a parameter. | |
| virtual vvxtrStatus | vvCloseImageFile ()=0 |
| Close the input image file currently open in the OCR engine. | |
| virtual vvxtrStatus | vvReadImageData ()=0 |
| Read image data into the OCR engine. | |
| virtual vvxtrStatus | vvReadImageData (const struct vvxtrImage *img)=0 |
| Read image data into the OCR engine. | |
| virtual vvxtrStatus | vvUnloadImage ()=0 |
| Unload the page of input image data currently loaded in the OCR engine. | |
| virtual vvxtrStatus | vvPreprocess ()=0 |
| Run preprocessing on the currently loaded image page. | |
| virtual vvxtrStatus | vvRecognize ()=0 |
| Run recognition on the currently loaded image page. | |
| virtual vvxtrStatus | vvInitValues ()=0 |
| Initialize engine values. | |
| virtual vvxtrStatus | vvGetStatus (const int key, vvxtr_stdarg *result)=0 |
| Get engine status for the passed key. | |
| vvxtrStatus | vvSetValue (const int key, int value) |
| Set the integer value of the passed key in the engine. | |
| vvxtrStatus | vvSetValue (const int key, char *value) |
| Set the string value of the passed key in the engine. | |
| vvxtrStatus | vvGetValue (const int key, int *result) |
| Get an integer engine value. | |
| vvxtrStatus | vvGetValue (const int key, char **result) |
| Get a character or string engine value. | |
| virtual vvxtrStatus | vvGetState (vvxtr_state *resultState)=0 |
| Get the engine state. | |
| virtual vvxtrStatus | vvGetCond (const vvxtr_cond c, int *result)=0 |
| Get the value of an engine condition. | |
| virtual vvxtrStatus | vvSetHint (vvxtrHint hint, bool set=true) |
| Give the engine more information about its environment to possibly improve performance. | |
| virtual bool | vvGetHint (vvxtrHint hint) |
| Return the current setting of one of the hints. | |
| virtual void | vvSigHUP () |
| A function to call when your client application receives a signal of type SIGHUP. | |
| virtual const char * | vvGetStatusString (vvxtrStatus status=VVXTR_PREVIOUS_ERROR) |
| Returns a string that describes the last error condition, if any detailed information about the error is available. | |
| virtual vvxtrStatus | vvGetVersion (vvxtrVersionLocationEnum loc, const char **ver)=0 |
| Return the version. | |
| virtual vvxtrStatus | vvAddWordToLexicon (const char *word, int constraintId)=0 |
| Add a word to a user lexicon. | |
| virtual vvxtrStatus | vvSetLexicalConstraints (int mode)=0 |
| Set lexical constraints for an area. | |
| virtual vvxtrStatus | vvSetRegionProperties (void)=0 |
| Set region information. | |
| virtual vvxtrStatus | vvForceRegionForeground (int foregroundColor)=0 |
| Explicitly set the foreground photometric interpretation. | |
| virtual vvxtrStatus | vvRemoveRegion (void)=0 |
| Remove a region. | |
Public Attributes | |
| bool | m_hints [vvNumberOfHints] |
| Current hint flags. | |
This class is the interface to using the OCR Shop XTR/API.
Use of the API generally consists of:
| 1. Initialization: |
|
| vvEngAPI::vvInitInstance | Initialize the OCR instance. |
| vvEngAPI::vvStartOCRSes | Start an OCR session, loading appropriate languages. |
| vvEngAPI::vvInitValues | Initialize all "values".
|
| 2. Input image recognition: |
|
| vvEngAPI::vvOpenImageFile | Open an input image file (required only for file input). |
| vvEngAPI::vvReadImageData | Read a page of image data into the engine. |
| vvEngAPI::vvPreprocess | Run preprocessing. |
| vvEngAPI::vvRecognize | Run recognition. |
| vvEngAPI::vvUnloadImage | Unload the image data from the engine. |
| vvEngAPI::vvCloseImageFile | Close the input image file (required only for file input).
|
| 3. Output a document: |
|
| vvEngAPI::vvStartDoc | Start an output document. |
| vvEngAPI::vvSpoolDoc | Send data to the output document. |
| vvEngAPI::vvEndDoc | Close the output document. |
| vvEngAPI::vvAcquireDocMemory | Download the output document to an allocated memory block. |
| vvEngAPI::vvAcquireDocFile | Download the output document to a file.
|
| 4. Output a subimage: |
|
| vvEngAPI::vvCaptureSubimage | Create a subimage from the input image. |
| vvEngAPI::vvAcquireSubimageMemory | Download the subimage to an allocated memory block. |
| vvEngAPI::vvAcquireSubimageFile | Download the subimage to a file.
|
| 5. Close down the engine: |
|
| vvEngAPI::vvEndOCRSes | End the OCR session. |
| vvEngAPI::vvEndInstance | End the OCR instance. |
| vvEngAPI::vvKill | Completely shut down the engine. |
Before each action call, the appropriate values should be set in the engine to control the action's functionality.
The actions listed above do not have to be performed in the exact order specified. Please see the detailed description on state and the individual function documentation for more information.
Other API functions exist as well:
Values should be set before they will be used by the engine. Please see the list of engine values and the documentation in vvxtrDefs.h and the sample program.
Set values with the vvEngAPI::vvSetValue function, and read values using vvEngAPI::vvGetValue.
Values are usually strings or numbers. Strings are represented as char *:
Input and output data may always be handled through files or through passed memory blocks.
Input data:
| Condition | Abbreviation | Value | Description |
| C_READY | Re | 0x400 | ready |
| C_OCRSESOPEN | Se | 0x200 | OCR session is open |
| C_OUTDOCOPEN | Ou | 0x100 | output document is open |
| C_FILEOPEN | Fi | 0x080 | input image is open |
| C_IMAGELOADED | Im | 0x040 | input page is open |
| C_PREPROCDONE | Pr | 0x020 | preprocessing has been run on the current page |
| C_RECOGDONE | Rc | 0x010 | recognition has been run on the current page |
| C_DOCREADY | Do | 0x008 | output document is ready for acquisition |
| C_SUBIMAGEREADY | Su | 0x004 | output subimage is ready for acquisition |
| C_ENGINEBUSY | En | 0x002 | engine is currently busy |
| C_ERROR | Er | 0x001 | error |
Conditions of interest: Re| Se| Ou| Fi| Im| Pr| Rc| Do| Su| En| Er 111 1111 1111 = 7FF Required values: !Re|!Se|!Ou| !Fi|!Im|!Pr|!Rc| !Do|!Su|!En|!Er 000 0000 0000 = 000 Change in state: Re|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re|---|---| ---|---|---|---| ---|---| En| Er 100 0000 0011 = 403 Required values: Re|---|---| ---|---|---|---| ---|---|!En|!Er 100 0000 0000 = 400 Change in state: !Re|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---|---|---|---| ---|---| En| Er 110 0000 0011 = 603 Required values: Re|!Se|---| ---|---|---|---| ---|---|!En|!Er 100 0000 0000 = 400 Change in state: ---| Se|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---|---|---|---| ---|---| En| Er 110 0000 0011 = 603 Required values: Re| Se|---| ---|---|---|---| ---|---|!En|!Er 110 0000 0000 = 600 Change in state: ---|!Se|---| ---|---|---|---| !Do|---|---|---
Conditions of interest: Re| Se| Ou| ---|---|---|---| ---|---| En| Er 111 0000 0011 = 703 Required values: Re| Se|!Ou| ---|---|---|---| ---|---|!En|!Er 110 0000 0000 = 600 Change in state: ---|---| Ou| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se| Ou| ---| Im| Pr| Rc| ---|---| En| Er 111 0111 0011 = 773 Required values: Re| Se| Ou| ---| Im| Pr| Rc| ---|---|!En|!Er 111 0111 0000 = 770 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se| Ou| ---|---|---|---| ---|---| En| Er 111 0000 0011 = 703 Required values: Re| Se| Ou| ---|---|---|---| ---|---|!En|!Er 111 0000 0000 = 700 Change in state: ---|---|!Ou| ---|---|---|---| Do|---|---|---
Conditions of interest: Re| Se| Ou| ---|---|---|---| Do|---| En| Er 111 0000 1011 = 70B Required values: Re| Se| Ou| ---|---|---|---| Do|---|!En|!Er 110 0000 1000 = 608 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se| Ou| ---|---|---|---| Do|---| En| Er 111 0000 1011 = 70B Required values: Re| Se| Ou| ---|---|---|---| Do|---|!En|!Er 110 0000 1000 = 608 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---| Im| Pr| Rc| ---|---| En| Er 110 0111 0011 = 673 Required values: Re| Se|---| ---| Im| Pr| Rc| ---|---|!En|!Er 110 0111 0000 = 670 Change in state: ---|---|---| ---|---|---|---| ---| Su|---|---
Conditions of interest: Re| Se|---| ---|---|---|---| ---| Su| En| Er 110 0000 0111 = 607 Required values: Re| Se|---| ---|---|---|---| ---| Su|!En|!Er 110 0000 0100 = 604 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---|---|---|---| ---| Su| En| Er 110 0000 0111 = 607 Required values: Re| Se|---| ---|---|---|---| ---| Su|!En|!Er 110 0000 0100 = 604 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| Fi|---|---|---| ---|---| En| Er 110 1000 0011 = 683 Required values: Re| Se|---| !Fi|---|---|---| ---|---|!En|!Er 110 0000 0000 = 600 Change in state: ---|---|---| Fi|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| Fi| Im|---|---| ---|---| En| Er 110 1100 0011 = 6C3 Required values: Re| Se|---| Fi|!Im|---|---| ---|---|!En|!Er 110 1000 0000 = 680 Change in state: ---|---|---| !Fi|---|---|---| ---|---|---|--- Change in state: ---|---|---| Fi|---|---|---| ---|---|---|--- Change in state: ---|---|---| Fi|---|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| Fi| Im|---|---| ---|---| En| Er 110 1100 0011 = 6C3 Conditions of interest: Re| Se|---| Fi| Im|---|---| ---|---| En| Er 110 1100 0011 = 6C3 Conditions of interest: Re| Se|---| Fi| Im|---|---| ---|---| En| Er 110 1100 0011 = 6C3 Required values: Re| Se|---| Fi|!Im|---|---| ---|---|!En|!Er 110 1000 0000 = 680 Change in state: ---|---|---| ---| Im|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---| Im|---|---| ---|---| En| Er 110 0100 0011 = 643 Required values: Re| Se|---| ---|!Im|---|---| ---|---|!En|!Er 110 0000 0000 = 600 Change in state: ---|---|---| ---| Im|---|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---| Im|---|---| ---|---| En| Er 110 0100 0011 = 643 Required values: Re| Se|---| ---| Im|---|---| ---|---|!En|!Er 110 0100 0000 = 640 Change in state: ---|---|---| ---|!Im|!Pr|!Rc| ---|---|---|---
Conditions of interest: Re| Se|---| ---| Im|---|---| ---|---| En| Er 110 0100 0011 = 643 Required values: Re| Se|---| ---| Im|---|---| ---|---|!En|!Er 110 0100 0000 = 640 Change in state: ---|---|---| ---|---| Pr|---| ---|---|---|---
Conditions of interest: Re| Se|---| ---| Im| Pr|---| ---|---| En| Er 110 0110 0011 = 663 Required values: Re| Se|---| ---| Im| Pr|---| ---|---|!En|!Er 110 0110 0000 = 660 Change in state: ---|---|---| ---|---|---| Rc| ---|---|---|---
Conditions of interest: Re| Se|---| ---|---|---|---| ---|---| En| Er 110 0000 0011 = 603 Required values: Re| Se|---| ---|---|---|---| ---|---|!En|!Er 110 0000 0000 = 600 Change in state: ---|---|---| ---|---|---|---| ---|---|---|---
^ |
vvEndInstance | | vvInitInstance
| |
| V
C_READY
^
| vvStartOCRSes
| vvEndOCRSes
V
C_READY vvStartDoc C_READY
-----------> C_OCRSESOPEN <--------------------------> C_OCRSESOPEN <--------
| | ^ vvEndDoc C_OUTDOCOPEN |
| | | ^ | |
| | | | | |
| vvRead | | vvOpenImageFile | | vvRead |
| Image | | vvCloseImageFile | | Image |
| Data*| | | | Data* |
| | V V | |
| | C_READY vvStartDoc C_READY | |
|---------------|-> C_OCRSESOPEN <-----------> C_OCRSESOPEN <-|---------------|
| | C_FILEOPEN vvEndDoc C_FILEOPEN | |
| | | C_OUTDOCOPEN | |
| | | | | |
| | | | | |
|vvUnloadImage | |vvReadImageData* vvReadImageData*| | vvUnloadImage|
| | | | | |
| | | | | |
| V V V V |
| C_READY vvStartDoc C_READY |
|------------ C_OCRSESOPEN <--------------------------> C_OCRSESOPEN ---------|
| (C_FILEOPEN) vvEndDoc (C_FILEOPEN) |
| C_IMGLOADED C_IMGLOADED |
| | C_OUTDOCOPEN |
| | | |
| | vvPreprocess vvPreprocess | |
| | | |
| V V |
| C_READY C_READY |
| C_OCRSESOPEN vvStartDoc C_OCRSESOPEN |
|----------- (C_FILEOPEN) <--------------------------> (C_FILEOPEN) ----------|
| C_IMGLOADED vvEndDoc C_IMGLOADED |
| -> C_PREPROCDONE C_PREPROCDONE |
| | ^ ^ | C_OUTDOCOPEN <- |
| | | | | | ^ ^ | |
| --- | | | | --- |
| | | | | |
| vvPreprocess | | vvRecognize vvRecognize | |vvPreprocess |
| | | | | |
| | V V | |
| C_READY C_READY |
| C_OCRSESOPEN vvStartDoc C_OCRSESOPEN |
----------- (C_FILEOPEN) <--------------------------> (C_FILEOPEN) ---------
C_IMGLOADED vvEndDoc C_IMGLOADED
C_PREPROCDONE C_PREPROCDONE
C_RECOGDONE C_RECOGDONE
| ^ C_OUTDOCOPEN
| | | ^
-- ---
vvRecognize vvSpoolDoc
vvRecognize
vvEngAPI::vvAcquireDocFile and vvEngAPI::vvAcquireDocMemory may be called at any time C_OUTDOCOPEN is false, C_READY is true, and C_OCRSESOPEN is true. However, it will only be meaningful if an output document has been created through vvEngAPI::vvStartDoc and vvEngAPI::vvEndDoc.
vvEngAPI::vvAcquireSubimageFile and vvEngAPI::vvAcquireSubimageMemory may be called at any time C_READY is true and C_OCRSESOPEN is true. However, it will only be meaningful if an output subimage has been created through vvEngAPI::vvCaptureSubimage.
Definition at line 426 of file vvxtrAPI.h.
|
|
Destructor.
Definition at line 434 of file vvxtrAPI.h. |
|
|
Get the document output as a file. Call this function after you have created an output document through the calls to vvEngAPI::vvStartDoc, vvEngAPI::vvSpoolDoc, and vvEngAPI::vvEndDoc. You must end the output document before you acquire it through this function. This function writes the document output to a file, as specified by the passed filename. If the file already exists, it will be overwritten.
Referenced by outputDoc(). |
|
||||||||||||
|
Get the document output through memory. Call this function after you have created an output document through the calls to vvEngAPI::vvStartDoc, vvEngAPI::vvSpoolDoc, and vvEngAPI::vvEndDoc. You must end the output document before you acquire it through this function. You are responsible for allocating the memory passed to this function, and you are responsible for deleting the memory in your client program. Allocate memory before calling this function, using the size obtained through finding the dm_doc_memory_size data value, then pass a pointer to the allocated memory. The buffer size (bufsize) you pass should correspond to both dm_doc_memory_size and the amount of memory you allocated.
Referenced by outputDoc(). |
|
|
Write the image output to a file. After capturing a subimage, you can obtain the image data as a file by calling this function. If the file already exists, it will be overwritten.
Referenced by outputImg(). |
|
||||||||||||
|
Get the image output through memory. After capturing a subimage, you can obtain the image data through memory by calling this function. You are responsible for allocating and later deleting the memory in the passed buffer.
Referenced by outputImg(). |
|
||||||||||||
|
Add a word to a user lexicon. Multiple words may be added to a user lexicon. Words will be grouped into lexicons based on the constraintId. The constraintId should be used to set the dm_region_lexical_constraint_id or the dm_word_lexicon_id. The constraintId is associated with a page or a region through vvEngAPI::vvSetLexicalConstraints.
|
|
|
Capture a subimage. This is a helper function that sets the current region to the passed regionID, before calling vvEngAPI::vvCaptureSubimage. (It automatically calls vvSetValue() for dm_current_region.)
Definition at line 685 of file vvxtrAPI.h. References dm_current_region, vvCaptureSubimage(), vvSetValue(), vvxtr_stdarg, and vvxtrStatus. |
|
|
Capture a subimage. This function is the first step in obtaining image data for output. First, set which region you wish to capture using the value dm_current_region. Then call this function. After this function completes, you can obtain the requested image data through vvEngAPI::vvAcquireSubimageFile or vvEngAPI::vvAcquireSubimageMemory.
Referenced by outputImg(), and vvCaptureSubimage(). |
|
|
Close the input image file currently open in the OCR engine. This function closes the currently open input image file, releasing the engine to open another input image file in the future. This function must be called while an image file is open (image files are opened with the function vvEngAPI::vvOpenImageFile); you should not call this function if you are reading image data directly from memory rather than from an input file. Note that before the image file may be closed, you must unload any currently loaded page of image data with a call to vvEngAPI::vvUnloadImage.
Referenced by processOneDocument(). |
|
|
End the output document. After you are done spooling output and are ready to acquire your output, you end the output document by calling this function. At this point, you can no longer spool to the output, and you can call vvEngAPI::vvAcquireDocMemory or vvEngAPI::vvAcquireDocFile in order to acquire a copy of the output document in your client program. After vvEndDoc is called, the output document will remain in the engine until a new output document is started or the session is ended. Memory management for the output document is handled internally in the engine; you do not need to be concerned with it in relation to this function.
Referenced by outputDoc(). |
|
|
End OCR engine instance.
Referenced by runOCR(). |
|
|
End an OCR session.
Referenced by runOCR(). |
|
|
Explicitly set the foreground photometric interpretation. Sets the photometric interpretation of the current region and processes the image to match the set interpretation. If the passed foreground color matches the current setting, the image within the region remains unchanged, otherwise, the image within the region is inverted in order to agree with the passed color. This function assumes the photometric interpretation is correct prior to the function call. This function does not affect image output. Uses the value of: dm_current_region
|
|
||||||||||||
|
Get the value of an engine condition.
|
|
|
Return the current setting of one of the hints.
Definition at line 1027 of file vvxtrAPI.h. References m_hints. |
|
|
Get the engine state.
|
|
||||||||||||
|
Get engine status for the passed key.
|
|
|
||||||||||||
|
Get a character or string engine value.
Definition at line 972 of file vvxtrAPI.h. References vvGetValue(), vvxtr_stdarg, and vvxtrStatus. |
|
||||||||||||
|
Get an integer engine value.
Definition at line 959 of file vvxtrAPI.h. References vvxtr_stdarg, and vvxtrStatus. Referenced by outputDoc(), outputImg(), processOneDocument(), and vvGetValue(). |
|
||||||||||||
|
Return the version.
|
|
|
Initialize OCR engine instance. vvInitInstance should be called after starting an OCR session and at any point within an OCR session where you would like to reset the values. It is NOT required to call vvEngAPI::vvInitInstance prior to recognition of every file.
Referenced by runOCR(). |
|
|
Initialize engine values.
Referenced by runOCR(). |
|
|
Kill the engine. vvKill should not normally be called. It is an asynchronous exit, so only use it if you need to exit for an unexpected reason or if the engine hangs.
Referenced by CloseDown(). |
|
|
Open the input image file passed as a parameter. This is a helper function that integrates the vvEngAPI::vvSetValue call in order to implicitely set the value of dm_in_filename. See the documentation for vvEngAPI::vvOpenImageFile.
Definition at line 759 of file vvxtrAPI.h. References dm_in_filename, vvOpenImageFile(), vvSetValue(), vvxtr_stdarg, and vvxtrStatus. |
|
|
Open an input image document in the OCR engine. This function opens an input image document file. A page of the input image document must be still opened before the engine can process any image data. This function should be called once for each input image file. See the list of supported input file formats.
Referenced by openImageDocument(), and vvOpenImageFile(). |
|
|
Run preprocessing on the currently loaded image page. vvEngAPI::vvPreprocess should be called for every new image loaded into the engine, because it is an important step in the OCR process, where the engine segments the image and runs image processing over the image data in order to improve the ultimate OCR results. Preprocessing is separate from recognition so that it can be run multiple times before recognition, if desired. In addition, preprocessing could be run without recognition at all, if for example, someone wanted to extract the image regions from a document but didn't care about recognizing text. However, calling vvEngAPI::vvPreprocess once and then vvEngAPI::vvRecognize once is by far the most common usage. The preprocessing functions used in this step are intended as an aid to optical character recognition during the recognition step, and are not intended to affect or in any way clean up image output you may generate.
Referenced by processOnePage(). |
|
|
Read image data into the OCR engine. This function loads a page of input image data from the passed image structure into the OCR engine. It provides an alternative method for loading image data into the OCR engine, by allowing you to directly place the image data into memory and instead of reading it from a file. After this function call, the loaded image data may be processed with, for example, vvEngAPI::vvPreprocess and then vvEngAPI::vvRecognize. (Note: When this function is used, vvEngAPI::vvOpenImageFile does NOT need to be called first.) Only one page of data can be handled at a time through this function. You are responsible for memory management of the the passed vvxtrImage data structure. Please see vvxtrSample2.cc for an example of using this function.
|
|
|
Read image data into the OCR engine. This function reads one page of the currently open image file and loads it into the OCR engine in preparation for OCR processing. After this function call, the loaded image data may be processed with, for example, vvEngAPI::vvPreprocess and then vvEngAPI::vvRecognize.
Referenced by processOneDocument(). |
|
|
Run recognition on the currently loaded image page. This function runs optical character recognition on the currently loaded image data; it is the step where the image data is converted into text and formatting information internally. When the recognition step is run, the recognized text is stored internally and can be accessed by generating output (see vvEngAPI::vvWriteOutput). Each time vvRecognize is called, the internal buffer of recognized text is cleared before it is written; recognized text from previous calls to vvRecognize is no longer available.
Referenced by processOnePage(). |
|
|
Remove a region. Removes the current region, as specified by the dm_current_region value.
|
|
||||||||||||
|
Give the engine more information about its environment to possibly improve performance. Not all hints will have an effect.
Definition at line 1018 of file vvxtrAPI.h. References m_hints, and vvxtrStatus. Referenced by runOCR(). |
|
|
Set lexical constraints for an area. For a specific area, one or more of these lexical constraints may be set:
The language(s) should be set in the dm_language value. If it is NULL, then the language lexical constraint will not be set. The word list should be set up using vvEngAPI::vvAddWordToLexicon and setting ::dm_wordlist_id to the constraintId passed to the function. If ::dm_wordlist_id is -1, then the word list lexical constraint will not be set. Lexical constraints may be set for the page or for a specific region. Lexical constraints for a specific region will override those set for the page. Specify the area through the value dm_focus_area and dm_current_region (when dm_focus_area == vvFocusAreaRegion).
|
|
|
Set region information. Set properties of the region specified by dm_current_region. A new region may be created by setting region properties for an unused region id. Note that if two regions overlap, one will obscure the other, based on the regions' values for dm_region_stacking.
|
|
||||||||||||
|
Set the string value of the passed key in the engine.
Definition at line 942 of file vvxtrAPI.h. References vvSetValue(), vvxtr_stdarg, and vvxtrStatus. |
|
||||||||||||
|
Set the integer value of the passed key in the engine.
Definition at line 929 of file vvxtrAPI.h. References vvxtr_stdarg, and vvxtrStatus. Referenced by openImageDocument(), outputImg(), processOneDocument(), runOCR(), vvCaptureSubimage(), vvOpenImageFile(), vvSetValue(), and vvStartDoc(). |
|
|
A function to call when your client application receives a signal of type SIGHUP. Will reread any local parameters (does not communicate across a link; use the utility vvlmreread to have a license daemon reread the license file). Definition at line 1037 of file vvxtrAPI.h. |
|
|
Spool recognized data to the output doc. After you recognize text, if you want to retain that text, you must spool it to an output document before running recognition again. Before calling this function, you must start an output document with vvEngAPI::vvStartDoc, and that output document must still be open. You can call vvSpoolDoc multiple times for one output document, and writing output is independent of reading input documents. The output document remains open and you may spool to it until you close it with the function vvEngAPI::vvEndDoc. This function is independent of the output format, or the eventual output destination (file or memory).
Referenced by outputDoc(). |
|
|
Start an output document. Please see the documentation for vvEngAPI::vvStartDoc. This is a helper function that calls vvSetValue to set dm_out_text_format prior to calling vvEngAPI::vvStartDoc()
Definition at line 561 of file vvxtrAPI.h. References dm_out_text_format, vvSetValue(), vvStartDoc(), vvxtr_stdarg, and vvxtrStatus. |
|
|
Start an output document. An output document is handled internally in the engine. You begin it by calling this function, send data to it by calling vvEngAPI::vvSpoolDoc, and end it by calling vvEngAPI::vvEndDoc. The output document can span multiple input files and multiple pages of recognized image data, depending on how much information you would like in your output document. When you call this function, if a previous output document existed, it is no longer available. Memory management for the output document is handled internally throughout the sequence of vvEngAPI::vvStartDoc, vvEngAPI::vvSpoolDoc, and vvEngAPI::vvEndDoc. You do not need to allocate or delete memory until you acquire a completed output document; please see vvEngAPI::vvAcquireDocMemory and vvEngAPI::vvAcquireDocFile.
Referenced by outputDoc(), and vvStartDoc(). |
|
|
Start an OCR session. Sets default lexical constraints for the OCR session based on: This function should be called as a part of the start up process for a set of similar documents, after calling vvEngAPI::vvInitInstance. It may also be called any time after vvEngAPI::vvEndOCRSes, as long as vvEngAPI::vvEndInstance has not been called, ending the current instance. Within one OCR session, internal training is built up on the recognized characters using the language (dictionary) information as reinforcement. This training is sensitive to:
and helps the system recognize deformed characters when it has seen good versions before. Ending and restarting the OCR session flushes this training cache. As a result of the training that takes place within an OCR session, one OCR session should be considered one "job" in the workflow, where the separate input documents of that job are likely to have pages that are related in some sense. Processing of these similar documents should be braketed by calls to vvEngAPI::vvStartOCRSes and vvEngAPI::vvStartOCRSes. It will improve the recognition results to permit training to persist between pages of documents from the same source or rendering environment (printer, carbon tape, toner cartridge, etc). Conversely, it will hurt the recognition results if you train over too much disparate material. When in doubt, it is probably best to err on the side of caution and start and end OCR sessions more frequently rather than less frequently. For example, you could start and end the OCR session after every 10 pages, with additional breaks where you know you should have them.
Referenced by runOCR(). |
|
|
Unload the page of input image data currently loaded in the OCR engine. This function should be called after input image data has been loaded with vvEngAPI::vvReadImageData and after all processing on the image data is complete. No more preprocessing or recognition may be performed after this function is called. However, after this function returns, you can load another page of input image data into the OCR engine by calling vvEngAPI::vvReadImageData again. Calling this function does not affect your output document.
Referenced by processOneDocument(). |
1.3.2