Detection And Identification Of License Plates In Moving Vehicles From Video Movies

Recognition of motor vehicles has many uses, for example in law reinforcement, security, control of traffic.

Recognition of motor vehicles has many uses, for example in law reinforcement, security, control of traffic. The purpose of the project is to create a system that is capable of identifying license plates in moving vehicles. The system, which was developed using Matlab, receives a video movie as input, and returns as output pictures of the license plates from the vehicles that were detected. The system does not work in real-time due to Matlab speed processing limitation. However, the algorithm was written in a way it could be implemented in a real-time system, and in a most generic form, so it could be applied to various situations with only minimal changes. To allow maximum flexibility the system is wrapped in a GUI, which allows running the system and adapting it to each scene easily, by any user.

The Problem
The first obstacle in processing video images is the interlacing problem. Pictures in movie need to be refreshed 60 times per second to avoid the visual effect of blinking. Interlacing is a way to reduce the memory size of a movie through refreshing the even and odd lines of the frame alternately, thus needing only 60 half pictures per second. In a stationary frame a moving object will be created from 2 images not sampled in the same time, and therefore very blurry.

The second problem was to create an algorithm that is able to detect moving vehicles, with the limitation that only movement in the desired direction, out of a two way lane, will be detected. The algorithm needs to be highly reliable, while not too much time consuming.

The third problem was to create an algorithm that can identify the license plate of a detected vehicle, so it could return a good picture of the plate (or its coordinates on the movie frame), for further future processing. Identification of the digits from the license plate was not a part of the project.

The Solution
Interlacing was bypassed through creating a smaller image, by taking only the even (or odd) lines of the frame. In that way no preliminary processing for de-interlacing is needed, and therefore it allows real-time implementation. It is also a very fast solution and the quality of the image is preserved, even though it contains half the lines.

Taking one field of the frame in order to bypass the interlacing

Movement was detected with movement revaluation using blocks. A region of interest in the current frame and the next frame is divided into blocks and for each block in the current frame we find, in the next frame, the position of the block that gives the minimal error between the two blocks. This way we get a vector for each block, showing its movement between the two frames.


Detecting a moving car using block revaluation: The vectors (in blue) showing the movement of the blocks (in red) of two sequential frames

In order to distinguish between movement in the desired direction and other directions we compute a grade for each block by taking the projection of its normalized motion vector (MV) on the road vector (RV) – a unit vector in the direction which we want to detect the motion (set by the user).


The block grade computing method


The total movement grade of the frame is then calculated by taking the mean value of all the positive block grades. If this total grade is greater than some movement threshold (set by the user), we conclude that there was a car movement in the desired direction at this frame.

The algorithm for the plate identification was based on finding a rectangle having a certain color and size, after having detected the vehicle.

Detecting a yellow license plate using color conversion


The plate coordinates are then set to be this rectangle corners, in the pre-filtered image.

The identified plate area and coordinates


A GUI was created, allowing the user to watch the process of identifying the vehicle and the plate. It allows also various inputs, like the road angle, the region of interest in the image, the block size, the color and minimal area of the plate, and more.

The GUI window, showing the detection of a car and the identification of its plate


The movies were filmed using Sony DCR-PC110E video camera, and sampled and coded into DV, Indeo and DivX formats using Adobe Premiere Pro 2.0.
The code was written in Matlab 7.1.

The system has showed very good results when checked on the videos we filmed. For a wider use of the system some changes need to be done. First, for real-time implementation, the algorithm needs to be in high level language, since Matlab speed is limited. The parameters of the system need to be adapted to the movie (easily done through the GUI), when running it on a new site.

Improvements to the system could be done by recognizing more than one car at a time, adding a system that identify the digits, and developing an algorithm of identifying the license plates that is not based on their color.

We are grateful to our project supervisor Johanan Erez for his help and guidance throughout this work.
We are also grateful to the Ollendorf Minerva Center Fund for supporting this project.