Gujarati OCR in C# and .NET

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

IronOCR 是一個 C# 軟體組件,允許 .NET 程式設計師以包括古吉拉特語在內的 126 種語言從圖片和 PDF 檔案中讀取文字。

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

IronOcr.Languages.Gujarati 的內容

此套件包含 120 種 .NET 的 OCR 語言:

  • 古吉拉特語
  • GujaratiBest
  • GujaratiFast
  • GujaratiAlphabet
  • GujaratiAlphabetBest
  • GujaratiAlphabetFast

下載

古吉拉特語語言包 style='white-space:default'>[古吉拉特語]

安裝

首先,我們必須將 古吉拉特語 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