I started off writing a simple script to read data from an image. Here is my Ruby code that uses RTesseract to read it:
require 'rtesseract'
require 'mini_magick'
RTesseract.configure do |config|
config.processor = "mini_magick"
end
image = RTesseract.new("myImage.jpg")
puts image.to_s
I started off with this image:
The results that came back were: 132B 4
.
I understand that the 0 came back as a B (I can solve that). But the following 3
, 0
, 8
did not return at all. Now I know it already knows how to read a 3 and 0, because it did it in the first number. I figure it had some issues rendering the following numbers, so I made it black and white.
This is the second image I tried:
However the results still came back as: 132B 4
.
Finally I cut the image and just tried the final 3 numbers.
Here is the image:
But when I ran the script, it returned no result. Any thoughts on why I am not able to read the final numbers?
I'm using Ruby 2.2.2, rTesseract 2.1.0 and MiniMagick 4.5.1.
I am using Tesseract 3.04.01