Thai Alphabet OCR in C# and .NET

This article was translated from English: Does it need improvement?
Translated
View the article in English
Bu belgenin diğer versiyonları:

IronOCR, C# ile yazılmış bir yazılım bileşenidir ve .NET kodlayıcılarının, Thai Alfabesi dahil olmak üzere 126 dilde resimlerden ve PDF belgelerinden metin okumasına olanak tanır.

Tesseract'ın ileri düzey bir çatallamasıdır, yalnızca .NET geliştiricileri için oluşturulmuş olup hız ve doğruluk açısından diğer Tesseract motorlarını düzenli olarak geride bırakmaktadır.

IronOcr.Languages.Thai'nin İçeriği

Bu paket, .NET için 96 OCR dili içerir:

  • Tayca
  • ThaiBest
  • ThaiFast
  • ThaiAlphabet
  • ThaiAlphabetBest
  • ThaiAlphabetFast

İndirme

Tay Alfabesi Dil Paketi [ไทย]

  • Zip olarak indir
  • NuGet ile yükleyin NuGet

Kurulum

İlk yapmamız gereken şey, .NET projenize Thai Alfabesi OCR paketimizi yüklemektir.

Install-Package IronOcr.Languages.Thai

Kod Örneği

Bu C# kod örneği, bir Resim veya PDF belgesinden Thai Alfabesi metnini okur.

// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr; 

class ThaiOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract for OCR processing
        var ocr = new IronTesseract();

        // Set the language to Thai for Optical Character Recognition
        ocr.Language = OcrLanguage.Thai;

        // Using the 'using' statement ensures that resources are properly disposed.
        using (var input = new OcrInput(@"images\Thai.png"))
        {
            // Perform OCR to read the text from the input image
            var result = ocr.Read(input);

            // Retrieve and store all recognized text from the image
            string allText = result.Text;

            // Optionally, you can output the text to console or log it as needed
            System.Console.WriteLine(allText);
        }
    }
}
// Ensure you have installed the IronOcr.Languages.Thai package via NuGet.
// Import the IronOcr namespace to work with IronOCR classes.
using IronOcr; 

class ThaiOcrExample
{
    static void Main()
    {
        // Create a new instance of IronTesseract for OCR processing
        var ocr = new IronTesseract();

        // Set the language to Thai for Optical Character Recognition
        ocr.Language = OcrLanguage.Thai;

        // Using the 'using' statement ensures that resources are properly disposed.
        using (var input = new OcrInput(@"images\Thai.png"))
        {
            // Perform OCR to read the text from the input image
            var result = ocr.Read(input);

            // Retrieve and store all recognized text from the image
            string allText = result.Text;

            // Optionally, you can output the text to console or log it as needed
            System.Console.WriteLine(allText);
        }
    }
}
Imports IronOcr

Class ThaiOcrExample
    Shared Sub Main()
        ' Create a new instance of IronTesseract for OCR processing
        Dim ocr As New IronTesseract()

        ' Set the language to Thai for Optical Character Recognition
        ocr.Language = OcrLanguage.Thai

        ' Using the 'Using' statement ensures that resources are properly disposed.
        Using input As New OcrInput("images\Thai.png")
            ' Perform OCR to read the text from the input image
            Dim result = ocr.Read(input)

            ' Retrieve and store all recognized text from the image
            Dim allText As String = result.Text

            ' Optionally, you can output the text to console or log it as needed
            System.Console.WriteLine(allText)
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

Bu örnekte, images klasorunde yer alan Thai.png adli gorselden Tai metni okuyacagiz. Dosya yolunu gerçek görüntü konumunuzla değiştirdiğinizden emin olun. OCR dili, tanima icin Tai dil paketi belirtmek amaciyla OcrLanguage.Thai kullanarak Tai olarak ayarlanir.