How to delete the border of the edge for character recognition in matlab?
Show older comments
Dear all, i want to do a segmentation of the character from vehicle plate an do recognition with template matching. But after i do some basic step in image processing, the output image has a border so the border is detected as a another character. How to fix it??
Here is my code :
citra=imresize(citra,[400 NaN]);
citra_bw=rgb2gray(citra);
citra_bw= imclearborder(citra_bw);
imshow(citra_bw);
citra_filt=medfilt2(citra_bw,[5 5]);
se=strel('disk',3);
citra_dilasi=imdilate(citra_filt,se);
citra_eroding=imerode(citra_filt,se);
citra_edge_enhacement=imsubtract(citra_dilasi,citra_eroding);
imshow(citra_edge_enhacement);
citra_edge_enhacement_double=mat2gray(double(citra_edge_enhacement));
citra_double_konv=conv2(citra_edge_enhacement_double,[1 1;1 1]);
citra_intens=imadjust(citra_double_konv,[0.5 0.7],[0 1],0.1);
citra_logic=logical(citra_intens);
citra_line_delete=imsubtract(citra_logic(imerode(citra_logic,strel('line',50,0))));
citra_fill=imfill(citra_line_delete,'holes');
citra_thinning_eroding=imerode((bwmorph(citra_fill,'thin',1)),(strel('line',3,90)));
citra_final=bwareaopen(citra_thinning_eroding,125);
imshow(citra_final);
and here is the processed image with the borde in the character http://i1360.photobucket.com/albums/r649/farhat1s/bandung_zpsdcc0e313.png
1 Comment
Matt Kindig
on 1 Aug 2013
Why not just run another imclearborder?
Answers (0)
Categories
Find more on Text Detection and Recognition in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!