DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Real-Time OCR for Mobile Apps With RTR SDK

ABBYY is bringing optical character recognition technology to your phone. This article will tell you how to take their image recognition app for a spin.

Chris Ward user avatar by
Chris Ward
CORE ·
Apr. 17, 17 · Tutorial
Like (6)
Save
Tweet
Share
9.23K Views

Join the DZone community and get the full member experience.

Join For Free

I remember the first time I tried the image recognition technology in the Google translate app, snapping a poster to instantly translate what it said into a language I understood. It was far from perfect, but it was cool, and it showed the potential of what more traditional optical character recognition could be used for.

ABBYY is a long-established company with a history in OCR technologies, but also more expected product lines such as business card readers, invoice scanners, and general purpose OCR products. Their new real-time recognition SDK brings the company into the world of real-time recognition, or to be more precise, bringing the technology to your apps. It’s not an open source SDK, but for early stage ideas, you will probably fall into the free bracket. With support for 46 languages and text on natural backgrounds, hopefully, it’s worth it.

The SDK is available for iOS and Android and there are plenty of examples and getting-started guides, so let’s take it for a spin. I am an Android user, so I will focus on that- sorry!

As is traditional (note, I say this as a professional technical writer, so I am fussy), documentation is a little confusing, but here’s how I got the sample app working:

  1. Download the SDK archive from the rtrsdk.com homepage, not the samples from GitHub as it contains everything you need.
  2. Unarchive that download.
  3. Change applicationId in build.gradle (Module: app).
  4. Copy the AbbyyRtrSdk.license file from License/ into the assets folder.
  5. Change the value of private static final String licenseFileName = "license"; in the MainActivity class to the name of the license file, AbbyyRtrSdk.license.
  6. Copy the assets folder into app/src/main of the sample code folder.
  7. Build and run! You will need to use a real device.

Here are my results:

First, a clear selection of English text, 100% accurate.

Image title


Second, a not-so-clear selection of German text- not too bad.

Image title

You can find more information on using the library in your own application in the official documentation, but here are a couple of useful principles to get you started.

You will need to allow for internet permissions in the Android manifest:

<uses-permissionandroid:name="android.permission.INTERNET"/>

To reduce application size, remove dictionaries from the assets/dictionairies folder, and from the on-screen toggle menu by removing entries in:

privateLanguage[]languages={
Language.English,
Language.German,
};

You can access the text results in the following callback:

@Override
publicvoidonFrameProcessed(ITextCaptureService.TextLine[] lines,
ITextCaptureService.ResultStabilityStatus resultStatus,ITextCaptureService.Warning warning )
{

}

Checking the reliability of the results from resultStatus, an enum value represented by the colored dots in my screenshots above:

enumResultStabilityStatus{
NotReady,
Tentative,
Verified,
Available,
TentativelyStable,
Stable
};

Then, assessing the text from lines, an array of each line of text recognized that also contains details of the bounding rectangle surrounding the text.

And that’s it. The SDK is simple to use, but behind it lies a lot of complex processing that you can take advantage of. It’s currently available in Australia and New Zealand, but by the time you read this, should be available globally.

Software development kit mobile app

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Real-Time Stream Processing With Hazelcast and StreamNative
  • Kubernetes vs Docker: Differences Explained
  • OpenID Connect Flows
  • Differences Between Site Reliability Engineer vs. Software Engineer vs. Cloud Engineer vs. DevOps Engineer

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: