UK ANPR in Python on Raspberry Pi3

UKRegOCR: cross-platform UK-optimised Automatic Number Plate Reader in Python3


I've been working on ANPR/ALPR in my spare time for some months now, starting off with OpenALPRCloud - a brilliantly capable, fast and accurate cloud-hosted reader service that I can highly recommend. It's free for low-volume applications (under 2000 reads/month) but is paid-for in higher usage volumes.

Unfortunately the open-source, tesseract-based version of this reader is now quite old and nowhere near as accurate as the cloud reader. And even the cloud reader fails on some low character-count 'cherished' style UK plates.

So I started writing my own UK-optimised reader in Python3 using the OpenCV computer vision package plus PILlow image processing and NumPy - Python's own scientific computing package.

The code (UKRegOCR) is now at the point where it's accuracy, on UK plates, is comparable to that of OpenALPR's cloud API, albeit somewhat slower at around 0.7s/read on an i7 Ubuntu PC, 1.1s/read on an i5 Windows10 PC and 7.5s/read on a Raspberry Pi3.

In many ANPR applications however speed is not so critical and a fast, reliable, high-bandwidth internet connection is not always available either, in such cases a local, embeddable solution might well be preferable. Such a solution is presented here.