Set-up guide and recommendations - ANPR
Automatic number plate recognition (ANPR) works in four steps. It needs to detect vehicles and license plates, read the plates, and trigger events.
1. Detect vehicle
Detect vehicles as cars, trucks, and buses and follow them in the video stream.
2. Detect license plate
For each detected vehicle, detect license plates and map them to the vehicles.
3. Read license plate
For each detected license plate, apply an optical character recognition (OCR) to read the plate.
4. Send event
If the vehicle crosses a counting line, send an event with the text from the detected license plate.
The main challenge for ANPR setups consists of clearly readable license plates. This means a sharp and well-illuminated image without occlusions or blurry objects is required to obtain good results. The following guide shows how to set up our ANPR system and helps to avoid the most common issues.
The system is designed for two typical setups which are described here.
For this setup, the camera is mounted at around 2m height, as closely as possible to the side of the lane to avoid a high horizontal angle. If possible, enforce vehicles to stay in lane for the ANPR section, as switching lanes can lead to inaccurate results.
When positioning the camera above the cars (e.g. entry/exit of a garage) a maximum of two lanes can be covered.
To work properly, vehicles should drive straight through the scene to have the license plate visible in the entire scene. The camera should be at a height of 3m and facing vehicles directly from the front or back to avoid a high horizontal angle to the license plate.
Camera setup can sometimes be tricky and often requires some experimentation with the camera position and parameters to get optimal results.
The following sections describes common camera issues and how to avoid them.
License plates need to be visible with 250 pixel-per-meter (PPM). For a standard European plate, this gives us a minimum height of 30px and a minimum width of 100px to get good recognition results.
For camera setups with object distances within the specification, a FullHD (1080p) resolution is sufficient. In some cases, it might help to choose a higher resolution (4MP or 2K) for a sharper image.
It is recommended to check the size of license plate crops manually during the setup phase.
License plates need to be visible from a direct viewing angle. While small angles (<20° horizontal, <30° vertical) and tilting <5° can be handled, larger angles cannot work at all. If view angles get bigger, the system is more likely to mix up characters or is not able to recognize characters close to the edges.
For camera positions from the side only a single lane is recommended, while with camera views from above, a maximum of two lanes works.
Scene illumination has two major effects.
- 1.With good illumination, a lower shutter speed can be chosen and images get less blurred, especially for fast-moving vehicles.
- 2.Good lighting reduces the ISO value of the camera and images appear less grainy and sharper.
Some cameras offer additional illumination which can be useful. If the camera light is not sufficient, an external illumination of the scene is required.
Digital noise reduction (DNR) should be kept in a low range to further reduce graininess.
A low shutter speed is important for moving objects to get a sharp image and avoid blurriness caused by motion.
While in general, faster is better, the selected shutter speed depends on the available light in the scene.
Depending on vehicle speed a shutter speed of 1/250 is a bare minimum for moving objects below 15 km/h. For faster vehicles, up to 40 km/h, a shutter speed of 1/500 is a good choice. For faster objects, an even lower shutter speed is required which only works with good illumination.
To stream the camera image, data is encoded. Different encodings can save data and reduce image quality. For the ANPR use case, high image quality is required. Select H.264 codec and a high bitrate of >6000kbps for FullHD (1080p) content and >8000 kbps for 4MP video material with 25 FPS.
Additional features such as BLC and WDR are not recommended, as postprocessing can reduce details. If they are necessary, the impact on the video quality should be checked.
A constant bitrate (CBR) usually leads to a better quality than variable bitrate (VBR).
When setting up the camera, it is recommended to take a few short test videos in different lighting conditions (morning, midday, evening, night) to check if license plates are clearly visible in all conditions.
A good position of the event trigger (counting line) is essential for good ANPR results. If the line is positioned far in the back, the ANPR system has no time to detect and recognize the plate before an event is sent. If the line is in a position, where the license plate is only visible at a suboptimal angle, results will not be accurate.
For an optimal counting line position, a short debug video of the scene with 3-5 vehicles is required. In the analysis of the video, one should follow the vehicle through the optimal section with the best view on the plate (see Example 6). Just as the view on the plate gets worse (see Example 7), position the line right behind the center of the vehicle.
By this method, it’s guaranteed that the system can utilize the best video parts to detect and recognize the license plate and send the event just before suboptimal views worsen the result.
Our ANPR system is tested properly under various conditions. In our test setup, we have around five different scenes, and accuracies are calculated on the basis of > 800 European vehicles. Overall accuracy means the percentage of correctly identified vehicles plus license plates compared to all passing vehicles with readable license plates.
Under the specified conditions, the system reaches >95% overall accuracy in slow parking environments and >90% in environments with fast vehicles.
For a detailed analysis of potential errors, see limitations described below.
A base limitation that cannot be solved is the general readability of license plates. Plates with occlusions, covered with dust or snow or incorrectly mounted plates cannot be read. Environmental limitations such as strong rain or snow which blocks the clear view on plates can also lead to inaccurate results.
There are a few hard limitations where the system cannot provide good results.
1. Illumination (day-only)
Currently, the system supports good illumination only. This limitation is usually for day-only, however it will also work for well-lighted night scenes if the license plates are clearly recognizable.
2. Single-line plates only
License plates with two lines (such as motorcycle plates) are not supported and recognition will not work.
3. EU license plates only
The recognition system is limited to standard EU license plates. It can work with license plates from other countries (and some older non-standard EU plates), but there are no accuracy guarantees.
There are four potential errors that can occur within the ANPR system.
- No vehicle is detected (< 1% error rate)
- No plate is detected (< 0.1% error rate)
- Event is sent without a vehicle passing (< 0.1% error rate)
- Wrong plate text is recognized (< 5-10% error rate, depending on the scenario)
The OCR system identifies character by character. In most error cases it’s a single character that is misclassified or a character that was missed. As in some countries, license plate characters look very similar (sometimes even exactly the same), most errors are caused by mixing up characters with lookalikes.
8can be mixed-up
0can be mixed-up
Ocan be mixed-up
1can be mixed-up
Scan be mixed-up
The best option to avoid these mixups is to get a clear front view on the plate. However, for systems that need to match in- and outgoing license plates, it might make sense to match them with a fuzzy search that takes mixups and duplicated characters into account. For example, the system could still match plate texts like
SI23AO, when the second event exists on the same or following day.
If all setup recommendations are implemented and the camera configuration cannot be improved any further, there are some external improvements that can be made. Best results are achieved when combined.
- 1.Slow down vehicles in the ANPR section to have more time to detect and recognize the license plate.
- 2.Reduce distance from vehicle to camera, for example by limiting the entry to a single or narrow lane, reducing variation and angle to the camera.
- 3.If possible, use camera zoom to focus on the section with the best view on license plates. This can also help with a low resolution of plate crops.
- 4.If the Swarm system performance is an issue (low FPS), it can help to blackout any unnecessary image parts with vehicles (e.g. with a privacy zone). By this, the focus of the system is set on the ANPR section only.