How to Read License Plates in C# with IronOCR
IronOCR's ReadLicensePlate method automatically extracts license plate numbers from vehicle images using advanced OCR technology. This single method call can process license plates with high accuracy, returning both the plate text and confidence score for automated vehicle management systems.
When managing a large volume of vehicle images, manually reading license plates is time-consuming and prone to human error. Automating this process with a tool like IronOCR provides a more efficient, accurate solution. IronOCR's ReadLicensePlate method can programmatically extract the license plate numbers from images, saving considerable time while improving data accuracy.
In this guide, we'll demonstrate how to use IronOCR for license plate recognition, walking through examples and customizable configurations that make the process seamless. By leveraging these methods, developers can automate license plate reading, making tasks like parking management, toll collection, or security surveillance more efficient.
To use this function, you must also install the IronOcr.Extensions.AdvancedScan package.
With a single method call using IronOCR's ReadLicensePlate, you can programmatically extract the license plate text from any image. It's ready to use - just load an image, call the method, and get both the plate number and confidence right away.
-
1Install IronOCR with NuGet Package Manager
-
2Copy and run this code snippet.
var input = new OcrInput(); input.LoadImage("plate.jpg"); OcrLicensePlateResult result = new IronTesseract().ReadLicensePlate(input);C# -
3Deploy to test on your live environment
Start using IronOCR in your project today with a free trial
Minimal Workflow (5 steps)
- Download the C# library for reading license plates
- Import the license plate image for processing
- Ensure the document contains only the license plate image, without headers or footers
- Use the
ReadLicensePlatemethod to extract data from the image - Access the OcrLicensePlateResult property to view and manipulate the extracted license data
How Do I Read a License Plate in C#?
To read a license plate in IronOCR, we apply the following steps:
- We utilize the
ReadLicensePlatemethod, which takes anOcrInputas a parameter for the input. This method is more optimized for license plates than the library's standardReadcounterpart. - Optionally, we can configure IronOCR to whitelist specific characters that can exist in a license plate, to speed up the license plate number processing.
What Does the Input License Plate Look Like?

How Do I Configure the OCR for License Plates?
using IronOcr;
using System;
var ocr = new IronTesseract();
ocr.Configuration.WhiteListCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
using var inputLicensePlate = new OcrInput();
inputLicensePlate.LoadImage("plate.jpeg");
// Read license plate
OcrLicensePlateResult result = ocr.ReadLicensePlate(inputLicensePlate);
// Retrieve license plate number and confidence value
string output = $"{result.Text}\nResult Confidence: {result.Confidence}";
Console.WriteLine(output);Imports Microsoft.VisualBasic
Imports IronOcr
Imports System
Private ocr = New IronTesseract()
ocr.Configuration.WhiteListCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"
Dim inputLicensePlate = New OcrInput()
inputLicensePlate.LoadImage("plate.jpeg")
' Read license plate
Dim result As OcrLicensePlateResult = ocr.ReadLicensePlate(inputLicensePlate)
' Retrieve license plate number and confidence value
Dim output As String = $"{result.Text}" & vbLf & "Result Confidence: {result.Confidence}"
Console.WriteLine(output)What Results Should I Expect?

The code demonstrates how to import an image as an OcrInput and use it with the ReadLicensePlate method to extract the text from the license plate. The output shows the extracted text that matches the license plate shown in the input image, along with a confidence level indicating the accuracy of the OCR.
Text: The extracted text from OCR Input.
Confidence: A double property that indicates the statistical accuracy confidence of an average of every character, with one being the highest and 0 being the lowest.
For more precise control over the OCR process, you can explore advanced configuration options to fine-tune character recognition settings.
How Can I Extract License Plates From Car Images?
The method also works well with images containing a car with a license plate. The code is the same as the one above, with the input image changed. You can also extract the pixel coordinates of the area where the license plate is situated in the image.
What Type of Car Images Work Best?

For optimal results, ensure your car images have:
- Clear visibility of the license plate
- Good lighting conditions (avoid glare or shadows)
- Minimal angle distortion
- Adequate resolution (consider adjusting DPI settings for low-resolution images)
How Do I Get the License Plate Location Coordinates?
using IronOcr;
using IronSoftware.Drawing;
using System;
var ocr = new IronTesseract();
using var inputLicensePlate = new OcrInput();
inputLicensePlate.LoadImage("car_license.jpg");
// Read license plate
OcrLicensePlateResult result = ocr.ReadLicensePlate(inputLicensePlate);
// Retrieve license plate coordinates
RectangleF rectangle = result.Licenseplate;
// Write license plate value and coordinates in a string
string output = $"License Plate Number:\n{result.Text}\n\n"
+ $"License Plate Area_\n"
+ $"Starting X: {rectangle.X}\n"
+ $"Starting Y: {rectangle.Y}\n"
+ $"Width: {rectangle.Width}\n"
+ $"Height: {rectangle.Height}";
Console.WriteLine(output);Imports Microsoft.VisualBasic
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
Private ocr = New IronTesseract()
Private inputLicensePlate = New OcrInput()
inputLicensePlate.LoadImage("car_license.jpg")
' Read license plate
Dim result As OcrLicensePlateResult = ocr.ReadLicensePlate(inputLicensePlate)
' Retrieve license plate coordinates
Dim rectangle As RectangleF = result.Licenseplate
' Write license plate value and coordinates in a string
Dim output As String = $"License Plate Number:" & vbLf & "{result.Text}" & vbLf & vbLf & $"License Plate Area_" & vbLf & $"Starting X: {rectangle.X}" & vbLf & $"Starting Y: {rectangle.Y}" & vbLf & $"Width: {rectangle.Width}" & vbLf & $"Height: {rectangle.Height}"
Console.WriteLine(output)What Information Does the Result Include?

The example shows how the ReadLicensePlate method can be applied to an image of a car. The method will also return the rectangle coordinates of where the license plate is situated in the image.
This method is optimized to find single license plates only and is capable of searching for them in stock images.
How Do I Process Multiple License Plates?
When dealing with multiple vehicle images, you can process them efficiently using batch operations:
using IronOcr;
using System.IO;
using System.Threading.Tasks;
public async Task ProcessMultipleLicensePlates(string[] imagePaths)
{
var ocr = new IronTesseract();
// Configure for optimal performance
ocr.Configuration.WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleBlock;
var tasks = imagePaths.Select(async path =>
{
using var input = new OcrInput();
input.LoadImage(path);
var result = await Task.Run(() => ocr.ReadLicensePlate(input));
return new {
FilePath = path,
PlateNumber = result.Text,
Confidence = result.Confidence
};
});
var results = await Task.WhenAll(tasks);
// Process results
foreach (var result in results)
{
Console.WriteLine($"File: {result.FilePath}");
Console.WriteLine($"Plate: {result.PlateNumber} (Confidence: {result.Confidence:P})");
}
}Imports IronOcr
Imports System.IO
Imports System.Threading.Tasks
Public Async Function ProcessMultipleLicensePlates(imagePaths As String()) As Task
Dim ocr = New IronTesseract()
' Configure for optimal performance
ocr.Configuration.WhiteListCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleBlock
Dim tasks = imagePaths.Select(Async Function(path)
Using input = New OcrInput()
input.LoadImage(path)
Dim result = Await Task.Run(Function() ocr.ReadLicensePlate(input))
Return New With {
Key .FilePath = path,
Key .PlateNumber = result.Text,
Key .Confidence = result.Confidence
}
End Using
End Function)
Dim results = Await Task.WhenAll(tasks)
' Process results
For Each result In results
Console.WriteLine($"File: {result.FilePath}")
Console.WriteLine($"Plate: {result.PlateNumber} (Confidence: {result.Confidence:P})")
Next
End FunctionFor large-scale processing, consider implementing multithreading capabilities to maximize performance.
How Can I Improve License Plate Recognition Accuracy?
To enhance the accuracy of license plate detection, consider these optimization techniques:
Apply Image Preprocessing Filters
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
// Load and preprocess the image
input.LoadImage("blurry_plate.jpg");
input.Deskew(); // Correct image rotation
input.DeNoise(); // Remove background noise
input.EnhanceResolution(225); // Upscale for better clarity
input.Sharpen(); // Enhance edge definition
var result = ocr.ReadLicensePlate(input);Imports IronOcr
Dim ocr As New IronTesseract()
Using input As New OcrInput()
' Load and preprocess the image
input.LoadImage("blurry_plate.jpg")
input.Deskew() ' Correct image rotation
input.DeNoise() ' Remove background noise
input.EnhanceResolution(225) ' Upscale for better clarity
input.Sharpen() ' Enhance edge definition
Dim result = ocr.ReadLicensePlate(input)
End UsingLearn more about available image filters and image correction techniques to optimize your input images.
Handle Different Lighting Conditions
For challenging lighting scenarios, apply appropriate corrections:
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("dark_plate.jpg");
input.Contrast(1.5); // Increase contrast
input.Binarize(); // Convert to black and white for clarity
var result = ocr.ReadLicensePlate(input);
How Do I Monitor OCR Performance?
When processing large batches of license plates, tracking progress helps manage system resources:
using IronOcr;
var ocr = new IronTesseract();
// Subscribe to progress events
ocr.OcrProgress += (sender, e) =>
{
Console.WriteLine($"Processing: {e.ProgressPercent}% complete");
};
using var input = new OcrInput();
input.LoadImage("large_parking_lot.jpg");
var result = ocr.ReadLicensePlate(input);Imports IronOcr
Dim ocr As New IronTesseract()
' Subscribe to progress events
AddHandler ocr.OcrProgress, Sub(sender, e)
Console.WriteLine($"Processing: {e.ProgressPercent}% complete")
End Sub
Using input As New OcrInput()
input.LoadImage("large_parking_lot.jpg")
Dim result = ocr.ReadLicensePlate(input)
End UsingFor detailed performance monitoring, explore the progress tracking capabilities in IronOCR.
How Does This Compare to Other Document Reading?
IronOCR's specialized document reading capabilities extend beyond license plates. The same computer vision technology that powers license plate detection can be applied to:
- Passport reading for travel and identity verification
- MICR check processing for banking applications
- General document scanning for digitization projects
What Are Common Use Cases?
License plate recognition with IronOCR enables various applications:
- Parking Management: Automate entry/exit logging and payment processing
- Toll Collection: Speed up vehicle identification at toll booths
- Security Surveillance: Track vehicle movements in restricted areas
- Fleet Management: Monitor company vehicles and logistics
- Law Enforcement: Identify vehicles of interest quickly
Each use case benefits from IronOCR's high accuracy and the ability to process images in real-time, making it suitable for both batch processing and live applications.
Frequently Asked Questions
How can I read license plates using C#?
You can read license plates using C# by utilizing IronOCR's `ReadLicensePlate` method, which processes vehicle images with advanced OCR technology and provides both the plate text and a confidence score.
What is required to use IronOCR for license plate recognition?
To use IronOCR for license plate recognition, you need to install the IronOCR library and its `IronOcr.Extensions.AdvancedScan` package, then use the `ReadLicensePlate` method to extract license plate numbers from images.
What are the benefits of using IronOCR for license plate recognition?
Using IronOCR for license plate recognition is efficient and accurate, saving time compared to manual processing. It automates tasks like parking management and toll collection by providing high accuracy in text extraction.
How can I optimize IronOCR for better license plate recognition?
You can optimize IronOCR by configuring the character whitelist to match typical license plate characters and utilizing image preprocessing filters such as `Deskew`, `DeNoise`, and `EnhanceResolution` to improve input image quality.
What languages does IronOCR support for license plate recognition?
IronOCR's license plate recognition currently supports English, Chinese, Japanese, Korean, and Latin alphabet scripts.
Can IronOCR handle multiple license plate images in batch processing?
Yes, IronOCR can handle multiple vehicle images in batch processing by configuring the `ReadLicensePlate` method for optimal performance, enabling batch operations to process each image asynchronously.
How do I retrieve license plate location coordinates using IronOCR?
Using IronOCR, you can retrieve license plate location coordinates by accessing the `OcrLicensePlateResult`'s `Licenseplate` property, which provides pixel coordinates and dimensions of the plate area in the image.
What are common use cases for license plate recognition with IronOCR?
Common use cases include parking management, toll collection, security surveillance, fleet management, and law enforcement — all benefiting from IronOCR's high accuracy and real-time processing capabilities.
What type of images provide the best results for IronOCR?
Images with clear visibility of the license plate, good lighting conditions, minimal angle distortion, and adequate resolution provide the best results when using IronOCR for license plate recognition.
How can I monitor IronOCR's performance during license plate recognition?
You can monitor IronOCR's performance by subscribing to its `OcrProgress` event, which provides real-time progress information during the processing of large batches of license plate images.

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.