2

I have to extract the text from a video which has latitude-longitude data that looks like the following image:

this

The image is very low resolution and tesseract and online OCR failed to extract the text without any processing. I tried to remove grey background using this, and subtracting grey colour matrix, but it did not produce meaningful output. I converted to HSV to extract the yellow text but again, got no meaningful results.

I was wondering if there is any way I can extract the text. The most promising lead seems to be that the background is greyscale and the text is translucent yellow.

Karan Dwivedi
  • 87
  • 1
  • 3
  • 14
  • You can keep trying various image processing techniques but at a certain level it is going to be extremely hard/near impossible to be able to extract any ocr data. This looks like one of those cases, but if it is really needed to do this then you're just going to have to keep trying various methods. – TheLethalCoder Dec 01 '15 at 14:26
  • the **JPG** compression even more decay this ... you can try to thin the text or extract only peaks of yellow intensities but the image quality is so low it is hard to read even for person ... you can try [simple OCR](http://stackoverflow.com/a/22879053/2521214) I has its advantages over neural network classifiers on low quality or very noisy inputs but do not hold too much high hopes ... – Spektre Dec 01 '15 at 14:56

2 Answers2

1

The main issue with these images is to segment the characters. If they have a fixed place, you are done. (Skip the next paragraph.)

If not, start by locating the voids between the groups of characters by profile analysis, to ease the task. For every group, try to recognize the leftmost character, then skip it to get to the next character, and so on.

Recognition of the characters can be made by straight SAD or SSD comparison with reference characters of the same font.

Do not expect too good results.

1

In general, DPI is just a number, so you can change it (I don't know how in python but there should be a way). Try changing it to 200 or 300 before passing it to the OCR engine. If that didn't help, try re-sizing it 200% in addition to setting the DPI to 300. Also, the best OCR results are for black and white images so try apply images processing on the image to turn it to black and white. I found the following link that might help you with that: Using python PIL to turn a RGB image into a pure black and white image

Community
  • 1
  • 1
David
  • 640
  • 1
  • 7
  • 15
  • "Changing the DPI" for an existing video doesn't make sense. Enlarging won't improve the image quality. Indeed, color doesn't really help here. –  Dec 02 '15 at 12:16
  • Yes. Resizing the image blurs it and doesn't improve recognition – Karan Dwivedi Dec 02 '15 at 18:46
  • Try applying interpolation algorithm such as resample to enhance the resized image. – David Dec 05 '15 at 15:43