# Towards Automatic License Plate Detection
## 3 Proposed Method
### Vehicle Detection  
The aim to detect vehicles is to consider the accurate and fast detection of vehicles in the PKU dataset images. Two critical conditions should be satisfied by any vehicle detector, which are (**i**) near real-time detection and (**ii**) high detection accuracy of the traffic objects. During the past two decades, various challenging vehicle detection benchmarks have been introduced for evaluation of detection algorithms. Among them, deep-learning-based methods have achieved impressive achievements on vehicle detection. In general, R-CNN, Fast R-CNN, and Faster R-CNN are the recent methods that have high accuracy, but have huge computational complexity and are difficult to meet real-time performance. To effectively and quickly detect a license plate, we initially spot the vehicle in the image through Faster R-CNN [27]. The purpose of detecting the vehicle is to limit the area that has to be searched for the license plate in the next stage. The intention to introduce Faster R-CNN in initial stage is that it is at least nine times quicker than the R-CNN during the training stage. Moreover, it is 213 times faster at test time with much higher detection accuracy [27]. Algorithm 1 shows the pseudo code of our developed algorithm for license plate detection in which the vehicle detection module is applied from lines (1) to (21). From lines (3)-(10), we perform the fine tuning of the Faster R-CNN classifier to extract 64 RoIs from the input image. To label the foreground object mask, we select an object proposal with an Intersection over Union (IoU) overlap with the ground truth of at least 0.5. From lines (11)-(12), a colored RGB vehicle image is processed with 13 convolutional (_conv_) layers to obtain a _conv_ feature map (\(\psi\)). Then, for each proposed region of the vehicle Region Proposal Network (RPN), nine different anchors are applied on \(\psi\), which predicts the potential vehicle candidate regions. It is important to state here that for anchors, three scales are used with box areas of \(128^{2}\), \(256^{2}\), and \(512^{2}\) pixels, and three aspect ratios of 1:1, 1:2, and 2:1. In line (15), we perform max pooling using five layers on \((\frac{h}{height}\times\frac{w}{Width})\) with a \(7\times 7\) of \(Height\times Width\) with \(h\) and \(w\) as the layer hyper-parameters. For readers' information, it is important to state that these parameters are independent of any particular RoI. Figure 1: Block diagram of proposed method. ```
Input :colored RGB image (\(\mathbf{I}\)) with one or more vehicles with visible licenses plate(s)
1 Apply the Faster R-CNN classifier to detect vehicle
2 begin
3 forinitialize fine tuning for robust detectiondo
4 feature extraction at the initialization of training. 5 mini batch sampling by \((\frac{R=128}{N=2})\) ; 64 RoIs from each image
6 select object proposals with IoU overlap with ground truth more than 0.5
7\(\triangleright\) to label as foreground object class
8 error is back-propagated through the network layers
9
10 end for
11 for each \(I\in R\),\(G\),\(B\);do
12 process I with only 13 convolutional (conv) layers to acquire the feature map \((\Psi)\)
13 use only 9 anchors of three scales along with aspect ratios on \((\Psi)\) to forecast candidate regions
14\(\triangleright\) to form region proposal network
15
16 feature map \((\Psi)\) and region proposals are fed to the RoI pooling layer \((\Gamma)\)
17\(\triangleright\) perform \(max\) pooling \(\rightarrow(\frac{h}{H}*\frac{\varpi}{W})\)
18\(\Gamma\longrightarrow(\text{r,c,h,w})\)
19\(\forall\) feature vectors \((\eta)\rightarrow\) Fully Connected (\(FC\)) layer
20
21 end for
22\(X\)=detected vehicle with red rectangle drawn around
23
24 end for
25 begin
26 LPLM
27 read \(z\); convert \(z\to HSV\) model using Eq. (1) - (3).