Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Implementing OCR in Android applications

No description
by

Pjotter Tommassen

on 28 October 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Implementing OCR in Android applications

Implementing OCR in Android applications
An astounding adventure through space and time!
Featuring:
Performed by Pjotter Tommassen
About me! \O/
Superfluous picture!
Programming!
NDA'ed customer
needing OCR!
Exquisite musical tastes!
Also, Android!
Employer!
(www.itude.com)
Hmmm, beer! ^_^
OpenCV
Magic..!

Tesseract!
Native Code!
Introductions!
Conclusions!
What is OCR?
Why would you want it?
What does it have to do with Android?
Nothing really..
Smartphones do have cameras!
Fun implementation details!
Translating this...:
...into this:
or, more realistically..
this..:
...into this:
FOR SCIENCE!!!!!
Or to avoid typing stuff, usability, etc..
Use your
Exclamation marks!
Overview!
byte [] img

What? Also, why?
Java Native Interface!
Writing code in C++ is awesome! ^_^
Performance
Use C(++) libraries in Java/Android projects!
OpenCV
Tesseract
How?
Boring boilerplate! \O/
Right-click on project -> Android -> Add native code
Java side needs native keyword:
C++ side needs weird naming:
Also weird, albeit functional, parameters...
What?
Open (Source) Computer Vision (Library)
Library with all sorts of neat functions relating to:
image processing
computer vision (yes..!)
machine learning
etc!
http://opencv.org
For what purpose?
Find out what regions of the image being processed contain text..
Turn those regions into something resembling books being scanned...
B. Epshtein, E. Ofek, and Y. Wexler. Detecting text in natural scenes with stroke
width transform. In Proc. CVPR, 2010.
Cong Yao, Xiang Bai, Wenyu Liu, Yi Ma, Zhuowen Tu. Detecting Texts of Arbitrary Orientations in Natural Images. In Proc. CVPR, 2012.

What?
Not a cosmic cube :(
Open Source OCR engine developed by HP Labs (at first), and now Google
Built to scan books and such
How?
Boringly!:
TessBaseApi->SetImage (...)
TessBaseApi->Recognize ()
TessBaseApi->GetUTF8Text()
This presentation
Broad strokes overview
Low on code
Link to presentation (and thus stuff referenced) available at the end
Semi-related pictures for those not really interested
Do OpenCV Magic to clarify text!
cv::Mat extractedImg
Get a picture! (Basic Android stuff...)
Extract the text
cv::Mat awesomeImg
STOP!
Example time!
...
cv::cvtColor
cv::equalizeHist
cv::Sobel
cv::Canny
Custom algorithm
(abusing OpenCV)
MAJJESTY
What is this I don't even:')
HANDS
Not as useful without the preprocessing
Accuracy?
Quite!
Doesn't work that well with stylized lettering...
OCR is far too complicated for a 30 or so minute presentation.. :')
http://prezi.com/jdwz8spthvom/
Apply an OCR engine (Tesseract)
Achieve victory!
char* text
€€€€€€€
Make it join the C++-side! (JNI)
Translate it to OpenCV
unsigned char *img
cv::Mat img
http://developer.android.com/training/articles/perf-jni.html
https://code.google.com/p/tesseract-ocr/
mobbl.org
Full transcript