Hand written word recognition using Matlab

30 views (last 30 days)
I am working on a hand written word recognition project.
  • With this project, I have collected sample hand written scripts from several different writers. Hence I have obtained different writing styles.
  • For segmentation and labeling the following code is used.
I = imread('1.jpg');
bin_im = imcomplement(out);
bin_im = bwareaopen(bin_im,30);
bw1 = bin_im;
cc = bwconncomp(bw1)
cc.NumObjects
%Label the connected components
[Label,Total]=bwlabel(bw1,8);
%Rectangle containing the region
Sdata=regionprops(Label,'BoundingBox');
for i=1:Total
%Crop all the Images
Img = imcrop(bw1,Sdata(i).BoundingBox);
Name = strcat('Object Number:',num2str(i));
pathname1 = 'C:\Users\sahanpriyanga\Documents\MATLAB\stack\Words';
baseFileName1 = sprintf('Img%d.jpg',i);
fullFileName1 = fullfile(pathname1,baseFileName1);
imwrite(Img,fullFileName1);
end
This is the image that I have used.
With this code there are some problems:
  • The labels are not in sequenceImage of the folder of segmented images
  • The lower case letters “ i ” & “ j ” generate two figures (“ i ” gives ". " and "l" separately )
  • Some letters are segmented incorrectly.
like img5 and img6 in the second figure.
The document only contains 61 characters, but after segmentation it gives 71 images.
For accurate output I need to modify the project to resolve these weaknesses and would like suggestions.
  4 Comments
Jagannathan M
Jagannathan M on 12 Apr 2021
Unrecognized function or variable 'out'.
Error in Untitled (line 2)
bin_im = imcomplement(out);
I'm facing this error can you please help me!?
Image Analyst
Image Analyst on 12 Apr 2021
He must have left out some code. It probably goes something like this:
I = imread('1.jpg');
out = imbinarize(I);
bin_im = imcomplement(out);

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 13 Sep 2015
See http://www.mathworks.com/help/vision/ref/ocr.html#bt548t1-2_1 for how to do OCR with MATLAB. Of course if the letters are too strange, it might not be able to identify them.
  2 Comments
Sahan Priyanga
Sahan Priyanga on 13 Sep 2015
I want to recognize the hand written document which is not inline.
Image Analyst
Image Analyst on 13 Sep 2015
23.4.6.3 Handwriting, Cursive Script Recognition Systems
23.4.6.3.1 Cursive Script, Word Level Recognition, Word Spotting, Language Model
23.4.6.3.2 Cursive Script, Text Line Segmentation, Script Line, Segmentation, Text Line Extraction
23.4.6.3.3 On-Line Cursive Script Recognition Systems
23.4.6.4 On-Line Signatures, Online Signatures
23.4.6.4.1 Off Line Signature Analysis
23.4.6.4.2 Recognition of the Person from Writing, Identification, Authorship, Writer Identification
23.4.6.4.3 Signature Recognition, Surveys, Analysis, Comparisons
Those are papers of research groups who have successfully done and published what you want to do. Needless to say, I don't have their code, so you can ask them for it, or code it up yourself from low level MATLAB functions. Good luck.

Sign in to comment.


Iftahatus Shofwan
Iftahatus Shofwan on 16 Jun 2017
How i can fix this problem, about “ i ” & “ j ” generate two figures (“ i ” gives ". " and "l" separately ). "i" become one figure only. please give me references. thanks
  1 Comment
Image Analyst
Image Analyst on 16 Jun 2017
I thought I did, here in this link.
I'm sure people have worked on and handled cases where the letter is in multiple parts before.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!