**4.5 LP character segmentation algorithm**

The LP character segmentation process follows LP region detection as explained in Section 3.1. In this algorithm shown in figure 10, we segment the characters inside LP rectangle. The procedurals steps following LP detection include:


Algorithm listing 1: LP character segmentation based on 2D Haar WT

*Let fxy* (,) *be an input image* 

*For each wavelet decomposition level j = 1…N* 

 *Compute DWT coefficients at level j based on Haar WT* 

*End* 

*Let d xy HV* (,) *be the horizontal and vertical coefficients at final level N* 

*Compute the reconstruction of d xy HV* (,) *using IDWT* 

*Let E xy HV* (,) *be the result from reconstruction* 

*Compute the absolute value* 

*Let* (,) *E xy ABS be the absolute edges* 

*Compute the prominent edges through optimal threshold T* 

*Let EHaar be the prominent 2D Haar WT edges* 

*Compute contrast comparison on fxy* (,) *to find edges* 

*Let ECON be initial edges by contrast comparison* 

*Compare ECON to EHaar to confirm edges* 

*Le EFIN be the final edges* 

*Compute connected component analysis on the final edges* 

*Let CCA be the connected components* 

*Compute histogram analysis on CCA to confirm characters* 

*Let HA be the histogram analysis results* 

*Compute bounding box around character* 

LP candidate are shown in (b) two levels decomposition

Edge detection within the original LP region using 2d Haar WT

 Connecting edges using and drawing a rectangle around object Verification of character extraction using histogram analysis

Algorithm listing 1: LP character segmentation based on 2D Haar WT

*Let d xy HV* (,) *be the horizontal and vertical coefficients at final level N* 

Edge detection through grayscale variation analysis using original image

**4.5 LP character segmentation algorithm** 

Compute bounding box

*Let fxy* (,) *be an input image* 

*Compute the absolute value* 

*Le EFIN be the final edges* 

*Let* (,) *E xy ABS be the absolute edges* 

*End* 

*For each wavelet decomposition level j = 1…N* 

*Let E xy HV* (,) *be the result from reconstruction* 

*Let EHaar be the prominent 2D Haar WT edges* 

*Compare ECON to EHaar to confirm edges* 

*Let CCA be the connected components* 

*Let HA be the histogram analysis results Compute bounding box around character* 

procedurals steps following LP detection include:

presence of edges as explained in Section 3.1 Verification of candidate edges if a match is found

 *Compute DWT coefficients at level j based on Haar WT* 

*Compute the reconstruction of d xy HV* (,) *using IDWT* 

*Compute the prominent edges through optimal threshold T* 

*Compute contrast comparison on fxy* (,) *to find edges Let ECON be initial edges by contrast comparison* 

*Compute connected component analysis on the final edges* 

*Compute histogram analysis on CCA to confirm characters* 

 (a) (b) Fig. 9. The original license plate candidate image is shown in (a) and prominent edges in the

The LP character segmentation process follows LP region detection as explained in Section 3.1. In this algorithm shown in figure 10, we segment the characters inside LP rectangle. The

Compare Haar edges with the grayscale variation analysis edges to validate the

Fig. 10. The LP character segmentation algorithm based on Haar edges

(a) (b)

Fig. 11. The above figures show input grayscale image (a), the region of interest in red (b), the LP candidate in yellow (b), the 2D Haar WT edges (c) and post - processed 2D Haar WT edges (d)

Real-Time DSP-Based License Plate

(E(x,y))

green (EFIN)

**LP character segmentation algorithm** 

Without Haar

Using Haar WT

Using Haar WT

Table 1. Algorithm profiling results

WT

segmented characters bounding box

**Overall character segmentation success (6000 images) Percentage** 

Character Segmentation Algorithm Using 2D Haar Wavelet Transform 17

(a) (b) Fig. 12. (a) The input LP Candidate (f(x,y)) and (b) the detected edges using 2D Haar WT

(a) (b)

Fig. 13. (a) The post- processed 2D Haar WT edges (EHaar) and (b) the detected edges in

(a) (b) Fig. 14. (a) Character segmentation using histogram analysis (HA) and CCA, and (b) the

**Time using PC (ms)** 

**HD** 

90.4 6.2 6.5 7.6 7.9

**(1394x1040) SD** 

**Time using DSP (ms)** 

**HD** 

**(1394x1040)** 

**(720x288)** 

**SD (720x288)** 

(single level) 95.3 8.8 9.1 10.4 10.6

(two levels) 96.7 18.2 19.4 22.0 22.6

The Haar edges are used as a reference without further processing of the Haar edges like thinning; we apply the edges comparison algorithm explained in Section 3.1 and compare location where an edge is verified if a match is found. The flow chart is shown in figure 10.

The LP candidate has unique properties where the typical number of edges is between 100 to 2000 edges per plate. There are seven characters in UK LPs, a single character in a LP candidate contains between 30 to 150 edges, the gap of the character is between 2 to 4 pixels, the height of the character is about 20 pixels and width is about 16 pixels. This knowledge is applied to Connected Component Analysis (CCA) (Llorens, 2005) and a window (box) is drawn when a character is found. Finally, histogram analysis is applied to verify the presence of characters in a LP candidate.
