image recognition of words

1 view (last 30 days)
Leo
Leo on 13 Jan 2014
Commented: Image Analyst on 13 Jan 2014
Hey, I have a picture which contains both words and numbers. I have made it binary image, so it's just black and white..here is the picture: http://imgur.com/wqMp5Yh
Is there anyone that have a good idea for a code that I can use to manage to detect the numbers and the words.
I am only interesting in the first line where it stands "ONSDAG 02.10.13 17:00" thanks :)

Accepted Answer

Image Analyst
Image Analyst on 13 Jan 2014
What do you mean by "detect"? Do you mean just simple labeling as distinct blobs? Or do you actually want to do OCR? There is no OCR toolbox for MATLAB that I'm aware of. You could write your own which wouldn't be too hard if you have a single, known font.
Or if you just want to extract that line, that's easy. Just sum up the image in the column direction and threshold to find the dashed line. Then take a certain number of lines below that.
verticalProfile = sum(binaryImage, 2);
dashRow = find(verticalProfile < 1000, 1, 'first'); % Or whatever number works.
croppedImage = binaryImage(dashRow + 10 : dashRow + 300); % or whatever numbers work.
  2 Comments
Leo
Leo on 13 Jan 2014
I only want to extract that line. I should probably make a dataset with numbers and letters, So I could compare it to the image. I think it's a really easy task :)
But, when I do your code I only get one, long row with 291 points. I think I understand what you are thinking,, So I have to do this for each pixel column across the picture? But how can I iterate ?
Image Analyst
Image Analyst on 13 Jan 2014
Sorry, forgot the other dimension. Use
croppedImage = binaryImage(dashRow + 10 : dashRow + 300, :);

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!