フッターコンテンツにスキップ
OCRツール

Azure OCR対Google OCR(OCR機能の比較)

今日のデジタル環境において、光学文字認識(OCR)技術は、画像、PDF、その他のドキュメントから効率的にテキストを抽出することを求める企業にとって不可欠なものとなっています。 多数のOCRソリューション機能が利用可能な中で、Microsoft Azure OCR、Google OCR、IronOCRは、それぞれ独自の機能と能力を提供するリーディングコンテンツとして際立っています。 この記事では、これらのOCRサービス、その機能、そしてどれを選ぶべきかについて議論します。

1. OCRサービスの紹介

OCRサービスは、画像やドキュメントからテキストを抽出するために高度な機械学習アルゴリズムを活用したクラウドベースのプラットフォームです。 Azure OCR、Google OCR、およびIronOCRは、それぞれの強みとアプリケーションを持つ広く使用されているOCRサービスです。

2. Azure OCR

マイクロソフトAzureのコグニティブサービススイートの一部として、Azure OCRツールは、テキスト認識タスクのための信頼できるスケーラブルなソリューションを提供します。 多様な言語とドキュメント形式をサポートしており、多様なユースケースに適しています。 Microsoft Azure OCRは、ディープラーニングモデルを活用してテキスト抽出の高い精度を実現し、企業がドキュメント処理ワークフローを効率化するのを可能にしています。 Azureはよりコンピュータービジョンサービスに近いです。

2.1 Azure OCRの主要機能

  • 言語サポート: Microsoft Azure OCRは、アラビア語や中国語のような複雑なスクリプトを含む70以上の言語をサポートしています。
  • ドキュメント形式: 画像、PDF、スキャンされたドキュメントなど、さまざまなドキュメント形式を処理できます。
  • スケーラビリティ: Azure OCRは、大量のテキスト抽出要求をシームレスに処理できるため、エンタープライズレベルのアプリケーションに適しています。

2.2 コード例 (C#)

using Microsoft.Azure.CognitiveServices.Vision.ComputerVision;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models;
using System;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        // Create an instance of the ComputerVisionClient
        ComputerVisionClient client = new ComputerVisionClient(new ApiKeyServiceClientCredentials("YOUR_API_KEY"))
        {
            Endpoint = "https://YOUR_REGION.api.cognitive.microsoft.com/"
        };

        // Specify the image URL
        string imageUrl = "https://example.com/image.jpg";

        // Perform OCR on the image
        OcrResult result = await client.RecognizePrintedTextAsync(true, imageUrl);

        // Display the extracted text
        foreach (var region in result.Regions)
        {
            foreach (var line in region.Lines)
            {
                foreach (var word in line.Words)
                {
                    Console.Write(word.Text + " ");
                }
                Console.WriteLine();
            }
        }
    }
}
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models;
using System;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        // Create an instance of the ComputerVisionClient
        ComputerVisionClient client = new ComputerVisionClient(new ApiKeyServiceClientCredentials("YOUR_API_KEY"))
        {
            Endpoint = "https://YOUR_REGION.api.cognitive.microsoft.com/"
        };

        // Specify the image URL
        string imageUrl = "https://example.com/image.jpg";

        // Perform OCR on the image
        OcrResult result = await client.RecognizePrintedTextAsync(true, imageUrl);

        // Display the extracted text
        foreach (var region in result.Regions)
        {
            foreach (var line in region.Lines)
            {
                foreach (var word in line.Words)
                {
                    Console.Write(word.Text + " ");
                }
                Console.WriteLine();
            }
        }
    }
}
Imports Microsoft.Azure.CognitiveServices.Vision.ComputerVision
Imports Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
Imports System
Imports System.Threading.Tasks

Friend Class Program
	Shared Async Function Main(ByVal args() As String) As Task
		' Create an instance of the ComputerVisionClient
		Dim client As New ComputerVisionClient(New ApiKeyServiceClientCredentials("YOUR_API_KEY")) With {.Endpoint = "https://YOUR_REGION.api.cognitive.microsoft.com/"}

		' Specify the image URL
		Dim imageUrl As String = "https://example.com/image.jpg"

		' Perform OCR on the image
		Dim result As OcrResult = Await client.RecognizePrintedTextAsync(True, imageUrl)

		' Display the extracted text
		For Each region In result.Regions
			For Each line In region.Lines
				For Each word In line.Words
					Console.Write(word.Text & " ")
				Next word
				Console.WriteLine()
			Next line
		Next region
	End Function
End Class
$vbLabelText   $csharpLabel

2.2.1 出力

Azure OCR vs Google OCR (OCR機能比較):図1 - Azure OCRコードのコンソール出力

3. Google OCR

Google Cloudサービスプロバイダーの一部として、Google OCRは、テキスト認識とドキュメント分析のための強力なプラットフォームを提供します。 Googleの高度な機械学習アルゴリズムを活用し、正確なテキスト抽出能力を提供し、クラウドコンピューティングを通じて画像ラベル付けや物体検出などの追加機能を提供します。 GoogleクラウドプラットフォームのOCRは、請求書処理、フォーム認識、コンテンツデジタル化などのタスクに広く使用されています。

3.1 Google OCRの主要機能

  • 多言語サポート: Google OCRは、ラテン文字、キリル文字、漢字を含む複数のスクリプトで200以上の言語をサポートしています。
  • 画像分析: ラベル検出、顔検出、ランドマーク認識など、先進的な画像分析機能を提供します。
  • Google Cloudサービスとの統合: Google OCRは、他のGoogle CloudビジョンAPIサービスとシームレスに統合されており、開発者がドキュメント管理と分析のための包括的なソリューションを構築できるようにします。

3.2 コード例 (C#)

using System;
using Google.Cloud.Vision.V1;

class Program
{
    static void Main(string[] args)
    {
        // Configure the ImageAnnotator client with credentials
        var clientBuilder = new ImageAnnotatorClientBuilder { CredentialsPath = "path-to-credentials.json" };
        var client = clientBuilder.Build();

        // Load the image from file
        var image = Image.FromFile("path-to-your-image.jpg");

        // Perform text detection on the image
        var response = client.DetectText(image);

        // Display the detected text
        foreach (var annotation in response)
        {
            Console.WriteLine(annotation.Description);
        }
    }
}
using System;
using Google.Cloud.Vision.V1;

class Program
{
    static void Main(string[] args)
    {
        // Configure the ImageAnnotator client with credentials
        var clientBuilder = new ImageAnnotatorClientBuilder { CredentialsPath = "path-to-credentials.json" };
        var client = clientBuilder.Build();

        // Load the image from file
        var image = Image.FromFile("path-to-your-image.jpg");

        // Perform text detection on the image
        var response = client.DetectText(image);

        // Display the detected text
        foreach (var annotation in response)
        {
            Console.WriteLine(annotation.Description);
        }
    }
}
Imports System
Imports Google.Cloud.Vision.V1

Friend Class Program
	Shared Sub Main(ByVal args() As String)
		' Configure the ImageAnnotator client with credentials
		Dim clientBuilder = New ImageAnnotatorClientBuilder With {.CredentialsPath = "path-to-credentials.json"}
		Dim client = clientBuilder.Build()

		' Load the image from file
		Dim image As System.Drawing.Image = System.Drawing.Image.FromFile("path-to-your-image.jpg")

		' Perform text detection on the image
		Dim response = client.DetectText(image)

		' Display the detected text
		For Each annotation In response
			Console.WriteLine(annotation.Description)
		Next annotation
	End Sub
End Class
$vbLabelText   $csharpLabel

3.2.1 出力

Azure OCR vs Google OCR (OCR機能比較):図2 - Google OCRコードのコンソール出力

4. IronOCR

IronOCR は、Iron Softwareによって開発された.NETアプリケーション向けの多用途なOCRライブラリで、業界をリードするOCRの精度とパフォーマンスを提供します。 クラウドベースのOCRサービスとは異なり、IronOCRはオンプレミステキスト抽出機能を提供し、データのプライバシーとセキュリティを必要とするアプリケーションに適しています。 IronOCRは、特に複雑なレイアウトやノイズの多い画像を伴うシナリオでの精度に優れ、信頼できるOCR機能を求める企業にとっての第一選択となります。

4.1 IronOCRの主要機能

  • 高精度: IronOCRは、テキスト認識において優れた精度を発揮し、多様なドキュメントタイプと言語において信頼できる結果を保証します。
  • オンプレミスのOCR: オンプレミステキスト抽出機能を提供し、企業が外部サービスに依存せずに機密ドキュメントをローカルで処理することを可能にします。
  • 多用途な言語サポート: IronOCRは125以上の言語をサポートしており、多国語のテキスト認識をスムーズに行うための包括的な言語パックを提供します。

4.2 IronOCRのインストール

IronOCRは、NuGetパッケージマネージャーコンソールを使用してインストールできます。 次のコマンドを実行してください。

  1. Visual Studioを開き、新しいプロジェクトを作成するか、既存のプロジェクトを開きます。
  2. ツールバーのツールに移動して、NuGetパッケージマネージャーを選択します。

Azure OCR vs Google OCR (OCR機能比較):図3 - Visual StudioのNuGetパッケージマネージャーがどこにあるか

  1. 新しく表示されたリストからパッケージマネージャーコンソールを選択します。
  2. コンソールが表示されたら、次のコマンドを実行し、エンターキーを押してください。
Install-Package IronOcr

IronOCRのインストールには少し時間がかかりますが、完了したらコード例に進むことができます。

4.3 コード例 (C#)

using IronOcr;
using System;

class Program
{
    static void Main(string[] args)
    {
        // Specify the path to the image file
        string imagePath = "path-to-your-image.jpg";

        // Instantiate the IronTesseract OCR engine
        var ocr = new IronTesseract
        {
            // Set the language for text recognition
            Language = OcrLanguage.English
        };

        // Perform text recognition on the image
        var result = ocr.Read(imagePath);

        // Display the extracted text
        Console.WriteLine("Extracted Text:");
        Console.WriteLine(result.Text);
    }
}
using IronOcr;
using System;

class Program
{
    static void Main(string[] args)
    {
        // Specify the path to the image file
        string imagePath = "path-to-your-image.jpg";

        // Instantiate the IronTesseract OCR engine
        var ocr = new IronTesseract
        {
            // Set the language for text recognition
            Language = OcrLanguage.English
        };

        // Perform text recognition on the image
        var result = ocr.Read(imagePath);

        // Display the extracted text
        Console.WriteLine("Extracted Text:");
        Console.WriteLine(result.Text);
    }
}
Imports IronOcr
Imports System

Friend Class Program
	Shared Sub Main(ByVal args() As String)
		' Specify the path to the image file
		Dim imagePath As String = "path-to-your-image.jpg"

		' Instantiate the IronTesseract OCR engine
		Dim ocr = New IronTesseract With {.Language = OcrLanguage.English}

		' Perform text recognition on the image
		Dim result = ocr.Read(imagePath)

		' Display the extracted text
		Console.WriteLine("Extracted Text:")
		Console.WriteLine(result.Text)
	End Sub
End Class
$vbLabelText   $csharpLabel

4.3.1 出力

Azure OCR vs Google OCR (OCR機能比較):図4 - IronOCRコードのコンソール出力

5. 比較評価

5.1 精度とパフォーマンス

  • Microsoft Azure OCRとGoogle OCRは、テキスト抽出において高い精度を提供し、幅広いアプリケーションに適しています。
  • IronOCRは、特に複雑なレイアウトやノイズの多い画像を伴うシナリオにおいて卓越した精度を発揮します。

5.2 統合のしやすさ

  • Microsoft Azure OCR と Google Cloud のソリューションは、クラウドベースの OCR サービスを提供し、クラウドアプリケーションやサービスとの容易な統合を可能にします。
  • IronOCRは、オンプレミスのOCR機能と.NETアプリケーションとのシームレスな統合を提供し、直感的なAPIと豊富なドキュメントを提供します。

5.3 スケーラビリティ

  • Microsoft Azure OCR および Google OCR は、大量のテキスト抽出要求をシームレスに処理でき、エンタープライズレベルのアプリケーションに適しています。
  • Irons OCRのスケーラビリティは、アプリケーションのインフラストラクチャによって左右されますが、オンプレミスでの運用が求められます。

6. 結論

すべてのOCRツールの中で、Azure OCR、Google Vision API、およびIronOCRは、テキスト抽出タスクにおいて高精度と高パフォーマンスを提供する強力なOCRソリューションとして知られています。 Azure OCRとGoogle OCRは、スケーラブルなインフラストラクチャと広範な言語サポートを備えたクラウドベースのOCRサービスを提供しますが、IronOCRは最も正確なソリューションとして際立っています。

IronOCRは、特にオンプレミステキスト抽出と優れた精度を求めるアプリケーションにおいて秀でています。 IronOCRを活用することで、企業はドキュメント処理ワークフローを効率化し、データ抽出の精度を向上させ、スキャンされたドキュメントや画像から価値あるインサイトを引き出すことができるため、最良の選択肢となります。

IronOCRとそのサービスの詳細については、IronOCRドキュメントページにアクセスして、画像の処理方法を変革するためのスタートを切ることができます。

Kannaopat Udonpant
ソフトウェアエンジニア
ソフトウェアエンジニアになる前に、Kannapatは北海道大学で環境資源の博士号を修了しました。博士号を追求する間に、彼はバイオプロダクションエンジニアリング学科の一部である車両ロボティクスラボラトリーのメンバーになりました。2022年には、C#のスキルを活用してIron Softwareのエンジニアリングチームに参加し、IronPDFに注力しています。Kannapatは、IronPDFの多くのコードを執筆している開発者から直接学んでいるため、この仕事を大切にしています。同僚から学びながら、Iron Softwareでの働く社会的側面も楽しんでいます。コードやドキュメントを書いていない時は、KannapatはPS5でゲームをしたり、『The Last of Us』を再視聴したりしていることが多いです。