C# 和 .NET 中的古吉拉特語 OCR

This article was translated from English: Does it need improvement?
Translated
View the article in English
Other versions of this document:

在古吉拉特語中 新增 125 種 OCR 語言

IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括古吉拉特語)的文字。

它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。

IronOcr 的內容。語言。古吉拉特語

此軟體包包含 120 種適用於 .NET 的 OCR 語言:

  • 古吉拉特語
  • GujaratiBest
  • GujaratiFast
  • 古吉拉特字母
  • GujaratiAlphabetBest
  • GujaratiAlphabetFast

下載

古吉拉特語語言包[古吉拉特語]

安裝

我們首先需要做的是將我們的古吉拉特語OCR 套件安裝到您的 .NET 專案中。

Install-Package IronOCR.Languages.Gujarati

程式碼範例

此 C# 程式碼範例從圖像或 PDF 文件中讀取古吉拉特語文字。

// Import the IronOcr namespace to access OCR functionality
using IronOcr;

// Create an instance of the IronTesseract class to handle the OCR process
var Ocr = new IronTesseract();

// Set the language to Gujarati
Ocr.Language = OcrLanguage.Gujarati;

// Use the OcrInput class to provide the path to the image or PDF containing Gujarati text
using (var Input = new OcrInput(@"images\Gujarati.png"))
{
    // Perform OCR on the input document and obtain the result
    var Result = Ocr.Read(Input);

    // Extract the recognized text from the OCR result
    var AllText = Result.Text;

    // Display or use the extracted text as needed
    Console.WriteLine(AllText);
}
// Import the IronOcr namespace to access OCR functionality
using IronOcr;

// Create an instance of the IronTesseract class to handle the OCR process
var Ocr = new IronTesseract();

// Set the language to Gujarati
Ocr.Language = OcrLanguage.Gujarati;

// Use the OcrInput class to provide the path to the image or PDF containing Gujarati text
using (var Input = new OcrInput(@"images\Gujarati.png"))
{
    // Perform OCR on the input document and obtain the result
    var Result = Ocr.Read(Input);

    // Extract the recognized text from the OCR result
    var AllText = Result.Text;

    // Display or use the extracted text as needed
    Console.WriteLine(AllText);
}
' Import the IronOcr namespace to access OCR functionality
Imports IronOcr

' Create an instance of the IronTesseract class to handle the OCR process
Private Ocr = New IronTesseract()

' Set the language to Gujarati
Ocr.Language = OcrLanguage.Gujarati

' Use the OcrInput class to provide the path to the image or PDF containing Gujarati text
Using Input = New OcrInput("images\Gujarati.png")
	' Perform OCR on the input document and obtain the result
	Dim Result = Ocr.Read(Input)

	' Extract the recognized text from the OCR result
	Dim AllText = Result.Text

	' Display or use the extracted text as needed
	Console.WriteLine(AllText)
End Using
$vbLabelText   $csharpLabel