此方法使用IronTesseract OCR引擎有效地從影像中擷取車牌號碼。範例說明:
- IronTesseract 初始化:建立
IronTesseract的實例來處理OCR操作。 - 圖片載入:使用
OcrInput類別載入包含車牌的圖像文件。 - OCR過程:在
Read方法,執行OCR並從圖像中識別文字。 - 結果分析:迭代識別出的字詞。 如果任何字詞被識別為車牌,則列印其文字和邊框。
此程式碼在停車管理、車輛進出控制及自動識別系統相關應用中特別有用。
探索如何使用IronOCR讀取車牌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;
Imports IronOcr
Imports IronSoftware.Drawing
' Instantiate OCR engine
Dim ocr = New IronTesseract()
Using inputLicensePlate = New OcrInput()
inputLicensePlate.LoadImage("LicensePlate.jpeg")
' Perform OCR
Dim result As OcrLicensePlateResult = ocr.ReadLicensePlate(inputLicensePlate)
' Retrieve license plate coordinates
Dim rectangle As Rectangle = result.Licenseplate
' Retrieve license plate value
Dim output As String = result.Text
End Using此方法使用IronTesseract OCR引擎有效地從影像中擷取車牌號碼。範例說明:
IronTesseract的實例來處理OCR操作。OcrInput類別載入包含車牌的圖像文件。Read方法,執行OCR並從圖像中識別文字。此程式碼在停車管理、車輛進出控制及自動識別系統相關應用中特別有用。
探索如何使用IronOCR讀取車牌Nuget Downloads 6,236,385|版本:2026.9剛剛發布