OCR low-res image from specified set of characters
Show older comments
Hello all:
Is there a way in which I provide the super set of characters (no characters to be expected outside the set) to the OCR. I mean to say for example if I know that my images has only [U, T, C, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, :, space] as the only characters, can I feed it to matlab OCR and thus expect better predictions.
Can this help somehow on low res image to increase the accuracy?
Kindly see the attached image I am struggling to get good results with.
Thanks much for your attention. Any thoughts will be immensely helpful.
Regards,
Amit
Accepted Answer
More Answers (2)
This exact functionality is available in the ocr function. Use the 'CharacterSet' Name-Value pair to achieve this. Something like this:
ocrResults = ocr(yourImage,'CharacterSet','UTC1234567890')
In your case, you may have even more information that you can supply to the ocr function. If it's a valid assumption that the left half of the image only contains characters, you could have two calls to ocr with different ROI's.
For example (this is pseudo-code),
leftROI = [1 1 floor(size(im,2)/2) size(im,1)-1];
ocrLeftResults = ocr(im, leftROI, 'CharacterSet','UTC');
rightROI = [floor(size(im,2)/2)+1 1 floor(size(im,2)/2) size(im,1)-1];
ocrRightResults = ocr(im, rightROI, 'CharacterSet', '0123456789');
5 Comments
Image Analyst
on 8 Feb 2016
What does it do if it finds a garbled character that isn't much like any of the ones you supplied? Does it assign the closest one, or assign some other value to it, like a nan or something?
Anand
on 8 Feb 2016
The closest match from within the 'CharacterSet' is used. This means, it will assign the closest character from the set.
Amit
on 10 Feb 2016
Amit
on 21 Feb 2016
0 votes
Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!