Sha256: cca830f609cab722bbbeac9c6e352acb2e0f0849e25a430a490843a587313dc7

Contents?: true

Size: 1.75 KB

Versions: 4

Compression:

Stored size: 1.75 KB

Contents

= rtesseract
{<img src="https://badge.fury.io/rb/rtesseract.png" alt="Gem Version" />}[http://badge.fury.io/rb/rtesseract]

Ruby library for working with the Tesseract OCR.

== REQUIREMENTS:

To work properly rtesseract are needed:
* Tesseract - Program
* ImageMagic - Program
* RMagick or mini_magick - Gem

Atention: Version 1.0.0 works fine with Ruby 2.0 and tesseract 3.0 and lower versions of rtesseract works fine with Ruby 1.8 and tesseract 2.0.4.

== EXAMPLE USAGE

It's very simple to use rtesseract:

=== CONVERT IMAGE TO STRING

  image = RTesseract.new("my_image.jpg")
  image.to_s #Getting the value

=== CHANGE THE IMAGE

  image = RTesseract.new("my_image.jpg")
  image.source = "new_image.png"
  image.to_s

=== TRANSFORM THE IMAGE

  image = RTesseract.read("my_image.jpg") do |img|
    img = img.white_threshold(245)
    img = img.quantize(256,Magick::GRAYColorspace)
  end
  image.to_s

=== CONVERT PARTS OF IMAGE TO STRING

  mix_block = RTesseract::Mixed.new("test.jpg") do |image|
    image.area(28,  19, 25, 25)
    image.area(180, 22, 20, 28)
    image.area(218, 22, 24, 28)
    image.area(248, 24, 22, 22)
  end
  mix_block.to_s

  OR

  mix_block = RTesseract::Mixed.new("test.jpg",{:areas => [
    {:x => 28,  :y=>19, :width=>25, :height=>25 },
    {:x => 180,  :y=>22, :width=>20, :height=>28},
    {:x => 218,  :y=>22, :width=>24, :height=>28},
    {:x => 248,  :y=>24, :width=>22, :height=>22}
  ]})
  mix_block.to_s

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Send me a pull request. Bonus points for topic branches.

== Links

* Github - http://github.com/dannnylo/rtesseract
* Rubygems - http://rubygems.org/gems/rtesseract

== Copyright

Copyright (c) 2013 Danilo Jeremias da Silva. See LICENSE for details.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rtesseract-1.0.5 README.rdoc
rtesseract-1.0.4 README.rdoc
rtesseract-1.0.3 README.rdoc
rtesseract-1.0.2 README.rdoc