**4.4 2D Haar WT based edge detector**

The main advantage of applying 2D DWT such as Haar to an image is that it decomposes it to four sub images as seen in figure 4, which is mathematically less intensive operation and more suitable for our application. The suitable edges for our application are obtained by applying a 2D Haar WT (2x2) on an image f(x,y) to obtain high and low frequency subimages as shown by the following equation

$$\text{fd}(\mathbf{x}, \mathbf{y})\_\text{DWT} \mathbf{a}\_\text{LL}(\mathbf{x}, \mathbf{y}) + \text{d}\_\text{LH}(\mathbf{x}, \mathbf{y}) + \text{d}\_\text{HL}(\mathbf{x}, \mathbf{y}) + \text{d}\_\text{HH}(\mathbf{x}, \mathbf{y}) \tag{27}$$

where d and a are the detailed and approximate components. The low frequency subimage LL (a (x,y)) and the "high-high" (d (x, HH y)) subimage are then removed from equation (27) to give the vertical (d (x,y)) LH and horizontal HL (d (x,y)) components HV (d (x,y)) .

At this stage, the edges can be computed using reconstruction through the use of wavelet transform modulus of d x, LH y HV and d (x,y) and then followed by the calculations of

Real-Time DSP-Based License Plate

n. The intensity level (c) of g is given as,

Finally the threshold T is set such that

and figure 7 respectively.

single level IDWT is shown in (b)

Character Segmentation Algorithm Using 2D Haar Wavelet Transform 13

That is, the number of pixels ng having intensity g as a fraction of the total number of pixels

0 ( ) *g*

<sup>1</sup> c T

The results from reconstruction of the vertical and horizontal edges, absolute edges and prominent edges using single level decomposition and reconstruction are shown in figure 6

(a) (b) Fig. 6. The original image is shown in (a) and the resulting image from reconstruction using

> (a) (b)

Fig. 7. Absolute edges are shown on image (a) and image (b) shows prominent edges

LP candidate are shown in (b) using single level decomposition

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

*c g pg* (29)

<sup>p</sup> (30)

edge angles (Mallat, 1999). Alternatively, an estimate of the wavelet transform modulus of the horizontal and vertical components without taking into account the angle of the DWT as reported in (Qureshi, 2005). In this case, the wavelet modulus is compared to the local average. This is the approximation to the wavelet modulus maxima which is then compared to a global threshold dynamically calculated from the coefficients of the estimated modulus of the detail coefficients.

In our application, we choose to perform reconstruction on d (x, HV y) using inverse DWT (IDWT) using 2D Haar WT to obtain horizontal and vertical edges HV (E (x,y)) . This is computationally efficient on a DSP and it also provides enough edge details for our application. This process is shown in figure 5.

Fig. 5. A reconstruction of d (x, HV y) into E x, HV y using 2D IDWT

The absolute edges are then computed where E x, HV y E (x, HV y) and then post processing is applied to the edges to make them more prominent and inversion for optimal display is performed using an 8-bit dynamic range. Our application demands more edges and less noise therefore, an automatic thresholding method called autonomous percentile (P-tile) thresholding followed by histogram analysis (Qureshi, 2005).

P-tile histogram thresholding is used here due to the fact that the texts inside the license plate region covers a known region 1/p of the total image. The threshold is automatically detected such that 1/p of the image area has pixel intensities less than some threshold T knowing that the text is dark and the background is white or the other way around, which is easily determined through inspection. Starting with the normalized histogram is a probability distribution:

$$\mathbf{p}(\mathbf{g}) = \frac{\mathbf{n}\_{\mathbf{g}}}{\mathbf{n}} \tag{28}$$

That is, the number of pixels ng having intensity g as a fraction of the total number of pixels n. The intensity level (c) of g is given as,

$$c\left(\mathbf{g}\right) = \sum\_{0}^{\mathcal{S}} p(\mathbf{g})\tag{29}$$

Finally the threshold T is set such that

12 Advances in Wavelet Theory and Their Applications in Engineering, Physics and Technology

edge angles (Mallat, 1999). Alternatively, an estimate of the wavelet transform modulus of the horizontal and vertical components without taking into account the angle of the DWT as reported in (Qureshi, 2005). In this case, the wavelet modulus is compared to the local average. This is the approximation to the wavelet modulus maxima which is then compared to a global threshold dynamically calculated from the coefficients of the estimated modulus

In our application, we choose to perform reconstruction on d (x, HV y) using inverse DWT (IDWT) using 2D Haar WT to obtain horizontal and vertical edges HV (E (x,y)) . This is computationally efficient on a DSP and it also provides enough edge details for our

of the detail coefficients.

probability distribution:

application. This process is shown in figure 5.

Fig. 5. A reconstruction of d (x, HV y) into E x, HV y using 2D IDWT

(P-tile) thresholding followed by histogram analysis (Qureshi, 2005).

The absolute edges are then computed where E x, HV y E (x, HV y) and then post processing is applied to the edges to make them more prominent and inversion for optimal display is performed using an 8-bit dynamic range. Our application demands more edges and less noise therefore, an automatic thresholding method called autonomous percentile

P-tile histogram thresholding is used here due to the fact that the texts inside the license plate region covers a known region 1/p of the total image. The threshold is automatically detected such that 1/p of the image area has pixel intensities less than some threshold T knowing that the text is dark and the background is white or the other way around, which is easily determined through inspection. Starting with the normalized histogram is a

ng p g

<sup>n</sup> (28)

$$\mathbf{c}(T) = \frac{1}{P} \tag{30}$$

The results from reconstruction of the vertical and horizontal edges, absolute edges and prominent edges using single level decomposition and reconstruction are shown in figure 6 and figure 7 respectively.

Fig. 6. The original image is shown in (a) and the resulting image from reconstruction using single level IDWT is shown in (b)

Fig. 7. Absolute edges are shown on image (a) and image (b) shows prominent edges

Fig. 8. The original license plate candidate image is shown in (a) and prominent edges in the LP candidate are shown in (b) using single level decomposition

Real-Time DSP-Based License Plate

**Input image**

edges (d)

**F(x,y)**

**Haar edges**

**EHaar**

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

**Grayscale variation analysis to find edges**

**F(x,y) ECON**

Character Segmentation Algorithm Using 2D Haar Wavelet Transform 15

(a) (b)

(c) (d)

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

**Connect edges**

**EFIN CCA HA**

**Histogram analysis to verify character**

**Draw a box around character**

**Comparison to confirm edges**

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