hwo to extract numeric value from an image
Show older comments
_I have an image in which I recognise the numeric part using OCR FUNCTION numeric value is lablled with yellow line rectangle I want to extract that numeric value and save in .txt file_

results = ocr(O, 'TextLayout', 'Block');
results.Text
GrayImage = uint8(255 * O);
regularExpr = '\d';
bboxes = locateText(results, regularExpr, 'UseRegexp', true);
digits = regexp(results.Text, regularExpr, 'match');
Idigits = insertObjectAnnotation(GrayImage, 'rectangle', bboxes, digits);
figure;
imshow(Idigits);title('digit image');
*i have used this code to make yellow rectangle box on numbers*
_when i am using_
results.Text
_output is coming_ *JANE IJYRE. 343 but i want only 343*
*'O' is my input binary image*
Accepted Answer
More Answers (1)
praveen rai
on 12 Jun 2018
1 vote
Categories
Find more on Text Detection and Recognition 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!