OCR (optical character recognition) misreading simple numbers even when image is pre-processed. What’s the issue?
I followed the advice in this ( https://www.mathworks.com/matlabcentral/answers/1955379-ocr-not-recognizing-some-numbers ) forum to pre-process a series of images but my code is still outputting terribly inaccurate results. I make sure to draw the ROI just around the "0.12" and it does not help. Here’s my code and one image:
clc; clear all
I = imread(‘test.jpg’);
I_gray = rgb2gray(I);
I_gray_binary = imbinarize(I_gray);
I_f = medfilt2(I_gray_binary);
[J,roi] = imcrop(I_f);
ocrResults = ocr(I_f,roi,Language=’seven-segment’);
ocrResults.Text
Thanks to anyone who can offer any advice!I followed the advice in this ( https://www.mathworks.com/matlabcentral/answers/1955379-ocr-not-recognizing-some-numbers ) forum to pre-process a series of images but my code is still outputting terribly inaccurate results. I make sure to draw the ROI just around the "0.12" and it does not help. Here’s my code and one image:
clc; clear all
I = imread(‘test.jpg’);
I_gray = rgb2gray(I);
I_gray_binary = imbinarize(I_gray);
I_f = medfilt2(I_gray_binary);
[J,roi] = imcrop(I_f);
ocrResults = ocr(I_f,roi,Language=’seven-segment’);
ocrResults.Text
Thanks to anyone who can offer any advice! I followed the advice in this ( https://www.mathworks.com/matlabcentral/answers/1955379-ocr-not-recognizing-some-numbers ) forum to pre-process a series of images but my code is still outputting terribly inaccurate results. I make sure to draw the ROI just around the "0.12" and it does not help. Here’s my code and one image:
clc; clear all
I = imread(‘test.jpg’);
I_gray = rgb2gray(I);
I_gray_binary = imbinarize(I_gray);
I_f = medfilt2(I_gray_binary);
[J,roi] = imcrop(I_f);
ocrResults = ocr(I_f,roi,Language=’seven-segment’);
ocrResults.Text
Thanks to anyone who can offer any advice! image processing, ocr, computer vision MATLAB Answers — New Questions