Created
December 16, 2016 11:42
-
-
Save marchbold/f08bc43aaeb5f9b258dbe4584a41bec5 to your computer and use it in GitHub Desktop.
Simple optical character recognition with the OCR ANE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OCR.service.addEventListener( OCREvent.RECOGNISE, ocr_recogniseHandler ); | |
OCR.service.addEventListener( OCREvent.RECOGNISE_ERROR, ocr_recogniseErrorHandler ); | |
var options:OCROptions = new OCROptions(); | |
options.language = "eng"; | |
options.whitelist = "0123456789.,€$"; | |
var success:Boolean = OCR.service.recognise( image.bitmapData, options ); | |
... | |
private function ocr_recogniseHandler( event:OCREvent ):void | |
{ | |
message( "RECOGNISE: " ); | |
message( event.text ); | |
} | |
private function ocr_recogniseErrorHandler( event:OCREvent ):void | |
{ | |
message( event.type ); | |
} | |
// com.distriqt.OCR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment