Need to find the digit of this image

3 Ansichten (letzte 30 Tage)
Abdur Rob
Abdur Rob am 6 Mär. 2023
Beantwortet: Sarvesh Kale am 6 Mär. 2023
I want to extract the number from this image. I used ocr technique to extract the number but could not get the appropriate result. As being new user of matlab, Don't understand how to solve my problem.
Here is my attemps
I = imread("mm.jpg");
ocrResults = ocr(I,Language="seven-segment");
and The ERROR
Error using vision.internal.ocr.validateLanguage
Invalid language character vector. Display valid language character vectors.
Error in ocr>checkLanguage (line 312)
lang = vision.internal.ocr.validateLanguage(modifiedLang, vision.internal.ocr.ocrSpkgInstalled());
Error in ocr>parseInputs (line 224)
[validLanguage, isCustomLanguage] = checkLanguage(userInput.Language);
Error in ocr (line 119)
[roi, hasROI, params] = parseInputs(I,varargin{:});

Antworten (1)

Sarvesh Kale
Sarvesh Kale am 6 Mär. 2023
You can try the following code snippet for detecting digits in image
img = imread('mm.jpeg'); % your image path
ocr_result = ocr(img,[125.5 103.5 87 39],Language="seven-segment"); % this gives the co-ordinates of the bounding box around the digits
% i got the roi values by using the imcrop function
ocr_result.Words % displays the text detected
Iocr = insertObjectAnnotation(i,"rectangle",...
ocr_result.WordBoundingBoxes,ocr_result.Words,LineWidth=5,fontsize=18);
figure ;
imshow(Iocr)
More information on ocr can be found at the following documentation https://in.mathworks.com/help/vision/ref/ocr.html
I hope this helps your query
Thank you

Kategorien

Mehr zu Read, Write, and Modify Image finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by