Part 1 – How simple is it ? OCR without Tesseract ? On IOS ? Yeah !!

Let start with a simple design:

Open Xcode and create a new SingleView App. (If you don’t know this … hmm)

You’ll see this (depending on the name of your App) :

 

Not so much …

Let’s add some functions:

First wee need some imports:

 

Thats why we are using CoreML and Vision.

Now we have to create a request:

 

… and a completion handler:

 

If you have some compile-errors: You don’t have the (trained) model – you’ll find it in my repository

Now let’s load an image (from resource) and feed it to our request – we are doing this in viewDidLoad()

 

If you run this (simulator is enough – you will see the recognized character in your debug-view:

Simple – Uhhh !!

 

some remarks:

The trained model (by me) is ONLY for the font “Incosolata” – it’s a free font from Google (downloadable here  or here)

I trained characters “A” .. “Z” (only uppercase) and numbers “0”..”9″.

Later I’ll show you how to train (but that’s not that simple – for some reasons)

You can download the project from my repository at GitHub

Next Part is about TextDetection as Source for OCR

Stay tuned !

Leave a Reply

Your email address will not be published. Required fields are marked *