Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Ferdev/motion-ocr

Open more actions menu

Repository files navigation

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'

About

A RubyMotion wrapper for the OCR engine Tesseract

Resources

License

Stars

60 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.