You are currently viewing Building a Raspberry Pi ANPR System – Project Introduction
Raspberry Pi ANPR Vehicle Checker project showing number plate recognition, GPS and Raspberry Pi hardware

Can we build a useful automatic number plate recognition system around an affordable Raspberry Pi without turning it into an expensive computer-vision project? This series is going to find out by building and testing one step at a time.

The idea

ANPR systems are normally associated with car parks, road infrastructure and specialist camera hardware. For this project, the challenge is different: build a compact experimental system from readily available hobby hardware, keep the first version inexpensive, and find out how far careful software can compensate for modest hardware.

The prototype will use a forward-facing camera and run automatically. Its first job is not to identify every vehicle in sight. It needs to find likely UK registration plates, extract useful plate images and read them reliably enough that several consecutive frames agree on the same registration.

Why start with a Raspberry Pi 4?

It would be easy to begin by buying the fastest board, an AI accelerator and expensive camera hardware. That would make it harder to answer the interesting question: what can a relatively cheap system actually achieve?

For V1, the Raspberry Pi 4 gives us enough CPU performance for a carefully designed computer-vision pipeline while keeping the build accessible. We can capture frames, run a lightweight plate detector, crop candidate plates, perform OCR and store results locally. If performance becomes the limiting factor, we will have real measurements to justify the V2 upgrade.

Proposed V1 hardware

PartWhy it is in V1
Raspberry Pi 4 Model BMain computer; enough performance to establish a baseline without overbuilding the prototype.
Camera Module 3 StandardAutofocus and a narrower field of view than the Wide model, helping keep distant plates larger in the image.
High-endurance microSDSimple, inexpensive storage for the OS, software and event database.
USB GNSS/GPS receiverAdds position and time information without complicating the first hardware build.
Cooling caseHelps the Pi maintain performance during continuous image processing.
Phone hotspotProvides development connectivity without adding a dedicated mobile modem to V1.

The software pipeline

The software will be split into stages so that each can be tested independently. Picamera2 will provide camera capture, OpenCV will handle image processing, a lightweight detector will locate registration plates, and OCR will turn the cropped plate image into text.

A particularly important part of the design is multi-frame consensus. Video gives us multiple attempts at the same plate, so there is little reason to trust a single OCR result. If several good frames independently produce the same normalised registration, confidence in that observation should be much higher.

Camera
  ↓
Plate detection
  ↓
Candidate crop
  ↓
OCR on several frames
  ↓
Normalise registration text
  ↓
Multi-frame agreement
  ↓
Timestamp + GPS position
  ↓
Vehicle-status lookup
  ↓
Retain event or discard temporary data

What gets stored?

The system is being designed around events rather than continuous archival recording. Temporary candidate frames can exist long enough to perform recognition and choose the sharpest useful image. For an event that needs to be retained, the SQLite record can contain the registration, observation time, latitude and longitude, recognition confidence, number of agreeing frames, returned vehicle-status fields, query time and paths to the retained image files.

Images will be kept as normal files rather than being stored inside the SQLite database. That keeps the database small and makes the captured evidence easier to inspect during development.

Development roadmap

  1. Get reliable camera capture running on the bench.
  2. Detect number plates and produce clean crops.
  3. Run OCR and normalise likely UK registration strings.
  4. Combine results from multiple frames.
  5. Add GPS position and timestamps.
  6. Add SQLite event storage.
  7. Integrate official vehicle-status data when API access and connectivity are available.
  8. Test the complete prototype using safely collected footage and measure where it fails.

What we want to measure

This will be a build log rather than a project where only the successful result is shown. We want to record recognition distance, motion blur, poor lighting, difficult viewing angles, false detections and OCR mistakes. Where possible, future articles will show the original frame, detected plate area, crop and OCR result so changes to the system can be judged from evidence rather than guesswork.

And then V2?

V2 is deliberately undecided. Possible improvements include front and rear cameras, different optics, a global-shutter camera, faster storage, AI acceleration, mobile connectivity and eventually a custom PCB for the supporting electronics. The point of V1 is to discover which of those upgrades would actually solve a measured problem.


Next in the series: setting up the Raspberry Pi, Camera Module 3 and the first camera-capture tests. Once we have real images, we can start answering the most important question: how reliably can a low-cost camera see UK number plates in the conditions that matter?