How to extract and recognize the word in each bounding box and save each word in image?

1 view (last 30 days)
i = imread('Cropping_1.jpg'); i1 = rgb2gray(i); imshow(i1);
i2 = edge(i1,'canny',0.3); imshow(i2);
se = strel('square',2); i3 = imdilate(i2,se); imshow(i3);
i4 = imfill(i3,'holes'); imshow(i4);
[Ilabel, num] = bwlabel(i4); disp(num); Iprops = regionprops(Ilabel); Ibox = [Iprops.BoundingBox]; Ibox = reshape(Ibox,[4 20]); imshow(i);
hold on; for cnt = 1:20 rectangle('position',Ibox(:,cnt),'edgecolor','g'); end

Answers (1)

Image Analyst
Image Analyst on 26 Jun 2014
Take a look at this: http://www.mathworks.com/help/vision/ref/ocr.html#bt548t1-2_1 -- OCR in the Computer Vision System Toolbox.
  2 Comments
Image Analyst
Image Analyst on 27 Jun 2014
Maybe your text is too tilted or there is interference with the lines or maybe you just programmed it up incorrectly. I have no idea. Even if you did show me your code, I can't run it because I don't have that toolbox.

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!