读取车牌
using IronOcr;
using IronSoftware.Drawing;

// Instantiate OCR engine
var ocr = new IronTesseract();

using var inputLicensePlate = new OcrInput();

inputLicensePlate.LoadImage("LicensePlate.jpeg");

// Perform OCR
OcrLicensePlateResult result = ocr.ReadLicensePlate(inputLicensePlate);

// Retrieve license plate coordinates
Rectangle rectangle = result.Licenseplate;

// Retrieve license plate value
string output = result.Text;
NuGet Download
PM > Install-Package IronOcr
读取车牌

读取车牌

这种方法有效地从图像中提取车牌号码,使用 IronTesseract OCR 引擎。此示例说明:

  1. IronTesseract 初始化:创建一个 IronTesseract 实例以处理OCR操作。
  2. 图像加载:使用 OcrInput 类加载包含车牌的图像文件。
  3. OCR 过程:在 OcrInput 对象上使用 Read 方法,执行OCR并识别图像中的文本。 4.结果分析:对识别出的词语进行迭代。 如果将任何单词识别为车牌号,则打印其文本和边界框。

这段代码在停车管理、车辆出入控制和自动识别系统等应用中特别有用。

了解如何使用 IronOCR 读取车牌
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 6,357,159版本:2026.11刚刚发布