MATLAB Answers

farhat
0

How to extract and recognise the vechile plate number with matlab?

Asked by farhat
on 1 Aug 2013
Latest activity Commented on by Image Analyst
on 28 Oct 2016
I want to develop an matlab program that can extract and recognise the plat number of vechile with templete mactching method. Here is my code..
function letters = PengenalanPlatMobil(citra)
%load NewTemplates
%global NewTemplates
citra=imresize(citra,[400 NaN]); % Resizing the image keeping aspect
ratio same.
citra_bw=rgb2gray(citra); % Converting the RGB (color) image to gray
(intensity).
citra_filt=medfilt2(citra_bw,[3 3]); % Median filtering to remove
noise.
se=strel('disk',1);
citra_dilasi=imdilate(citra_filt,se); % Dilating the gray image with
the structural element.
citra_eroding=imerode(citra_filt,se); % Eroding the gray image with
structural
element.
citra_edge_enhacement=imsubtract(citra_dilasi,citra_eroding);
%Morphological
Gradient for edges enhancement.
imshow(citra_edge_enhacement);
citra_edge_enhacement_double=mat2gray(double(citra_edge_enhacement)); %
Converting the class to double.
citra_double_konv=conv2(citra_edge_enhacement_double,[1 1;1 1]);
%Convolution
of the double image f
citra_intens=imadjust(citra_double_konv,[0.5 0.7],[0 1],0.1);
%Intensity
scaling between the range 0 to 1.
citra_logic=logical(citra_intens); % Conversion of the class from double
to binary.
% Eliminating the possible horizontal lines from the output image of
regiongrow
% that could be edges of license plate.
citra_line_delete=imsubtract(citra_logic,
(imerode(citra_logic,strel('line',50,0))));
% Filling all the regions of the image.
citra_fill=imfill(citra_line_delete,'holes');
% Thinning the image to ensure character isolation.
citra_thinning_eroding=imerode((bwmorph(citra_fill,'thin',1)),
(strel('line',3,90)));
%Selecting all the regions that are of pixel area more than 100.
citra_final=bwareaopen(citra_thinning_eroding,125);
[labelled jml] = bwlabel(citra_final);
% Uncomment to make compitable with the previous versions of MATLAB®
% Two properties 'BoundingBox' and binary 'Image' corresponding to these
% Bounding boxes are acquired.
Iprops=regionprops(labelled,'BoundingBox','Image');
%%%OCR STEP
[letter{1:jml}]=deal([]);
[gambar{1:jml}]=deal([]);
for ii=1:jml
gambar= Iprops(ii).Image;
letter{ii}=readLetter(gambar);
% imshow(gambar);
%
end
end
end

  2 Comments

what is this: function letters = PengenalanPlatMobil(citra)
The poster claims it's "an matlab program that can extract and recognise the plat number of vechile with templete mactching method." Why do you ask?

Sign in to comment.

1 Answer

Answer by Image Analyst
on 1 Aug 2013

We don't know how good, robust, or flexible your algorithm is. You can see published algorithms in Section 16.7.2.5 here: VisionBib. I bet they're a good bit longer than your code.

  0 Comments

Sign in to comment.