"In the world ye shall have tribulation: but be of good cheer; I have overcome the world." –John 16:33

Category: Software

License plate reading: Narrowing the license plate search area

Day 329 of 1000

I had a little time this afternoon to play with the images I generated yesterday.  You can see the previous steps I took to get to this point here.  The first step I took was to find the brakelights based on yesterdays images.  That was not too hard, but I am going to have to spend some time to handle the variability in brakelight sizes, intensity, and shade.  Nevertheless, it is definitely something with which I can work.  Here are the brakelight finds for a couple of the sample images:

Back of car - brake light find Back of pickup - brakelight find

From there, I established a search window within which to look for the plate.  I put the search region at the bottom of the image which is something I will have to adjust, but I should be able to narrow the window down both horizontally and vertically without too much trouble.

Back of car - plate search ROI Back of pickup - plate search ROI

The next step will be to “robustify” the brakelight finder and narrow down the search region for the plate.  It might take me a week or so to get back to this as I have lots of stuff on my day job right now.

License plate reading: Great progress in finding the plate

I spent several hours today working on some of the preprocessing I think might help me find the license plate on the back of a car.  As always with this type of problem it is good to start with a few easy cases to help lay some of the groundwork.  That is exactly what I did.  I got a few of images each of the back of a pickup and the back of a car to use as my sample development images.  Here are a couple of sample images so you can see what I am talking about:

Back of car - original Back of pickup - original

My first thought in looking at the images is that there are a lot more edges in the area of the license plate than in other areas of the image so I ran a Sobel magnitude on the entire scene to see if that idea held water.  The following are the Sobel magnitude images:

Back of car - sobel magnitude Back of pickup - sobel magnitude

I was right about the license plate lettering, the sobel magnitude image shows a high density of edges, but the proble with this is that there are other high edge density areas of the image.  What I needed was a way to narrow down the number of edges so I decided to separate the veritcal edges from the horizontal edges.  The horizontal edge image was pretty worthless, but the vertical edge image diminshed many of the extraneous, non-licencse plate edges while still maintaining high density in the are of license plate.  The following are the vertical and horizontal edge magnitude images for the car:

Back of car - horizontal edge images Back of car - vertical edge images

So we are a lot closer than when we stared.  We could probably do some morphology coupled with connectivity analysis (blobs) and have a pretty good probability of knowing the position of the license plate for these particular cars.  After thinking about it for awhile, I thought I would try one more thing to narrow down the search area for the license plates.  One thing we have going for us is that the license plate for legal cars should always be somewhere between two red tail lights.  So the next step I thought it would be good for us to take is to create an image that maximizes the red channel and suppresses the non-red area of the image.  On these two cars, I got some pretty amazing results:

Back of car - red maximization/non-red damping Back of pickup - red maximization/non-red damping

We got very good results.  Almost everything in the image is dark with the exception of the red tail lights of the vehicles.  The letters on these license plates just happen to be red, so they showed up quite well, too, but not all plates have red lettering.  We will have to see what happens on red cars, too.  Still, license plate lettering has a finite number of colors, so we will be able to use that to our advantage in the future.  I think we are at a point now where I will be able to combine the information from the vertical edge image and the red channel maximized image to start looking for the plate.  I will do some image cleanup (morphology and other filters) along with connectivity analysis or area image statistics to isolate the plate.  I will probably do that next week or whenever I get a chance to get back to this.

License plate reading progress

I thought I would put up a brief update on the license plate reading project.  The first thing we have to do is gather a bunch of images of the backs of cars in the right setting.  I have made further progress on the application to do that.  Our plan is to send out a camera and a netbook computer with some mounting hardware to my cousin in Oregon how is starting a new drive-through business.  We will set up an ftp site in our office to gather images for a development and test data set.  The business in Oregon is not yet open and we will probably not be ready to send anything out there for a couple of months anyway.  Still, we have a good start and I am capturing images from a webcam.  The next step will be to use an industrial machine vision camera rather than a webcam so it can handle life in the wild.

I am doing most of my programming on a Windows laptop, but also have my Xubuntu netbook which will be the delivery platform.  I have a microcontroller for digital I/O hooked up and talking to the windows laptop.  Tomorrow, I am going to get that going on the Xubuntu netbook if I have enough time.

Page 6 of 6

Powered by WordPress & Theme by Anders Norén