License plate recognition (ANPR/LPR) in C# and .NET
Read vehicle license plates from IP cameras, webcams and video files in C#. LicensePlateRecognizerBlock finds each plate, reads it and reports the text with a timestamp — on the device, in the same pipeline that previews, records and streams the video.
From €500/year · Lifetime from €1,500
A plate reader is not general OCR pointed at a car
Automatic number plate recognition — ANPR, also called ALPR, LPR or licence plate recognition — is not general OCR. General OCR reads every sign, sticker and logo in the frame and does not know which text is the plate. ANPR needs two models: a detector that finds plates and an OCR model trained on plate characters. You also need the frames — decoded from the camera, picked at a rate the hardware can keep up with, without stalling the live video. In VisioForge SDKs, LicensePlateRecognizerBlock is a block of the video pipeline: the SDK decodes the source, the block runs both models on a background thread, and the frames continue to the screen, a file or a network stream.
Building ANPR yourself or calling a cloud API vs. LicensePlateRecognizerBlock
| Typical do-it-yourself or cloud ANPR | LicensePlateRecognizerBlock in a VisioForge pipeline | |
|---|---|---|
| Finding the plate | Find or train a plate detector, export it to ONNX, write the pre- and post-processing | FastALPR YOLOv9-T plate detector (MIT); DetectionConfidenceThreshold and MaxDetections |
| Reading the characters | General OCR that also reads every other text in the frame | A plate-specific fast-plate-ocr head; Text comes uppercased, with non-alphanumeric characters removed |
| Getting frames from the camera | A separate decoder or frame grabber for each kind of source | Any SDK source: RTSP IP cameras, webcams, video files |
| Keeping live video smooth | Recognition on the capture thread stalls the stream | Recognition runs on a background worker; frames that arrive while it is busy are skipped and counted |
| Plates from different countries | Retrain the model or change provider | A global head for the USA and 90+ countries and a European head for EU plates, chosen with RecognitionModelPath |
| Where the video goes | Frames sent to a cloud service and billed per call | Nowhere: ONNX Runtime in your process, no API key, no per-call fee |
What the ANPR block gives you
LicensePlateRecognizerBlock ships in the VisioForge.DotNet.Core.AI package. It has one video input and one video output, runs two ONNX models on the frames it receives and reports plates through the OnPlateRecognized event.
- Two-stage recognition: a YOLOv9-T detector finds the plates, and each cropped plate is read by a plate-specific OCR model; both are FastALPR models under the MIT license
- A full result per plate: Text, Confidence (0 to 1), BoundingBox and the four-point Polygon in source-frame pixels, with the frame Timestamp on every event
- Regional heads: the global head covers the USA and 90+ countries, the European head is tuned for EU plates; both read Latin characters (digits and A–Z), and the input size is read from the model itself
- On the device: ONNX Runtime with DirectML on Windows GPUs, CoreML on Apple platforms and the CPU as fallback; ActiveProvider tells you which one is in use
- Live video stays smooth: recognition runs on a background worker, FramesToSkip sets how often it runs, and LastInferenceTimeMs and DroppedFrameCount show how the hardware keeps up
- Recognition next to recording: DrawResults draws the plate boxes and text into the frames that go on to the preview, a file or a stream
- One block for every engine: connect it in a Media Blocks SDK .NET pipeline, or add it with Video_Processing_AddBlock to VideoCaptureCoreX or MediaPlayerCoreX
Where it is used
Parking access and payment
Recognize the plate at a gate camera to open the barrier or start a parking session.
Toll and access-control logging
Record which plates passed a fixed camera and when, with the video kept on site.
Fleet and yard management
Track vehicles entering and leaving a private lot or depot.
Traffic review tooling
Flag plates for manual review; final enforcement decisions should always include a human check.
Code Examples
Built from the License Plate Recognition Demo, which ships the three FastALPR model files; the second example adds the block to VideoCaptureCoreX the way the Capture OCR X demo adds its AI block.
Log the plates from a gate camera
C#Preview an IP camera, list the plates and record to MP4
C#Pipeline
In the gate example LicensePlateRecognizerBlock sits between the camera and a null renderer. Plates leave through the OnPlateRecognized event; with DrawResults on, the frames carry the boxes and text to whatever block comes next.
Frequently Asked Questions
Does the video leave the machine?▼
Which countries' plates can it read?▼
Do I need to train my own model?▼
What about busy scenes with many vehicles or distant plates?▼
Which SDK do I need?▼
Are license plates personal data?▼
Documentation and samples
License plate recognition guide
LicensePlateRecognizerBlock and its settings: models, regional heads, every setting with its default, troubleshooting.
License Plate Recognition Demo (WPF)
Media Blocks SDK .NET sample: ANPR on a webcam, a video file or an RTSP camera, with the bundled FastALPR models.
AI blocks in VideoCaptureCoreX and MediaPlayerCoreX
How processing blocks are added to the capture and player engines: insertion order and lifecycle.
Object detection
YOLOObjectDetectorBlock: detect vehicles upstream of ANPR on busy scenes.
PII redaction
PIIRedactionBlock: blur or pixelate license plates, faces and on-screen text in video, on the device.
OCR for video streams
OcrBlock for all other text in the video: signs, labels, lower thirds and screen content.
Start reading license plates
Download the fully functional 30-day trial and run the License Plate Recognition Demo. Depending on the engine and output, a watermark or unregistered notice may appear.
SDKs with license plate recognition
Media Blocks SDK .NET
Pipeline SDK: put LicensePlateRecognizerBlock between any source and a renderer, encoder or network output.
Learn more →Video Capture SDK .NET
Capture SDK: add the block to VideoCaptureCoreX and read plates from cameras while you preview and record.
Learn more →Media Player SDK .NET
Player SDK: add the block to MediaPlayerCoreX and read plates from the files and streams you play.
Learn more →From €500/year · Lifetime from €1,500
