tesseract with poor picture resolution - image-processing

I am running fedora 11.
I seek to identify the characters indicating the date on a satellite image, but its resolution was (deliberately?) deteriorated.
The goal is to automate this procedure. For that I use ocr program tesseract.
It works perfectly on my PC with the scans, but in this case it does not work.
Here's what I did:
Address of the image:
(source: meteo.pf)
I convert in tiff format (used by tesseract, (bpp ok))
I use tesseract: tesseract societeir.tif test, but no output.
When I increase the image scaling, the ocr online work, but tesseract not.
Do you have a suggestion?

One suggestion,
Since the date on the image is most likely going to be in the same position and of the same dimension, you can try to cut it out and save it as another image using an image processing tool. I normally would use gimp, but leptonica, imagemagick are other tools that I can think of. The recognition should be better on the new image

Copy the date region into memory, run enhancements on it then run the OCR against it?

Related

Tesseract for License Plate (especially Korean version)

I'm working on my project for License Plate Recognition using OpenCV & Tesseract.
I use OpenCV to change original image to processed image so that Tesseract can read it well.
For example)
Original Image
Processed Image
But the result shows "38다9502"and it recognized 3 to 5.
These situation happens frequently especially when the number is 3 or 5.
Is there any suggestion or solution for it??
You can try retraining tesseract with some of your own data. It looks like a good candidate for simply fine-tuning the model. You may not even need much data, just give it several examples of the digits it is having trouble with.
Instructions for retraining are here: https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseract-4.00
1)First it can be done with few image processing techniques which is mentioned in this link(https://cvisiondemy.com/license-plate-detection-with-opencv-and-python/)
2)Next if it doesn't show any improvement you can try image thresholding which you can go through in this link(https://docs.opencv.org/master/d7/d4d/tutorial_py_thresholding.html)
3)If above steps didn't work ,then try to enlarge your image size.
I solved this question with using multiple models supported by Tesseract.
With Hangul model, I only received accurate information of Hangul word, not Numbers.
However, with English model, I can received accurate information of Numbers.
So I used these models in parallel and it resulted 99% accuracy of LPR.

Difference in Converting bmp images to jpg using paint and OpenCV

I have a bmp image and when i converted the image to jpg image using OpenCV and Paint, the two jpeg images looks same but while doing comparison they are different, even the file sizes are different.
I take the image from this link.
And Saved it on my PC, and then i used mspaint to edit this image and save it as jpeg, the file size of this image is 356kb.
And when i used OpenCV to load the original downloaded bmp image and then saved the image as jpg, then the file size is 408kb.
When i used Beyond Compare to compare these images, the result is as follow:
Can anyone please help me in understanding this.
Why I Want this
Actually one of my colleague is capturing images using a pc application for preparing a database of images, so he is capturing the image using key F3 (Shortcut for capturing image in that software) and then click on File -> Save As -> Change the Type of Image of to JPG and then rename it as 0001---9999.jpg and finally save the image.
The problem with this Software is that if we press the F3 and then Ctrl+S, it saves the file as bmp and with the name as time-stamp.
So what i told my friend that, just click F3 and Ctrl+S (so that he can take many pictures for database) and then i will write a python script which will convert all the bmp files into jpg and rename them from 0000-9999. And this part is completed but then i came to know about the problem i shared above.
The database will be used with OpenCV.
Please suggest the reasons for this.
JPEG compression is a lossy compression. The fact that you have different output sizes already suggests that you have different compression rates. Therefor you cannot expect identical results.
The standard does not specify any quantization precision.
The maths involved in the compression (like the discrete cosine transform) require several approximations. For example how many digits will you use for Pi? How will you approximate cosine?...
All those things may differ between different implementations so even if you have the same compression rate you are not guaranteed to get identical results.
Read https://en.wikipedia.org/wiki/JPEG (and the standards) if you are interested in more details.
So unless you run both images through the same software it is unlikely that you will get what you want. Even in the same software there might be differences.

Image pre-processing in OCR

Our project is all about OCR and base on my research, before performing the character recognition it will go through on pre-processing stage. I know we can use openCV for that but we can't use it base on our rules.
My question is, can someone tells me the step-by-step of pre processing and the best method/algorithm to use.
like what I know,
1.YUVluminace
2.greyscale
3.otsu thresholding
4.Binarization
5.Hough transform
Original Image> YUVluminace> greyscale what's next??
thanks!
In some of my older blog posts, I addressed some parts of your questions:
Binarization on various image qualities from mobile cameras:
http://www.ocr-it.com/guide-to-better-mobile-images-from-cell-phone-camera-for-higher-quality-ocr
Image pre-rpocessing and segmentation for better OCR:
http://www.ocr-it.com/user-scenario-process-digital-camera-pictures-and-ocr-to-extract-specific-numbers
In reality, there is no step-by-step, per my experience. You could use original image for OCR if you wanted to, with means no pre-processing is nessesary. Yes, pre-processing will help, but it depends on the source and type of your images (which you did not specify). For example, a typical office document scanned on a professional scanner with Kofax VRS requires no pre-processing before OCR. Mobile camera image requires a lot of pre-processing. Picture from a parking garage camera will require a lot of pre-processing, but different steps and algorithms from mobile camera picture.
I think decide what is the next major limiting factor in your images, pre-process against it, then look for the next correctable issue.

Make text in image thinner for OCR

I'm making an automated text recognition script with Python on Ubuntu.
I'm using Gocr and the recognition render is too low.
Exemple:
Output: _O4_4E34E_4_O4_
I suppose that the type in the image is too bold, so I'm asking if there is a way to make it thinner using an python library or a linux command.
You probably will need to apply a morphological operation like "erosion" on your image, e.g by using OpenCV. This will make structures thinner. To the cost of the quality, though.
Look here: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_morphological_ops/py_morphological_ops.html

Image Processing Softwares

I need to process the text inside the image. The image is of the meter reading the data.
I tried with NewOcr and few other free online image processing software, but they didnt read the data correctly.
Which are the best image processing softwares(both freeware and shareware) that can read meter data accurately?
PS: I need to get the exact reading from the image processed. So, I cannot afford to handle inappropriate data.
The images which will be processed can be found on this link.
Tesseract perhaps? http://code.google.com/p/tesseract-ocr/ im not sure you will be able to avoid inappropriate data, the OCR will make a mistake eventually and some will slip through.
I suggest you tu use matlab ocr for text recognition. In general for image processing i sugges you image processing MATLAB toolbox

Resources