Introduction to ANPR

ANPR, sometimes known by other terms, such as Automatic License Plate Recognition (ALPR), Automatic Vehicle Identification (AVI), or car plate recognition (CPR), is a surveillance method that uses optical character recognition (OCR) and other methods such as segmentation and detection to read vehicle registration plates.

The best results in an ANPR system can be obtained with an infrared (IR) camera, because the segmentation steps for detection and OCR segmentation are easy and clean, and they minimize errors. This is due to the laws of light, the basic one being that the angle of incidence equals Angle reflection. We can see this basic reflection when we see a smooth surface, such as a plane mirror. Reflection off rough surfaces such as paper leads to a type of reflection known as scatter or diffuse reflection. However, the majority of the country plates have a special characteristic named Retroreflection: the surface of the plate is made with a material that is covered with thousands of tiny hemispheres that cause light to be reflected back to the source, as we can see in the following diagram:

If we use a camera with a filter-coupled, structured infrared light projector, we can retrieve just the infrared light, and then we have a very high-quality image to segment, with which we can subsequently detect and recognize the plate number independent of any lighting environment, as shown in the following image:

We will not use IR photographs in this chapter; we will use regular photographs so that we do not obtain the best results, and we get a higher level of detection errors and higher false recognition rate than if we used an IR camera. However, the steps for both are the same.

Each country has different license plate sizes and specifications. It is useful to know these specifications in order to get the best results and reduce errors. Algorithms used in this chapter are designed for explaining the basics of ANPR and designed for license plates used in Spain, but we can extend it to any country or specification.

In this chapter, we will work with license plates from Spain. In Spain, there are three different sizes and shapes of license plates, but we will only use the most common (large) license plate, which has a width of 520 mm and a height of 110 mm. Two groups of characters are separated by a 41 mm space, and a 14 mm space separates each individual character. The first group of characters is four numeric digits, and the second group three letters excluding the vowels A, E, I, O or U, or the letters N or Q. All characters have dimensions of 45 mm by 77 mm.

This data is important for character segmentation, since we can check both the character and blank spaces to verify that we get a character and no other image segment: