require a code for automatic licencse plate recognition of vehicles.

Hi...
I am doing a project on the concept of AUTOMATIC NUMBER PLATE RECOGNITION (ANPR) using matlab using artificial neural network for OCR(Optical Character Recognition). here we initially take an image of car number plate or license plate and perform Image enhancement, Image Segmentation and Character Recognition process to display the license plate characters as output of matlab code. I have executed half of the matlab code till dilation process and have got output successfully.. now I have the entire code of the project but I am getting an error and I am unable to remove it.. so can u please suggest ways to remove it or can u please correct that code... or can u please help me in writing a new code regarding this project... or if u have any ideas.. can u please send me the code...
fi = imread('noplate.jpg');
%imshow(fi)
fin = rgb2gray(fi);
imshow(fin);
d=double(fin)
%imshow(fin)
[r c]= size(d)
% Mexican filter operator
filter = [ 0 0 0 -1 -1 -1 0 0 0 ;
0 -1 -1 -3 -3 -3 -1 -1 0;
0 -1 -3 -3 -1 -3 -3 -1 0;
-1 -3 -3 6 13 6 -3 -3 -1;
-1 -3 -1 13 24 13 -1 -3 -1;
-1 -3 -3 -6 13 6 -3 -3 -1;
0 -1 -3 -3 -1 -3 -3 -1 0;
0 -1 -1 -3 -3 -3 -1 -1 0;
0 0 0 -1 -1 -1 0 0 0 ];
% creating image matrix for mexican hat operator
gm = zeros(r,c);
for i=5:2:r-5
for j=5:2:c-5
gm(i,j) = sum(sum(double(fin(i-4:i+4,j-4:j+4)).*filter,2));
end;
end;
% removing the unwanted edges by using a threshold
fh = gm>1200;
%Dilation operation
x = 1;
y =1;
fs = double(fh);
se = ones(3,3);
for x= 3:3:r-20
for y = 3:3:c-20
if(x+50<=r)
xend = x+50;
else
xend = r;
end;
if(y+100<=r)
yend = y + 150;
else
yend = c;
end;
if(sum(fh(x:xend,y))<=35||sum (fh(x,y:yend,2)<=60))
if(sum(fh(x,y:y+3),2)<=3) && (sum(fh(x,y:y+3),2)>2)
fs(x-2:x+2,y-2:y+2)=bwmorph(fh(x-2:x+2,y-2:y+2),'dilate',se);
end;
end;
end;
end;
%imshow(fin)
%image with dilation performed
f=double(fs);
[row col]=size(f);
%initialising a matrix for a segmented image
g=zeros(row,col);
gl=zeros(row,col);
label=1;
n=1;
x=1;
iter=[];
it=0;
ss_prev=0;
nn=[];
sss_mat=[];
for i=1:2:row
for j=1:2:col
r_pt=i;
c_pt=j;
if(g(r_pt,c_pt)==0)
while(true)
|%using 4 neighbour rule|
if(f(r_pt(n),c_pt(n))==1 && g(r_pt(n),c_pt(n))==0)
g(r_pt(n),c_pt(n))=label;
if(r_pt(n)+1<=row)
if(f(r_pt(n)+1,c_pt(n))==1)
r_pt=[r_pt r_pt(n)+1];
c_pt=[c_pt c_pt(n)];
x=x+1;
end;
end;
if(c_pt(n)-1>=1)
if(f(r_pt(n),c_pt(n)-1)==1)
r_pt=[r_pt r_pt(n)];
c_pt=[c_pt c_pt(n)-1];
x=x+1;
end;
end;
if(c_pt(n)+1<=col)
if(f(r_pt(n),c_pt(n)+1)==1)
r_pt=[r_pt r_pt(n)];
c_pt=[c_pt c_pt(n)+1];
x=x+1;
end;
end;
if(r_pt(n)-1>=1)
if(f(r_pt(n)-1,c_pt(n))==1)
r_pt=[r_pt r_pt(n)-1];
c_pt=[c_pt c_pt(n)];
x=x+1;
end;
end;
end;
if(n>=x)
break;
end;
n=n+1;
end;
y1=min(r_pt);
y2=max(r_pt);
x1=min(c_pt);
x2=max(c_pt);
a1=g(min(r_pt):max(r_pt),min(c_pt):max(c_pt));
f1=d(min(r_pt):max(r_pt),min(c_pt):max(c_pt));
[ra ca]=size(a1);
| if(n>=50)|
b1=bwlabel(a1);
ss=regionprops(b1,'euler number');
sss=struct2array(ss);
sss=min(sss);
sss_mat=[sss_mat sss];
if(sss<ss_prev && sss<0 && ca <=190 && ra<=60 && ca>=50 && ra >=15 && mean(mean(f1))<=220)
x_cor1=x1;
y_cor1=y1;
x_cor2=x2;
y_cor2=y2;
ss_prev=sss;
end;
label=label+1;
else
g(r_pt,c_pt)=0;
end;
end;
x=1;
n=1;
it=1;
end;
end;
if(exist('y_cor1')==1)
d(y_cor1:y_cor1+2,x_cor1:x_cor2)=255;
d(y_cor2:y_cor2+2,x_cor1:x_cor2)=255;
d(y_cor1:y_cor2,x_cor1:x_cor1+2)=255;
d(y_cor1:y_cor2,x_cor2:x_cor2+2)=255;
end;
% Segmented licence plate image
d=mat2gray(d);
|lp=d(y_cor1:y_cor2,x_cor1:x_cor2);|
%%%2. Character Segmentation
%License plate image, characters of wcich are to be segmented
lp1 = d(y_cor1:y_cor2,x_cor1:x_cor2);
[rl cl] = size(lp1);
% Median Filtering
lp = medfilt2(lp1,[3 3]);
% Contrast Enhancement
lpf = imadjust(lp,stretchlim(lp,[0.1 0.5]));
%creating output image matrix
output= zeros(rl,cl);
% Window for local threshold operation
dis = round(cl/7);
% Local threshold operation
for i=1:dis:cl
if(i+dis-1<=cl)
t=threshcal(lpf(:,i:i+dis-1),a);
for i=1:dis:cl
if(i+dis-1<=cl)
t=threshcal(lpf(:,i:i+dis-1),a);
output(:,i:i+dis-1)=lpf(:,i:i+dis-1)<=t;
else
t=threshcal(lpf(:,i:cl),a);
for z1=2:rl-1
for z2=i+5:cl-5
if(mean(mean(lpf(z1-1:z1+1,z2-5:z2+5)))<=t)
output(z1,z2)=1;
end;
end;
end;
output(:,i:cl)=lpf(:,i:cl)<=t;
end;
end;
end;
end;
% Structuring element for erosion operation
se = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
output = output - imerode(output,se);
[of lab lpdet] = reggrowl(logical(output),number);
% Segmented characters
lpdet = logical(lpdet);
% Character Recognition
% output String giving licence plate information
lpstr=[];
for i= 1:lab-1
R = lpdet(:,st:st+9);
st = st+10;
b = bwlabel(R);
% Feature extraction
ar = struct2array(regionprops(b,'area'));
or = struct2aarray(regionprops(b,'orientation'))/90;
eu = struct2array(regionprops(b,'eulernumber'))/10;
pe = struct2array(regionprops(b,'perimeter'));
mi = struct2array(regionprops(b,'minoraxislength'));
ma = struct2array(regionprops(b,'majoraxislength'));
temp = logical(R);
% Reflection X and Y coefficient determination
v1 = temp;
v1(:,6:10)=flipdim(temp(:,1:5),2);
vx = (v1 + temp)/2;
vx = vx>=0.5;
xcoef = sum(sum(temp),2)/sum(sum(vx),2);
v2 = temp;
v2(1:12,:) = flipdim(temp(13:24,:),1);
vy = (v2 + temp)/2;
vy = vy >= 0.5;
ycoef = sum(sum(temp),2)/sum(sum(vy),2);
ed = struct2array(regionprops(b,'equivdiameter'))/100;
[val pos] = max(fa);
vcoeff = pe(pos)/ar(pos);
mcoeff = ed(pos);
Rp = [xcoef/ycoef;pe(pos)/ar(pos);mi(pos)/ma(pos)];
answer=find(compet(A2)==1);
if(i<=numel(lpnum))
if(alphamat(answer)==lpnum(i))
numrc = numrc+1;
else
answ = find(alphamat==lpnum(i));
err(answ) = err(answ) + 1;
end;
end;
lpstr = [lpstr alphamat(answer)];
end;
numc = numc + numel(lpnum);
if(strcmp(lpstr,lpnum)==1)
tr = tr + 1;
sr = strcat(num2str(num),'/',num2str(1),'//');
casep = [casep sr];
else
fr = fr +1;
sr = strcat(num2str(num),'/',num2str(1),'/',num2str(answer),'//');
casen = [casen sr];
end;
Thanking you, With regards, Rakshitha

12 comentarios

http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
It makes it easier for us if you tell us what error you see, on which line. We do not have your images, so we cannot run the program to see the results ourselves.
You say "I am getting an error and I am unable to remove it" - well apparently you did remove it from your question. We have no idea what the error is because you didn't include it.
Sir I am getting the error as
"??? Undefined function or variable 'y_cor1'.
Error in ==> prog_part1 at 152
lp=d(y_cor1:y_cor2,x_cor1:x_cor2);"
May be the actual problem may lie in the Neighbour rule loop.. because variable 'x' is not getting incremented (donno why 'x' is not satisfying any condition) and hence may satisfy 108th line
if(n>=x)
break;
and ends in break.. so the next 'if' loop of line 120 may not satisfy and the further inner loops line 126
if(sss<ss_prev && sss<0 && ca <=190 && ra<=60 && ca>=50 && ra >=15 && mean(mean(f1))<=220)
may not be working... may be it not entering the main 'if' loop of line 120 itself and hence that loop may not be working... I am not sure whether this is the reason or not.. plese help me in getting the output through this code as early as possible because i have vry less time for implementation.
Input image can be any image of a number plate or licencse plate of a car.
Can you learn how to use the debugger to set breakpoints and step through your code to find out why loops are not getting entered, variables aren't getting assigned and are undefined/empty? That is FAR more efficient than asking us to do that for you. You will discover problems with your code faster that way than posting here and waiting for us. This looks like an easy, straightforward debugging task to me.
K Sir, thank you so much... i will try using debuggers.
Hello Rakshita.
With respect....
I'd like to solve your problem.
But code is not clear, not segmented and not commented.
It's big time consuming answer.
If you expect help, you need to provide clear and readable code.
Friendly.
Hello sir .. Sir can you provide the image on which you run this code? The images that you tested for this code.
Hello Sir can u help in color detection using matlab
Hammad Sarwar: the person who posted this question has not been active for nearly 4 years, and will not be notified of your comment. You would be more likely to get a response if you started a new Question and described what you need to do.
Hammad, see my File Exchange for several color segmentation demos http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. In addition, try the Color Thresholder app on the Apps tab of the tool ribbon of MATLAB.

Iniciar sesión para comentar.

 Respuesta aceptada

function [LPImageGray,LPImageBW,BW2,BW3,stats,LPImageTH,EdgeImage,imrefdata,ids,im] = AnprEngine( LPImage,thresh)
%ANPRENGINE Summary of this function goes here
% Process image input analytics and output licence plate alphanumeric string
% Based on static image
tic
Variables Initialization EligibleBands = zeros(3,2); Pointer = 1; Sensing = 0; MinimalHeight = 15;
srcData = load('AnprSysData.mat');
imrefdata = srcData.AlphaNumRef;
im = [];
C = zeros(109);
% toc
Pre-process LPImage
LPImageGray = rgb2gray(LPImage);
LPImageTH = imtophat(LPImageGray,strel('ball',12,7));%Close ball 18 7/ Far ball 12 4
imadjust(LPImageTH,[0;0.1],[0;1]);
%[EdgeImage, thr, gv, gh] = edge(LPImageGray,'sobel','nothinning');
[EdgeImage, ~, ~] = edge(LPImageGray,'sobel');
LPImageBW = ~im2bw(LPImageTH,thresh);
%LPImageVH = edge(LPImageGray, 'sobel',0.11,'vertical');
%sz = size(LPImage);
toc
Skew detection Spacial Transformation correction
Process Image ROI candidates, Heuristic and Bands Elimamination
toc
ProjectionVH = sum(LPImageVH,2);%Compute sum of Horizontal Projection of vertical lines
maxIndexValue = find(ProjectionVH == max(ProjectionVH), 1,'last');%Find Max Index Value of ProjectionVH 1*m Matrix
% Locate most significative eligible bands.
sensor = mean(ProjectionVH);% Define standard deviation of ProjectionVH to find eligible bands
for idx = 1:sz(1,1)
if(ProjectionVH(idx) > sensor && Sensing == 0)
Sensing = 1;
EligibleBands(Pointer, 1) = idx;
end
if(ProjectionVH(idx) < sensor && Sensing == 1)
Sensing = 0;
EligibleBands(Pointer, 2) = idx;
if((EligibleBands(Pointer, 2)-EligibleBands(Pointer, 1))>MinimalHeight)
Pointer = Pointer + 1;
end
end
end
for i = 1:sz(1,1)
if(i < EligibleBands(1,1) || i > EligibleBands(1,2))
LPImageBW(i,:) = 0;
end
end
Locate Licence Plate Bands
Blobs Analysis
CC = bwconncomp(LPImageBW);
stats = regionprops(CC, 'Area','BoundingBox','Image');
ids = find([stats.Area] > 8 & [stats.Area] < 250);
BW2 = ismember(labelmatrix(CC),ids);
toc
Blobs Analysis
CC2 = bwconncomp(~LPImageBW);
stats2 = regionprops(CC2,'Area','BoundingBox','Eccentricity');
ids2 = find([stats2.Area] > 20 & [stats2.Eccentricity] > 0.95);
BW3 = ismember(labelmatrix(CC2),ids2);
%BW3 = [];% ismember(labelmatrix(CC2),ids2);
toc
Pre-OCR
for k=1:length(ids)
imOriginal = stats(ids(k)).Image;
BB = stats(ids(k)).BoundingBox;
NormIm{1,1} = resizem(imOriginal,[60,30]);
NormIm{2,1} = BB(4)/BB(3);
[NormIm{3,1} NormIm{4,1}, NormIm{5,1}] = getMaxCorrelationRate(NormIm{1,1},imrefdata);
if(BB(4)/BB(3)>=1.4 && BB(4)/BB(3)<=2 || BB(4)/BB(3)>=3 && BB(4)/BB(3)<=10)
im = [im NormIm];
%imshow(cell2mat(PD(1,:))) %to display all column in first row on NormIm
%output
%imshow(cell2mat(E2(2)))
end
end
toc
OCR Function
function [Rate,id, Letter] = getMaxCorrelationRate(imOriginal,imrefdata)
for n=1:length(imrefdata)
Rates(n) = corr2(imOriginal,cell2mat(imrefdata(1,n)));
end
[Rate,id] = max(Rates);
if(Rate>0.48)
Letter = imrefdata{2,id};
else
Letter ='';
end;
end
OCR AlphaNumerical resolution
LPNumber = 'Hello Plate';
%%Output
end
% It uses correlation instead of ANN.
% All is in AnprSysData.mat file Chars are indexed from 1 to 109
% Author Mahjoub El attar 2002-2006 for smartKam. For more information feel free to contact me at my profile email contact address.

8 comentarios

This is a generic and working function for study purpose.
Several critical steps are solved here.
(License plate detection, features extraction, etc...)
But many parts that make the code very robust were deleted, cause I use it in my business.
Thank u so much Sir. I will try executing this code.
Sir, in the below statement what better values of threhold and gv should be given.
%[EdgeImage, thr, gv, gh] = edge(LPImageGray,'sobel','nothinning');
[EdgeImage, ~ ,~ ] = edge(LPImageGray,'sobel');
or can it be left blank ... if so it shows error as
??? Error: File: AnprEngine.m Line: 23 Column: 14
Expression or statement is incorrect--possibly unbalanced (, {, or [.
??? Error: File: AnprEngine.m Line: 23 Column: 20
Unbalanced or unexpected parenthesis or bracket.
where is this AnprSysData.mat file available ?
Threshold should be between 0.12 to 0.21. My default one is 0.17
The AnprSysData.mat is located here: http://smartkam.com/matlabFiles/AnprSysData.mat
K Sir.. but in the line
CC = bwconncomp(LPImageBW); bwconncomp is undefined.
Hello, "bwconncomp" is an image processing built-in function.
On binary connected component!
Sir, for
LPImageBW = ~im2bw(LPImageTH,thresh);
as you have said I gave the thresh value= 0.17 ie
LPImageBW = ~im2bw(LPImageTH,0.17);
later for CC = bwconncomp(LPImageBW); it shows error as
??? Undefined function or method 'bwconncomp' for input arguments of type 'logical'.

Iniciar sesión para comentar.

Más respuestas (3)

Undefined function or variable 'y_cor1'.
Error in trynerror (line 278) lp=d(y_cor1:y_cor2,x_cor1:x_cor2);
fi = imread('noplate.jpg');
%imshow(fi)
fin = rgb2gray(fi);
imshow(fin);
d=double(fin)
%imshow(fin)
[r c]= size(d)
% Mexican filter operator
filter = [ 0 0 0 -1 -1 -1 0 0 0 ; 0 -1 -1 -3 -3 -3 -1 -1 0; 0 -1 -3 -3 -1 -3 -3 -1 0; -1 -3 -3 6 13 6 -3 -3 -1; -1 -3 -1 13 24 13 -1 -3 -1; -1 -3 -3 -6 13 6 -3 -3 -1; 0 -1 -3 -3 -1 -3 -3 -1 0; 0 -1 -1 -3 -3 -3 -1 -1 0; 0 0 0 -1 -1 -1 0 0 0 ];
% creating image matrix for mexican hat operator
gm = zeros(r,c);
for i=5:2:r-5
for j=5:2:c-5
gm(i,j) = sum(sum(double(fin(i-4:i+4,j-4:j+4)).*filter,2));
end;
end;
% removing the unwanted edges by using a threshold
fh = gm>1200;
%Dilation operation
x = 1;
y =1;
fs = double(fh);
se = ones(3,3);
for x= 3:3:r-20
for y = 3:3:c-20
if(x+50<=r)
xend = x+50;
else
xend = r;
end;
if(y+100<=r)
yend = y + 150;
else
yend = c;
end;
if(sum(fh(x:xend,y))<=35||sum (fh(x,y:yend,2)<=60))
if(sum(fh(x,y:y+3),2)<=3) && (sum(fh(x,y:y+3),2)>2)
fs(x-2:x+2,y-2:y+2)=bwmorph(fh(x-2:x+2,y-2:y+2),'dilate',se);
end;
end;
end;
end;
%imshow(fin)
%image with dilation performed
f=double(fs);
[row col]=size(f);
%initialising a matrix for a segmented image
g=zeros(row,col);
gl=zeros(row,col);
label=1;
n=1;
x=1;
iter=[];
it=0;
ss_prev=0;
nn=[];
sss_mat=[];
for i=1:2:row
for j=1:2:col
r_pt=i;
c_pt=j;
if(g(r_pt,c_pt)==0)
while(true)
%using 4 neighbour rule
if(f(r_pt(n),c_pt(n))==1 && g(r_pt(n),c_pt(n))==0)
g(r_pt(n),c_pt(n))=label;
if(r_pt(n)+1<=row)
if(f(r_pt(n)+1,c_pt(n))==1)
r_pt=[r_pt r_pt(n)+1];
c_pt=[c_pt c_pt(n)];
x=x+1;
end;
end;
if(c_pt(n)-1>=1)
if(f(r_pt(n),c_pt(n)-1)==1)
r_pt=[r_pt r_pt(n)];
c_pt=[c_pt c_pt(n)-1];
x=x+1;
end;
end;
if(c_pt(n)+1<=col)
if(f(r_pt(n),c_pt(n)+1)==1)
r_pt=[r_pt r_pt(n)];
c_pt=[c_pt c_pt(n)+1];
x=x+1;
end;
end;
if(r_pt(n)-1>=1)
if(f(r_pt(n)-1,c_pt(n))==1)
r_pt=[r_pt r_pt(n)-1];
c_pt=[c_pt c_pt(n)];
x=x+1;
end;
end;
end;
if(n>=x)
break;
end;
n=n+1;
end;
y1=min(r_pt);
y2=max(r_pt);
x1=min(c_pt);
x2=max(c_pt);
a1=g(min(r_pt):max(r_pt),min(c_pt):max(c_pt));
f1=d(min(r_pt):max(r_pt),min(c_pt):max(c_pt));
[ra ca]=size(a1);
| if(n>=50)|
b1=bwlabel(a1);
ss=regionprops(b1,'euler number');
sss=struct2array(ss);
sss=min(sss);
sss_mat=[sss_mat sss];
if(sss<ss_prev && sss<0 && ca <=190 && ra<=60 && ca>=50 && ra >=15 && mean(mean(f1))<=220)
x_cor1=x1;
y_cor1=y1;
x_cor2=x2;
y_cor2=y2;
ss_prev=sss;
end;
label=label+1;
else
g(r_pt,c_pt)=0;
end;
end;
x=1;
n=1;
it=1;
end;
end;
if(exist('y_cor1')==1)
d(y_cor1:y_cor1+2,x_cor1:x_cor2)=255;
d(y_cor2:y_cor2+2,x_cor1:x_cor2)=255;
d(y_cor1:y_cor2,x_cor1:x_cor1+2)=255;
d(y_cor1:y_cor2,x_cor2:x_cor2+2)=255;
end;
% Segmented licence plate image
d=mat2gray(d);
lp=d(y_cor1:y_cor2,x_cor1:x_cor2);
%%%2. Character Segmentation
%License plate image, characters of wcich are to be segmented
lp1 = d(y_cor1:y_cor2,x_cor1:x_cor2);
[rl cl] = size(lp1);
% Median Filtering
lp = medfilt2(lp1,[3 3]);
% Contrast Enhancement
lpf = imadjust(lp,stretchlim(lp,[0.1 0.5]));
%creating output image matrix
output= zeros(rl,cl);
% Window for local threshold operation
dis = round(cl/7);
% Local threshold operation
for i=1:dis:cl
if(i+dis-1<=cl)
t=threshcal(lpf(:,i:i+dis-1),a);
for i=1:dis:cl
if(i+dis-1<=cl)
t=threshcal(lpf(:,i:i+dis-1),a);
output(:,i:i+dis-1)=lpf(:,i:i+dis-1)<=t;
else
t=threshcal(lpf(:,i:cl),a);
for z1=2:rl-1
for z2=i+5:cl-5
if(mean(mean(lpf(z1-1:z1+1,z2-5:z2+5)))<=t)
output(z1,z2)=1;
end;
end;
end;
output(:,i:cl)=lpf(:,i:cl)<=t;
end;
end;
end;
end;
% Structuring element for erosion operation
se = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
output = output - imerode(output,se);
[of lab lpdet] = reggrowl(logical(output),number);
% Segmented characters
lpdet = logical(lpdet);
% Character Recognition
% output String giving licence plate information
lpstr=[];
for i= 1:lab-1
R = lpdet(:,st:st+9);
st = st+10;
b = bwlabel(R);
% Feature extraction
ar = struct2array(regionprops(b,'area'));
or = struct2aarray(regionprops(b,'orientation'))/90;
eu = struct2array(regionprops(b,'eulernumber'))/10;
pe = struct2array(regionprops(b,'perimeter'));
mi = struct2array(regionprops(b,'minoraxislength'));
ma = struct2array(regionprops(b,'majoraxislength'));
temp = logical(R);
% Reflection X and Y coefficient determination
v1 = temp;
v1(:,6:10)=flipdim(temp(:,1:5),2);
vx = (v1 + temp)/2;
vx = vx>=0.5;
xcoef = sum(sum(temp),2)/sum(sum(vx),2);
v2 = temp;
v2(1:12,:) = flipdim(temp(13:24,:),1);
vy = (v2 + temp)/2;
vy = vy >= 0.5;
ycoef = sum(sum(temp),2)/sum(sum(vy),2);
ed = struct2array(regionprops(b,'equivdiameter'))/100;
[val pos] = max(fa);
vcoeff = pe(pos)/ar(pos);
mcoeff = ed(pos);
Rp = [xcoef/ycoef;pe(pos)/ar(pos);mi(pos)/ma(pos)];
answer=find(compet(A2)==1);
if(i<=numel(lpnum))
if(alphamat(answer)==lpnum(i))
numrc = numrc+1;
else
answ = find(alphamat==lpnum(i));
err(answ) = err(answ) + 1;
end;
end;
lpstr = [lpstr alphamat(answer)];
end;
numc = numc + numel(lpnum);
if(strcmp(lpstr,lpnum)==1)
tr = tr + 1;
sr = strcat(num2str(num),'/',num2str(1),'//');
casep = [casep sr];
else
fr = fr +1;
sr = strcat(num2str(num),'/',num2str(1),'/',num2str(answer),'//');
casen = [casen sr];
end;
%%Now your code is a little more clear....

5 comentarios

Let's see what Mexican License Plate looks like...
http://www.olavsplates.com/foto/mex_xyx4448.jpg
Some parts look good, but some are not.
Don't forget the basics of algo programming.
If you cannot tell it well, you cannot program it as well.
You don't need mexican filter.
Any license plate in the world is based on contrast.
It should look like this one under!
this code showing an error in the lp line..what is that lp variable its not taking into it
its giving an error on line lp=d(y_cor1:y_cor2,x_cor1:x_cor2); as Undefined function or variable 'y_cor1'.

Iniciar sesión para comentar.

mahjoub el attar
mahjoub el attar el 6 de Abr. de 2012
Hi, You must use it as this. A = AnprEngine(Image, 0.17); Ok.... let me zip all files with the User-Interface "GUI" and testing snapshots.

7 comentarios

Hello.
I'm on an urgent and time consuming work that makes me working all the week-end.
Yes I'm sorry I didn't sent you all files yet.
Hope I'll get some time to zip all this by tomorrow.
Friendly
air can i get a final GUI because same i want to for paper currency thankig you
sir i want car number plate auto crop code
jayasidharth27@gmail.com sidharth : license plates vary a lot from country to country and sometimes even within any one country. The EU more or less standardizes the plates, but other countries do not. Do not assume that plates will be rectangular. Do not assume that license plates will contrast with the color of the car. Do not assume that license plates will use the so-called "Arabic numerals" that are used in English. In the past I have posted examples of plates that violate the common assumptions about what number plates look like.
Because of these points, it is fairly difficult to create a program that automatically crops all license plates.
please send me the source code and examples
email -- raja123.cnr@gmail.com
Can you please suggest us a solution that how the frames are called into the code automatically to detect the number plate from that frames.
No, we cannot suggest any solution to that. License plates can look like anything . If you were to look at a car and not see any obvious plate, but happened to notice that the car had one pink tailpipe and one green tailpipe, then the exact color and positions of the tailpipes could be the license plate. The "baby on board" sticker on the side of the car could be the license plate.
In order for a solution to be practical, you would need to restrict your scope to only specific kinds of license plates. And even then note what I wrote above about "Do not assume that license plates will contrast with the color of the car."

Iniciar sesión para comentar.

Preguntada:

el 29 de Mzo. de 2012

Comentada:

el 4 de Feb. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by