Вопрос

I have this image

Image with Engraved Text

How to OCR it? I know this is very challenging, but I would really appreciate any help.

Это было полезно?

Решение

If you have the time to develop the detection yourself, I would do it roughly like this:

  1. Get 1000 images or so and either OCR them yourself or let the people on Amazon Mechanical Turk do it for you, it will cost virtually nothing. Now you have something to tune your algorithm on and measure how well you are doing.
  2. Like Ryan wrote, play with standard image filters, contrast, color, gauss, etc, manually or with something like http://www.roborealm.com/ . See if you can't find a combination that makes the text really stand out.
  3. Try the libraries again
  4. If the libs still don't work, try to use your knowledge of the picture to split it into separate digits. You know how many digits there should be and roughly how many pixels each should take. Use edge detection or something (perhaps standard OCR feature extraction, together with clustering will give you each digit as a cluster?) to find the digits and split them out separately.
  5. Do standard OCR feature extraction (don't be too creative - use existing libraries or at least read up on what the most common and simple are) on each digit and feed those features, together with the answer you got under 1) into a neural network or a SVM.
  6. Improve your feature set until the machine learning works.

Since you have only ten digits, which are fairly consistent between images, this should work.

Другие советы

I would suggest 2 libraries to get you going:

  1. Tesseract
  2. Emgu CV - comes with loads of examples look for the license plate detection one as a good place to start.

Try playing with the contrast and gamma on the image. All you need is a solid outline on the characters for most libraries. Depending on your performance SLA, you could run through various contrast/gamma scenarios and let the OCR software take a couple of shots at it. Take an aggregate of the results and see if there are any consistencies. This could give you a fairly accurate result long term.

Machine learning (here, using some neutral network) for digits is usually accurate already with minimal training and easy to use.

One DIY approach:

  1. The output from some neural net might be ???1160060060??1??? for the first character. From this you should pick the most commonly appearing (0).

  2. To get the ordering of recognised digits right, use a "moving window", so as if you crop out a tiny part of the width of the image.

  3. Repeat this over the whole width of the image.

The trickiest bit is quite likely about figuring out the space between one digit and the next.

If you're lucky the digits are always the same size (monispaced) and you can decide ahead of time how many pixels you need. Otherwise this can would normally be done in a calibration step before feeding pixels into the neural network.

If the image can be rotated it might actually make sense to have a separate neural network help you figure out the rotation.

Programmers (and me) tried out digit recognition already on Commodore computers in the 1980s! Nowadays, you might find some university AI courses that have tasks similar to this one.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top