mobile real-time recognition sdk at #abbyysummit16
TRANSCRIPT
PowerPoint Presentation
ABBYY TechnologySummit2016Claudio Chaves Jr.Mobile ExpertTransform IT ABBYY Confidential
ABBYY ConfidentialUS AddressReal-Time Capture Mobile App
2
AgendaPhoto vs Real Time RecognitionApp Use Case Scenario - DEMOSteps, Challenges, and SolutionsRTR Sample Project Customization
ABBYY Confidential3
3
My BackgroundData Capture, ECM and BPM platformsProgramming languages: C++,C# and JavaMobile development skills: Objective-C / Swift Mobile OS user: iOS
ABBYY Confidential4
4
Photo vs Real Time Recognition ABBYY Confidential5
Image OCR
Video Stream OCR
5
Photo Recognition Sample ABBYY Confidential6
Required steps in this app:Snap the photoMatch templateFix perspective & crop bordersOCRExtract fields
6
App Use Case ScenarioImplement Real-Time recognition of US address patternsCapture from documents, business cards, menus, etc.Translate address into GPS coordinates and show in the map
ABBYY Confidential7
7
ABBYY Confidential DEMO
Lets take a look at the DEMO
8
9
9
ChallengesGet familiar with Android Studio environmentUnderstand the App flow and its callbacksChoose a US address extractor and Geodecoder
ABBYY Confidential10
10
StepsExtend and customize the existing RTR SDK Sample ProjectDetect US address pattern from captured textGeodecode captured addressShow the address in the map using a markerGet directions from users current location
ABBYY Confidential11
11
RTR Sample Code Customization ABBYY Confidential12Camera ViewMainActivity
IRecognitionServiceMap ViewMapActivity
+GoogleMapGoogle Maps APIgetFromLocationNameLat / LongrecognizedAddress1019 Market St.CA 94103
12
RTR Sample Code CustomizationAdd assets and license file to Android Studio ProjectCustomize existing Main Activity (Camera View)Adjust area of interestAdd US address extractorAdapt important callbacks such as onFrameProcessedAdd a new Activity (Map View)Geodecode the extracted addressShow the marker in the map
ABBYY Confidential13
13
Area of InterestSpecified through margin sizes relative to camera preview size
private int areaOfInterestMargin_PercentOfWidth private int areaOfInterestMargin_PercentOfHeight
ABBYY Confidential14
14
US Address ExtractorPatterns
ABBYY Confidential15
Single lineTwo lines
15
US Address ExtractorGOAL: Find and verify addresses out of arbitrary text like business cards, documents, articles, emails, and moreThis would require an API (e.g. smartystreets.com , OpenCage Geodecoder, etc..)But Ive decided to keep it simple for this demo...Then Ive chosen to use a simple Regex :(AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)\s\b\d{5}(?:-\d{4})?\b
Match: AZ 85705-7598 or AZ 85705
ABBYY Confidential16
16
RTR OnFrameProcessed Callback Returns:
IRecognitionService.TextLine[] linesIRecognitionService.Confidence statusIRecognitionService.Warning warning
ABBYY Confidential17
17
RTR OnFrameProcessed Callback Handle recognized text based on: IRecognitionService.ConfidenceThere are different valid status, such as NotReady, Available, Stable, Verified, TentativelyStable and Tentative. For example:Stable (the result has been stable in the last three or more frames)TentativelyStable (the result has been stable in the last two frames)
ABBYY Confidential18
18
RTR Callback Match Address Regex using IRecognitionService.TextLine[].TextHandle single-line and two-line address patternsStop reading: textCaptureService.stop()Start MapsActivity passing recognizedAddress as a parameter.
ABBYY Confidential19
19
Map ActivityCall getFromLocationName with recognizedAddressGet address locality: getLocality()Add map marker: addMarker()Move map camera: moveCamera()
ABBYY Confidential20
20
App SpecsOperating System:Android Marshmallow, version 6.0Mobile Device:Moto X 2nd genComponents:ABBYY Real-Time Recognition SDK 1Google Maps Android APITestFairy Mobile Beta Testing
ABBYY Confidential21
21
Questions?Claudio Chaves Jr.Transform [email protected] +5511 99277-8015 ABBYY Confidential22
ABBYY Confidential23Thank You! | OBRIGADO