---Recognition of blue license plate location and recognition based on MATLAB

Source: Internet
Author: User

Then yesterday's work, the last part of the identification is finished.

With regard to character recognition, one of the easiest ways to do this is to match the recognition, subtract the resulting character from its own standard word repertoires, and calculate the result, which is the result of recognition. However, this method is more standard in the resulting characters, due to a number of factors, the cutting out of the characters are often not standard, so the recognition effect is not good. This time using the BP neural network method, as for the other classifier method, no attempt, here does not say.

Using the method of neural network is also clear, the existing word repertoires input to the input of the neural network training, and then use the trained neural network to identify the character continue to recognize, output recognition results. MATLAB has integrated a good neural network, directly call can.

Here, given the reduced input, the input characters are divided into eight rows and four columns, the total number of each block is calculated, and the numbers are then input to the neural network as samples.

Character Recognition Section code:

 forI=1:136II=int2str (i); FName=strcat ('D:\1_2 learning \ image processing \ license plate Recognition \matlab_car_plate-recognization\char_result\character_test\cha&num\ ', II,'. bmp');Image=Imread (fname); Change_image=Catch2chi2character (image); P (:, i)=change_image; Endt= [Eye ( the) Eye ( the) Eye ( the) Eye ( the)];alphabet=p;targets=T; [R,q]=size (alphabet); [S2,q]=size (targets); S1= -;% -Purelin tansignet= NEWFF (Minmax (alphabet), [s1,s2],{'Purelin' 'Purelin'},'TRAINSCG','LEARNGDM');%TRAINSCG traingdx net.inputweights{1,1}.INITFCN ='RANDNR'; net.layerweights{2,1}.INITFCN ='RANDNR'; NET.PERFORMFCN='SSE'; Net.trainParam.goal=0.1; Net.trainParam.show= -; Net.trainParam.epochs=10000; NET.TRAINPARAM.MC=0.95; NET.TRAINPARAM.LR=0.015;%0.01%set the learning rate P=alphabet; T=targets; [NET,TR]= Train (net,p,t);% trained neural network

function Catch2chi2character:

function lett=Catch2chi2character (I1)%%pre-processing of training samples% Bw_7050=imresize (i1,[ +  -],'Nearest');% The picture is uniformly zoned 50*25 size [m n]=size (I1); bw_7050=I1;%figure,imshow (I1); Histrow=sum (bw_7050'); % Compute Horizontal ProjectionHistcol=sum (bw_7050); %Calculate Vertical Projection forI=1: Mif(Histrow (i) >0) row_x=i;  Break; End End forI=1: Nif(Histcol (i) >0) col_x=i;  Break; End End fori=n:-1:1     if(Histcol (i) >0) col_y=i;  Break; End End fori=m:-1:1     if(Histrow (i) >0) row_y=i;  Break; End End Picture (:,:)=bw_7050 (row_x:row_y,col_x:col_y); bw_7050=imresize (picture,[ +  -],'Nearest');% The picture is uniformly zoned 50*25 Size%figure,imshow (bw_7050) forCnt=1:8%Coarse mesh feature as input vector forCnt2=1:4atemp=sum (bw_7050 (cnt*4-3: cnt*4), (cnt2*4-3: cnt2*4))); %gets the statistical characteristics of the character Lett (CNT-1)*4+CNT2) =sum (atemp); EndEnd Ma=Max (Max (lett)); Mi=min (min (lett)); Lett= (LETT-MI)/(MA); Histrow=sum (bw_7050'); % Compute Horizontal ProjectionHistcol=sum (bw_7050); %Calculate vertical Projection Lett=lett';End

Character Recognition:

  forI=2:7II=int2str (i); FName=strcat ('D:\1_2 learning \ image processing \ license plate Recognition \matlab_car_plate-recognization\char_result\ ', II,'. bmp');Image=Imread (fname); [Size_x size_y]=size (image); Max_num=Max (max (image)); Min_num=min (min (image))-1;  forix=1: size_x forij=1: Size_yifImage (Ix,ij) >min_num+ (max_num-min_num)/Tenimage (Ix,ij)=255; Elseimage (Ix,ij)=0; End End End% I2 = bwmorph (image,'Remove'); %Extracting edges% Image_main = Bwmorph (I2,'Skel', INF); %Skeleton of%figure,imshow (image) Change_image=Catch2chi2character (image); Ptest (:, I-1)=change_image; end [A, b]=Max (SIM (net,ptest)); Disp (b); Liccode=Char(['A':'H' 'J':'N' 'P':'Z' '0':'9']); %establish an automatic character code table for recognition forI=1:6Str (i)=Liccode (b (i)); End

Chinese character recognition and characters are similar, here is not posted up.

To summarize: In this way, basically characters can be identified. For example, the characters O and D are not recognized in the case of sample acquisition or digital processing. This is also a problem with the program, that is, there is no distinction between similar characters. Chinese characters also exist in this situation, and left and right structures are not considered. So there's a lot of work to do to make it complete.

This is a simple GUI result diagram:

To summarize:

1. Obtain the license plate specifications to unify, otherwise it is difficult to grasp the license plate positioning this piece.

2. The key to cutting characters is to let the program determine the location of the license plate, so it is more convenient to cut. The problem is that it takes a bit of time to get from the location to the cut, and it feels like it's too complicated. I don't know if there are any simpler ideas.

3. Character recognition want to do well, work or more. This time the neural network training process parameter setting is very important, the soil method is to try, do not know there is no scientific point method.

4. As a summary of this period of time, the content involved is still a lot of, look at the pattern recognition knowledge.

End.. 2015-5-11

---Recognition of blue license plate location and recognition based on MATLAB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.