Project

motion-ocr

0.02
No commit activity in last 3 years
No release in over 3 years
Allows to perform text detection inside images in an easy way.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

MotionOCR

A RubyMotion wrapper for the OCR engine Tesseract.

Installation

First, install the gem:

gem install motion-ocr

Then, reference it in your RubyMotion project Rakefile:

# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'

require 'motion-ocr'

And that's it. Build your project and MotionOCR will be ready for action.

Use

ocr             = Motion::OCR.new
image_with_text = UIImage.imageNamed('phototest.gif').CGImage

ocr.scan(image_with_text) # returns a String containing the detected text in the image

Options

You use your own Tesseract language file (available at https://code.google.com/p/tesseract-ocr/downloads/list).

Put the language file (e.g., spa.traineddata) into your app's ressources/tessdata directory. Then pass the language to MotionOCR:

ocr = Motion::OCR.new language: 'spa'