## 3 Proposed Methodology
### License Plate Character Segmentation
\begin{table}
\begin{tabular}{c l l} \hline \hline
**Color Count** & **Color Threshold (\(T_{\overline{C}}\))** & **Color Group** \\ \hline \(C_{\overline{K}}\) & \(d_{1}\geq 0.24\ \&\ d_{3}\geq 0.24\) & \\ \(C_{\overline{C}}\) & \(d_{1}<0.24\ \&\ d_{3}\geq 0.24\) & \(B<R>G\) \\ \(C_{\overline{M}}\) & \(d_{1}\geq 0.24\ \&\ d_{3}<0.24\) & \\ \hline \(C_{\overline{BL}}\) & \(d_{2}\geq 0.24\ \&\ d_{3}\geq 0.24\) & \\ \(C_{\overline{C}}\) & \(d_{3}\geq 0.24\ \&\ d_{2}<0.24\) & \(R<B>G\) \\ \(C_{\overline{M}}\) & \(d_{1}\geq 0.24\ \&\ d_{3}<0.24\) & \\ \hline \(C_{\overline{C}}\) & \(d_{1}\geq 0.24\ \&\ d_{2}\geq 0.24\) & \\ \(C_{\overline{C}}\) & \(d_{1}<0.24\ \&\ d_{2}\geq 0.24\) & \(R<G>B\) \\ \(C_{\overline{C}}\) & \(d_{1}\geq 0.24\ \&\ d_{2}<0.24\) & \\ \hline \hline \end{tabular} \(C_{\overline{K}}\): Red count, \(C_{\overline{Y}}\): Yellow count, \(C_{\overline{M}}\): Magenta count, \(C_{\overline{C}}\): Blue count, \(C_{\overline{C}}\): Cyan count, \(C_{\overline{C}}\): Green count, \(d_{1}=\left|(R-G)/R+G\right|\), \(d_{2}=\left|(G-B)/G+B\right|\), \(d_{3}=\left|(B-R)/B+R\right|\)]. The _distances between primary colors red-green, green-blue and blue-red are represented by \(d_{1}\), \(d_{2}\) and \(d_{3}\)_ respectively.  
\end{table} 
Table 1: Color definition based on three main groups. Figure 3: Visualization of RGB color space: (**a**) RGB-cube with 8 pure colors, (**b**) RGB–cube with colors distribution, and (**c**) gray shades distribution bar. \[C_{\overline{B}}=\sum_{i=0}^{SP}C_{\overline{BW}(i)} \tag{3}\]  
\[C_{\overline{W}}=\sum_{i=SP}^{255}C_{\overline{BW}(i)} \tag{4}\]  
Until this point, we have known the background and foreground colors because the largest candidates group belong to the background while the second largest candidates group belong to the foreground, as shown in Figure 5a. This information is further used to determine the foreground polarity for post processing, as this information is most necessary for adaptive thresholding and for most morphological operations. Adaptive thresholding technique strongly requires the prior knowledge of foreground polarity to separate background from foreground precisely. This information is also needed for morphological operations to obtain the required results. Algorithm 1 is used to accomplish this task, whereas max1 and max2 belong to \(C_{\overline{z}}\) that represent the background and foreground respectively. The background  
Figure 4: Black and white candidate’s histogram. Figure 5: Foreground polarity detection based on colors: (**a**) foreground (FG)/background (BG) detection based on colors candidates count, (**b**) Color priority sequence. and foreground polarities depend on the sequence of colors as shown in Figure 5b. For example, Ind-1 has brighter polarity as compared to Ind-2. The CG2 (Ind) is determined as  
\[CG1_{\text{ME}AN}=\frac{1}{N}\sum_{i=1}^{N}V_{\text{CG1}(i)} \tag{5}\]  
\[CG2_{\text{ME}AN}=\frac{1}{N}\sum_{i=1}^{N}V_{\overline{\text{BW}}(i)} \tag{6}\]  
\[CG2(Ind)=\left\{ \begin{array}{l}1\text{ \emph{if} }CG1_{\text{ME}AN}<CG2_{\text{ME}AN}\\ 2\text{ \emph{if} }CG1_{\text{ME}AN}>CG2_{\text{ME}AN}\end{array} \right. \tag{7}\]  
The next step is to convert the RGB image into binary image \(BI(x,y)\). For this purpose, first the image is converted into gray image (\(GI\)) by using the standard conversion computed by (8) and then we use real-time adaptive thresholding for binary conversion using local mean intensity (first-order statistics) as mentioned in (9) with neighborhood size (Ns). This is most suitable thresholding technique compared to OTSU's, MET and many others based on two intra-class variance to separate background and foreground particularly in shadow and illumination variance environment. Adaptive thresholding requires prior knowledge of foreground polarity which we have already determined in the above steps. \[GI=0.2989\,*\,R+0.5870\,*\,G+0.1140\,*\,B \tag{8}\]  
\[BI(x,y)=\left\{