Gujarati 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.Gujarati 的內容
此套件包含 120 種適用於 .NET 的 OCR 語言:
- 古吉拉特語
- 古吉拉特語Best
- 古吉拉特語Fast
- 古吉拉特語字母
- 古吉拉特語字母Best
- 古吉拉特語字母Fast
下載
古吉拉特語語言套件 [ગજરાતી]
安裝
我們首先必須將古吉拉特語 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

