RSTessOCR - Optical Character Recognition
Information:
RSTessOCR is a port/wrapper for the tesseract-ocr library found here: https://code.google.com/p/tesseract-ocr/.
Requirements:Tesseract is probably the most accurate open source OCR engine available. Combined with the Leptonica Image Processing Library it can read a wide variety of image formats and convert them to text in over 60 languages. It was one of the top 3 engines in the 1995 UNLV Accuracy test. Between 1995 and 2006 it had little work done on it, but since then it has been improved extensively by Google. It is released under the Apache License 2.0.
- Basic4Android Full Version
- Android 2.2+
- RSTessOcr
What will you receive:
- Project
- Library files
- Documentation
- Readme file
Payment:
Payment can be made with Paypal at the following address:
[email protected]
The price of the library is 15 Euros.
After transaction has been made, i'll send the library files to the buyer within 24 hours.
Documentation:
RSTessOcr
Author: XverhelstX
Version: 1
- RSTessOcr
Fields:Methods:
- OEM_CUBE_ONLY As Int
Run Cube only - better accuracy, but slower- OEM_DEFAULT As Int
Default OCR engine mode.- OEM_TESSERACT_CUBE_COMBINED As Int
Run both and combine results - best accuracy- OEM_TESSERACT_ONLY As Int
Run Tesseract only - fastest- VAR_CHAR_BLACKLIST As String
Blacklist of characters to not recognize.- VAR_CHAR_WHITELIST As String
Whitelist of characters to recognize.Properties:
- Clear
Frees up recognition results and any stored image data, without actually
freeing any recognition data that would be time-consuming to reload.
Afterwards, you must call SetImage or SetRectangle before doing any
Recognize or Get* operation.- Initialize (EventName As String, Datapath As String, Language As String)
Initializes the Tesseract engine with a specified language model.
Instances are now mostly thread-safe and totally independent, but some
global parameters remain. Basically it is safe to use multiple
TessBaseAPIs in different threads in parallel, UNLESS you use SetVariable
on some of the Params in classify and textord. If you do, then the effect
will be to change it for all your instances.
EventName:
Datapath: The path to you Tesseract folder. THE FOLDER SHOULD CONTAIN A SUBFOLDER NAMED "tessdata".
Language: The language that should be used. usually "eng".
Returns true on success.- Initialize2 (EventName As String, Datapath As String, Language As String, EngineMode As Int) As Boolean
Initializes the Tesseract engine with a specified language model with the given engine constants..
Instances are now mostly thread-safe and totally independent, but some
global parameters remain. Basically it is safe to use multiple
TessBaseAPIs in different threads in parallel, UNLESS you use SetVariable
on some of the Params in classify and textord. If you do, then the effect
will be to change it for all your instances.
EventName:
Datapath: The path to you Tesseract folder. THE FOLDER SHOULD CONTAIN A SUBFOLDER NAMED "tessdata".
Language: The language that should be used. usually "eng".
Returns true on success.- IsInitialized As Boolean
- MeanConfidence As Int
Returns the mean confidence of text recognition.
Return type: @return:the mean confidence- Release
Closes down tesseract and free up all memory. Release() is equivalent to
destructing and reconstructing your TessBaseAPI.
<p>
Once Release() has been used, none of the other API functions may be used
other than Init and anything declared above it in the class definition.- Scan
Scans the image and raises _Scanned (Text as string)- WordConfidences As Int[]
Returns all word confidences (between 0 and 100) in an array. The number
of confidences should correspond to the number of space-delimited words
in GetUTF8Text().
Return type: @return:an array of word confidences (between 0 and 100) for each
space-delimited word returned by GetUTF8Text()- setImage2 (imagedata() As Byte, width As Int, height As Int, bpp As Int, bpl As Int)
Provides an image for Tesseract to recognize. Copies the image buffer.
The source image may be destroyed immediately after SetImage is called.
SetImage clears all recognition results, and sets the rectangle to the
full image, so it may be followed immediately by a GetUTF8Text, and it
will automatically perform recognition.
imagedata: byte representation of the image
width: image width
height: image height
bpp: bytes per pixel
bpl: bytes per line- setRectangle (left As Int, top As Int, width As Int, height As Int)
Restricts recognition to a sub-rectangle of the image. Call after
SetImage. Each SetRectangle clears the recogntion results so multiple
rectangles can be recognized with the same image.
left: the left bound
top: the right bound
width: the width of the bounding box
height: the height of the bounding box- setVariable (var As String, value As String) As Boolean
Set the value of an internal "variable" (of either old or new types).
Supply the name of the variable and the value as a string, just as you
would in a config file.
<p>
Example: <code>setVariable(VAR_TESSEDIT_CHAR_BLACKLIST, "xyz"); to ignore x, y and z. * setVariable(VAR_BLN_NUMERICMODE, "1"); to set numeric-only mode. * </code>
<p>
setVariable() may be used before open(), but settings will revert to
defaults on close().
var: name of the variable
value: value to set
Return type: @return:false if the name lookup failed
- Debug As Boolean [write only]
Sets debug mode. This controls how much information is displayed in the
log during recognition.- Image As Bitmap [write only]
Provides an image for Tesseract to recognize. Does not copy the image
buffer. The source image must persist until after Recognize or
GetUTF8Chars is called.- InitLanguagesAsString As String [read only]
Returns the languages string used in the last valid initialization.
If the last initialization specified "deu+hin" then that will be
returned. If hin loaded eng automatically as well, then that will
not be included in this list. To find the languages actually
loaded use GetLoadedLanguagesAsVector.- PageSegMode As Int [write only]
Sets the page segmentation mode. This controls how much processing the
OCR engine will perform before recognizing text.
Sample:
You can find an example apk file here:
https://www.dropbox.com/s/ab9c8xbn3ds79a1/RSTessOcr.apk
Note the size of the library is big because of the added language file in the Assets.
When deploying your app with this library, you should download the language file(s) from an external webservice to reduce the apk size (with 20 mb)
Regards,
Tomas