Row by Row character extraction

1 次查看(过去 30 天)
dream
dream 2014-4-7
I am working on handwritten character recognition from input image. Here is the code which extracts characters from input image
%%Label connected components
[L Ne]=bwlabel(Ifill);
disp(Ne);
%%Measure properties of image regions
propied=regionprops(L,'BoundingBox');
hold on
%%Plot Bounding Box
for n=1:size(propied,1)
rectangle('Position',propied(n).BoundingBox,'EdgeColor','g','LineWidth',2)
end
hold off
%%Characters being Extracted
figure
for n=1:Ne
[r,c] = find(L==n);
n1=imagen(min(r):max(r),min(c):max(c));
imshow(~n1);
end
But this code is extracting characters randomly from the input image. Can anyone please tell me how to extract the characters row by row?
  1 个评论
moahaimen talib
moahaimen talib 2017-5-7
could you please provide the full code? specially the type of input images thank you

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2014-4-7
It's not random. It extracts in column major order like most things in MATLAB. So it goes down column 1, looking for parts of a letter. If it finds one, then it labels it (which may make an incursion into other columns of course) and continues down the column. Then it moves to the next column and goes down looking for letters that have not yet been assigned a label. If it finds one, it labels it. And so on. If you want to go from left to right (or vice versa), then you're going to have to extract a line at a time. Otherwise, it could get the 10th line of handwriting first if that happens to stick out farther to the left than above lines of text. Like line 1 doesn't appear until column 200 but line 10 shows up in column 50, so it would "find" left-most character on the 10th line first.

Community Treasure Hunt

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

Start Hunting!

Translated by