Urdu OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
此文件的其他版本:
IronOCR是一個C#軟體元件,允許.NET程式員從圖像和PDF文件中讀取126種語言的文字,包括烏爾都語。
它是Tesseract的一個高級派生版本,專為.NET開發人員打造,並且在速度和準確性方面經常超越其他Tesseract引擎。
IronOcr.Languages.Urdu的內容
此配套程式包含37種適用於.NET的OCR語言:
- 烏爾都語
- 烏爾都語Best
- 烏爾都語Fast
下載
烏爾都語語言包 [اردو]
安裝
我們必須做的第一件事是在您的.NET專案中安裝我們的烏爾都語OCR配套程式。
Install-Package IronOcr.Languages.Urdu
程式碼範例
此C#程式碼範例從圖像或PDF文件中讀取烏爾都語文字。
// Install the IronOcr.Languages.Urdu package
using IronOcr;
var Ocr = new IronTesseract(); // Create a new OCR object
Ocr.Language = OcrLanguage.Urdu; // Set the language to Urdu
// Using a block that ensures the Input object gets disposed after use
using (var Input = new OcrInput(@"images\Urdu.png"))
{
var Result = Ocr.Read(Input); // Perform OCR on the input
var AllText = Result.Text; // Extract the recognized text
// AllText now contains the Urdu text read from the image
}
// Install the IronOcr.Languages.Urdu package
using IronOcr;
var Ocr = new IronTesseract(); // Create a new OCR object
Ocr.Language = OcrLanguage.Urdu; // Set the language to Urdu
// Using a block that ensures the Input object gets disposed after use
using (var Input = new OcrInput(@"images\Urdu.png"))
{
var Result = Ocr.Read(Input); // Perform OCR on the input
var AllText = Result.Text; // Extract the recognized text
// AllText now contains the Urdu text read from the image
}
' Install the IronOcr.Languages.Urdu package
Imports IronOcr
Private Ocr = New IronTesseract() ' Create a new OCR object
Ocr.Language = OcrLanguage.Urdu ' Set the language to Urdu
' Using a block that ensures the Input object gets disposed after use
Using Input = New OcrInput("images\Urdu.png")
Dim Result = Ocr.Read(Input) ' Perform OCR on the input
Dim AllText = Result.Text ' Extract the recognized text
' AllText now contains the Urdu text read from the image
End Using
$vbLabelText
$csharpLabel

