Hand written word recognition using Matlab
24 views (last 30 days)
Show older comments
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148993/image.jpeg)
With this code there are some problems:
- The labels are not in sequenceImage of the folder of segmented images
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148994/image.jpeg)
- 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
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
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);
Answers (2)
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
Image Analyst
on 13 Sep 2015
See this link for algorithms: http://www.visionbib.com/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems
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.
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
on 16 Jun 2017
I'm sure people have worked on and handled cases where the letter is in multiple parts before.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!