Turkish OCR in C# and .NET
This article was translated from English: Does it need improvement?
Translated
View the article in English
本文件的其他版本:
IronOCR 是一個 C# 軟體元件,讓 .NET 程式設計師能夠從 126 種語言(包括土耳其語)的圖片和 PDF 文件中讀取文字。
這是 Tesseract 的進階分支版本,專為 .NET 開發人員打造,無論在速度或準確度方面,其表現均經常優於其他 Tesseract 引擎。
IronOcr.Languages.Turkish 內容
此套件包含 46 種適用於 .NET 的 OCR 語言:
- 土耳其語
- 土耳其語Best
- 土耳其語Fast
下載
土耳其語語言套件 [Türkçe]
安裝
第一步是使用以下 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 流程,以從輸入的圖片中讀取土耳其文。 接著將擷取的文字PRINT至控制台。

