IronOCRでアラビア数字を扱う

This article was translated from English: Does it need improvement?
Translated
View the article in English

アラビア語、ペルシャ語、ウルドゥー語の言語パックではアラビア数字が認識されないのですか?

これは、Tesseract 言語パックの既知の問題です。

次の言語パックは、アラビア数字に関するこの問題の解決に役立つ可能性があります。 ShreeshriiのTessdata Arabic

これを IronOCR 機能と組み合わせて使用し、カスタム言語パックを読み込むことができます。 IronOCRカスタム言語の例

using IronOcr;

class ArabicNumeralOCR
{
    static void Main(string[] args)
    {
        // Initialize a new instance of IronTesseract for OCR
        var Ocr = new IronTesseract();

        // Load the custom Tesseract language file for better numeral recognition
        Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

        // Specify the image input for OCR processing
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Execute the OCR process on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text
            Console.WriteLine(Result.Text);
        }
    }
}
using IronOcr;

class ArabicNumeralOCR
{
    static void Main(string[] args)
    {
        // Initialize a new instance of IronTesseract for OCR
        var Ocr = new IronTesseract();

        // Load the custom Tesseract language file for better numeral recognition
        Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");

        // Specify the image input for OCR processing
        using (var Input = new OcrInput(@"images\image.png"))
        {
            // Execute the OCR process on the input image
            var Result = Ocr.Read(Input);

            // Output the recognized text
            Console.WriteLine(Result.Text);
        }
    }
}
Imports IronOcr

Friend Class ArabicNumeralOCR
	Shared Sub Main(ByVal args() As String)
		' Initialize a new instance of IronTesseract for OCR
		Dim Ocr = New IronTesseract()

		' Load the custom Tesseract language file for better numeral recognition
		Ocr.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")

		' Specify the image input for OCR processing
		Using Input = New OcrInput("images\image.png")
			' Execute the OCR process on the input image
			Dim Result = Ocr.Read(Input)

			' Output the recognized text
			Console.WriteLine(Result.Text)
		End Using
	End Sub
End Class
$vbLabelText   $csharpLabel

注:この C# の例では、IronOCR でカスタム Tesseract 言語ファイルを使用して、画像内のアラビア数字の認識を向上させる方法を示します。 適切な言語パックが既にダウンロードされ、指定された場所に配置されていることを前提としています。 必ず IronOCR をインストールし、本番環境コードに必要なエラー処理を追加してください。

カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はできましたか?
Nuget ダウンロード 5,167,857 | Version: 2025.11 リリース