<< Chapter < Page Chapter >> Page >
ELEC 301 Group Project: LiPE How to find the license plate letters and numbers in an image of a car.

The general method we used for extracting the license plate letters out of a picture was:

Overall method for finding license plate letters/numbers.
  1. Compression and Cropping: decreases the size of the photo and and blacks out areas that definitely do not contain license plate.
  2. License Plate Localization: determines the location of the plate in the photo
  3. Letter Extraction: searches within the plate for the plate letters/numbers and copies them out of the photo.

Following is an explanation of the individual sections. Included are also images showing the effects of each section on the following picture:

Original image.

Compression and cropping

In order to decrease image processing time, we first compress all pictures to a standard size and black out all areas that are definitely not license plates. The size we chose was 640px by 480px, the smallest size at which we could still reasonably read the license plates.

To determine which areas were definitely not license plates, we realized that the typical Texas plate contained red, blue, and white as major colors. Therefore, we focused on these two colors, making our cropping algorithm:

  1. Separate the JPEG picture into its three layers of red, green, and blue.
  2. Consider the area around a blue pixel, and black it out if the density of red is lower than a certain threshold value.

Compressed and cropped image (Note the black areas around the right and bottom of the photo).

License plate localization

Once we determined which areas possibly contained license plates, we looked in those areas for the plates themselves. We determined that most plates contain dark letters on light backgrounds and so looked for areas of high contrast.

Our final algorithm looked as follows:

  1. Turn the cropped photo into black-and-white for easier differentiation between dark and light spots.
  2. Filter the image to remove noise (single-pixel white spots).
  3. Locate the license plate position by scanning the photo vertically. We expect a row running through the license plate row to have a maximum number of individual dark spots, or "clusters." Therefore, we find and store the two rows in the image with that contain the most clusters.
  4. To find the horizontal position of the plate, scan the picture horizontally by moving a square window from left to right and counting the number of clusters inside. The final position of the license plate is square that contains the greatest number of clusters. If any two squares contain the same number of clusters, the two are merged together.
Close-up of the license plate as determined by the algorithm.

Letter extraction

To find the letters on a license plate, we first determined some identifying characteristics:

  1. Usually, and always on Texas plates, the letters of the plate are dark on a light background.
  2. The letters are uniform in height
  3. The letters all occur in approximately the same area.
  4. There are usually between 3 and 7 letters on a plate.

These characteristics give us the form for our letter extracting algorithm.

  1. From the plate-locating algorithm, we have a small 200px by 200px image that contains the car's license plate.
  2. We convert the image into grayscale for easier processing.
  3. We locate all the dark (low intensity) spots in the picture that are surrounded by light (high intensity) spots. We determine the separation between these dark spots and give each individual spot a label.
  4. Compare the sizes of the spots and look for about six that have the same height. These six spots are the letters on the plate.
  5. Save the pixels that make up the letters into their individual matrices.

We tried this algorithm and found that it worked for all images for which the plate-locating algorithm returned an image containing the entire plate.

Letters extracted from the photo.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 group project- license plate extraction (lipe). OpenStax CNX. Dec 16, 2009 Download for free at http://cnx.org/content/col11145/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 group project- license plate extraction (lipe)' conversation and receive update notifications?

Ask