Tuesday, July 1, 2014

More iOS and Android programming, and OCR library

In the past month I have followed the book Beginning iOS Programming to build the Bands App, which has many features, such as accessing iPhone's photo album and camera, data storage, sharing band information via email and instant message, searching internet for band information, finding music stores on google map, and using iTunes web service to listen to song previews.

Today I also build my first Android App: the Birthday Calculator. The idea came from a friend, who used to have trouble calculating per person bill for a birthday party, where the person on birthday is free of charge, other people pay. He wanted an App to do the calculation. I did it today, just one day, about 8 hours. It's more just like a Bill calculator, given total bill (plus tax), tip rate, and number of persons, calculate per person bill. When running inside Android simulator, the interface is like this:


The top text box lets one enter the total bill (plus tax). Under this the user can choose from 4 fixed tip rates: 10%, 15%, 20% and 25%.  It also allows the user to enter a customized tax rate, which defaults at 17% when the App initially starts. Under this the user can increase or decrease the number of persons using two buttons, or enter directly in the text box to the right side. The last line in green shows per person bill.  Whenever the user changes anything on the UI, the bill, the tip rate, or the person number, it automatically updates all other fields for the change, so you see all the values instantly update on the interface as you type.

Considerations are made for exception cases. The total bill allows only decimal number input, and there are the cases the user enters something like ".25". When "." is first entered, the number conversion shouldn't crash the App.  The bill should also be limited to at most 2 decimal digits.  The customized tip rate and person number text boxes allow only integer input.  The customized tip rate is limited between 0-99%.  For person number you need to avoid 0, which would lead to divide by 0 error. Listeners are used to monitor keyUP and onFocus events.

A similar calculator is the 9mi web calculator for salary. They are looking for people to make it onto Android and iOS. Feel like I'm ready for that job.

This is the first step towards a new world for me.


== OCR software ==

Another thing, a friend's son wants to build an App with OCR function. A few days ago I did a search on line about OCR library for iOS and Android.

For iOS, the Tesseract OCR iOS library can be used. Tesseract for Android is also available, see here for experience on how to use it.. The Tesseract OCR was developed at HP lab since the 1990s. Between 1995 and 2006 there were few work done, but after that it was improved by google. It is arguably (one of) the most accurate OCR library. It is under the Apache 2.0 license now. Should be handy to use.

When searching for existing OCR products, a quick search on App store using keyword "ocr" found CamScanner, which has 4.5 star rating, but OCR function is available only for premium version, which costs $4.99/month or $49.99 per year.  Most others are not free, like Scanner with OCR by SwissMadeApps, Pixter Scanner OCR by Quanticapps, SmartScan+OCR by AMAXIM APPS, Perfect OCR by Pksoft Inc. etc.  Leadtools OCR Application has 3 star rating and is free. OCR Scanner by Smart Mobile Store is also free. I downloaded these 2 to have a try.

OCR Scanner seems not bad in recognition quality, but it's UI interface is a little off position to the top, so the top header is half covered and can't be seen. There is no way to cancel a conversion in the middle.  It allows 5 free conversions a day.

Leadtools OCR has a more friendly UI, richer functions, can cancel a conversion in the middle. But the recognition quality seems not so satisfying in dim light, and is more sensitive to disturbance.

1 comment:

Shehroz Abbasi said...

Hi Sir, I have read your blog related OCR Scanner and i have impressed that you have shared very informative blog and i am here to share my work which is also related to Android Application Camera Translator with OCR Scanner. Download and Try Camera translator with OCR Scanner

Blog Archive

Followers