C# 和 .NET 中的土耳其語 OCR
This article was translated from English: Does it need improvement?
TranslatedView the article in English
Other versions of this document:
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括土耳其語)的文字。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Turkish 的內容
此軟體包包含 46 種適用於 .NET 的 OCR 語言:
- 土耳其語
- TurkishBest
- TurkishFast
下載
土耳其語語言包[土耳其語]
安裝
第一步是使用以下 NuGet 套件管理器命令在您的 .NET 專案中安裝土耳其語OCR 套件。
Install-Package IronOCR.Languages.Turkish
程式碼範例
此 C# 程式碼範例示範如何從圖像或 PDF 文件中讀取土耳其語文字。
// Import the IronOcr namespace
using IronOcr;
class OCRExample
{
static void Main()
{
// Create a new IronTesseract object
var Ocr = new IronTesseract();
// Set the OCR language to Turkish
Ocr.Language = OcrLanguage.Turkish;
// Define the input using a path to the image or PDF file
using (var Input = new OcrInput(@"images\Turkish.png"))
{
// Perform the OCR reading operation
var Result = Ocr.Read(Input);
// Retrieve the text from the OCR result
var AllText = Result.Text;
// Print the extracted text to the console
Console.WriteLine(AllText);
}
}
}// Import the IronOcr namespace
using IronOcr;
class OCRExample
{
static void Main()
{
// Create a new IronTesseract object
var Ocr = new IronTesseract();
// Set the OCR language to Turkish
Ocr.Language = OcrLanguage.Turkish;
// Define the input using a path to the image or PDF file
using (var Input = new OcrInput(@"images\Turkish.png"))
{
// Perform the OCR reading operation
var Result = Ocr.Read(Input);
// Retrieve the text from the OCR result
var AllText = Result.Text;
// Print the extracted text to the console
Console.WriteLine(AllText);
}
}
}' Import the IronOcr namespace
Imports IronOcr
Friend Class OCRExample
Shared Sub Main()
' Create a new IronTesseract object
Dim Ocr = New IronTesseract()
' Set the OCR language to Turkish
Ocr.Language = OcrLanguage.Turkish
' Define the input using a path to the image or PDF file
Using Input = New OcrInput("images\Turkish.png")
' Perform the OCR reading operation
Dim Result = Ocr.Read(Input)
' Retrieve the text from the OCR result
Dim AllText = Result.Text
' Print the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class$vbLabelText $csharpLabel
這段程式碼使用 IronOCR 設定 OCR 流程,從輸入影像中讀取土耳其文字。 然後,它將提取的文字列印到控制台。





