在IronOCR中使用阿拉伯數字
This article was translated from English: Does it need improvement?
Translated
View the article in English
阿拉伯語、波斯語和烏爾都語語言包無法識別阿拉伯數字嗎?
這是Tesseract語言包已知的問題。
以下語言包可能有助於解決阿拉伯數字的問題: Shreeshrii's Tessdata Arabic
然後可以使用IronOCR功能載入自定義語言包: IronOCR自定義語言範例
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
using IronOcr;
class ArabicNumeralOCR
{
static void Main(string[] args)
{
// Initialize a new instance of IronTesseract for OCR
var Ocr = new IronTesseract();
// Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
// Specify the image input for OCR processing
using (var Input = new OcrInput(@"images\image.png"))
{
// Execute the OCR process on the input image
var Result = Ocr.Read(Input);
// Output the recognized text
Console.WriteLine(Result.Text);
}
}
}
Imports IronOcr
Friend Class ArabicNumeralOCR
Shared Sub Main(ByVal args() As String)
' Initialize a new instance of IronTesseract for OCR
Dim Ocr = New IronTesseract()
' Load the custom Tesseract language file for better numeral recognition
Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
' Specify the image input for OCR processing
Using Input = New OcrInput("images\image.png")
' Execute the OCR process on the input image
Dim Result = Ocr.Read(Input)
' Output the recognized text
Console.WriteLine(Result.Text)
End Using
End Sub
End Class
$vbLabelText
$csharpLabel
注意:此C#範例演示如何在IronOCR中使用自定義Tesseract語言檔案以提高在圖像中識別阿拉伯數字的能力。 假設您已經下載了適當的語言包並將其放置在指定的位置。 確保安裝IronOCR並在產品程式碼中加入必要的錯誤處理。
準備開始了嗎?
Nuget 下載 6,136,090 | 版本: 2026.7 剛剛發布

