Class: Daddy::Ocr

Inherits:
Object
  • Object
show all
Defined in:
lib/daddy/ocr.rb

Class Method Summary collapse

Class Method Details

.scan(image_path) ⇒ Object



4
5
6
7
8
# File 'lib/daddy/ocr.rb', line 4

def self.scan(image_path)
  out = Time.now.strftime("%Y%m%d%H%M%S") + (Time.now.usec / 1000.0).to_s
  system("tesseract #{image_path} tmp/#{out} -l jpn")
  File.read("tmp/#{out}.txt")
end