License Plate Character Segmentation

Source: Internet
Author: User

Then the previous article, the above completed the Pai Chan positioning, then now the license plate character segmentation, the following program each step has a purpose to mark

%%%4.2 License plate Region thresholding (OSTU)
I=imread (' C:\Users\Administrator\Desktop\Des.jpg ');
I=rgb2gray (I);
Figure (1);
Subplot (2,1,1); Imshow (I);
Lev=graythresh (I);
BW=IM2BW (I,lev);
Subplot (2,1,2); Imshow (BW);

%%4.3.1 Plate Tilt Correction
% image tilt correction using the horizontal projection method
[N2,k2]=size (BW);
Xdata=zeros (1,N2);
Ydata=zeros (1,N2);
K1=1;
For L=1:1:N2
For K=1:1:K2
If BW (l,k) ==1
XData (K1) =l;
Ydata (K1) =k;
k1=k1+1;
Break
End
End
End

Res=fit (XData ', Ydata ', ' poly1 ');
P1=RES.P1;
R=imrotate (BW,P1);
Figure (2);
Subplot (2,1,1); Imshow (BW);
Subplot (2,1,2); Imshow (R);

%%%4.4 Word Segmentation min
The% character is projected downward, drawing the position of the character periodically
V=sum (R);
Figure (3);
Subplot (2,1,1);p lot (v);
Ma=max (v);
Length=size (v,2);
For I=1:1:length
If V (1,i) <0.1*ma
V (1,i) = 0;
End
End
Subplot (2,1,2);p lot (v);

Percent and then determine the starting and ending position of each character according to the pattern of vertical projection
Str=zeros (1,7);
Quit=zeros (1,7);
k=1;
For I=2:1:length
if (V (i-1) ==0) & (V (i) >0)
Str (k) =i;
Else
if (V (i-1) >0) & (V (i) ==0)
Quit (k) =i-1;
k=k+1;
Continue
End
End
End
Percent cut per character
Figure (4);
P1=r (:, str (1): Quit (1));
Subplot (4,2,1); Imshow (p1);
P2=r (:, str (2): Quit (2));
Subplot (4,2,2); Imshow (p2);
P3=r (:, str (3): Quit (3));
Subplot (4,2,3); imshow (p3);
P4=r (:, str (4): Quit (4));
Subplot (4,2,4); Imshow (p4);
P5=r (:, str (5): Quit (5));
Subplot (4,2,5); Imshow (p5);
P6=r (:, str (6): Quit (6));
Subplot (4,2,6); Imshow (P6);
P7=r (:, str (7): Quit (7));
Subplot (4,2,7); Imshow (P7);

Figure (1)

Figure (2)


Figure (3)


Figure (4)


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.