在生產環境中測試,無水印。
在任何需要的地方都能運行。
獲得 30 天的全功能產品。
在幾分鐘內上手運行。
試用產品期間完全訪問我們的支援工程團隊
在當今的數位環境中,光學字元識別(OCR)技術已成為希望從圖像、PDF 和其他文件中高效提取文字的企業不可或缺的工具。 在眾多可用的 OCR 解決方案功能中,Microsoft Azure OCR 和 Google OCR 以及 IronOCR 脫穎而出,成為領先的競爭者,每一個都提供獨特的功能和能力。 在本文中,我們討論這些OCR服務、它們的功能以及應該選擇哪一個。
OCR 服務是基於雲端的平台,利用先進的機器學習算法從圖像和文件中提取文本。 Azure OCR、Google OCR 和 IronOCR 是廣泛使用的 OCR 服務,每個都有其優勢和應用。
這個Azure OCR工具,作為Microsoft Azure Cognitive Services套件的一部分,提供了一個可靠且可擴展的文字識別任務解決方案。 它支持多種語言和文件格式,非常適合多種使用情境。 Microsoft Azure OCR 憑藉深度學習模型實現高精度的文字提取,讓企業能夠高效地精簡文件處理工作流程。Azure 更像是一種計算機視覺服務。
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision;
using Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models;
using System;
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;
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
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
Google OCR作為Google雲端服務提供商的一部分,提供了一個強大的文本識別和文件分析平台。 利用 Google 的先進機器學習算法,它提供準確的文本提取功能,並透過雲端運算提供圖像標記和物體檢測等附加功能。 Google 雲端平台 OCR 廣泛應用於各種行業,如發票處理、表格識別和內容數位化。
using Google.Cloud.Vision.V1;
using Google.Protobuf;
using System.IO;
using Google.Apis.Auth.OAuth2;
var clientBuilder = new ImageAnnotatorClientBuilder { CredentialsPath = "path-to-credentials.json" };
var client = clientBuilder.Build();
var image = Image.FromFile("path-to-your-image.jpg");
var response = client.DetectText(image);
foreach (var annotation in response)
{
Console.WriteLine(annotation.Description);
}
using Google.Cloud.Vision.V1;
using Google.Protobuf;
using System.IO;
using Google.Apis.Auth.OAuth2;
var clientBuilder = new ImageAnnotatorClientBuilder { CredentialsPath = "path-to-credentials.json" };
var client = clientBuilder.Build();
var image = Image.FromFile("path-to-your-image.jpg");
var response = client.DetectText(image);
foreach (var annotation in response)
{
Console.WriteLine(annotation.Description);
}
Imports Google.Cloud.Vision.V1
Imports Google.Protobuf
Imports System.IO
Imports Google.Apis.Auth.OAuth2
Private clientBuilder = New ImageAnnotatorClientBuilder With {.CredentialsPath = "path-to-credentials.json"}
Private client = clientBuilder.Build()
Private image = System.Drawing.Image.FromFile("path-to-your-image.jpg")
Private response = client.DetectText(image)
For Each annotation In response
Console.WriteLine(annotation.Description)
Next annotation
IronOCR由Iron Software開發,是一個用於.NET應用程式的多功能OCR庫,提供業界領先的OCR準確性和效能。 與基於雲的OCR服務不同,IronOCR 提供內部部署的文本提取功能,適用於需要數據隱私和安全的應用程式。 IronOCR 在準確性方面表現卓越,特別是在涉及複雜佈局和噪聲圖像的情況下,成為尋求可靠 OCR 功能的企業的首選。
您可以使用 NuGet 套件管理器在控制台中安裝 IronOCR,只需運行以下命令。
打開 Visual Studio,然後建立一個新專案或打開已存在的專案。
現在從新出現的列表中選擇套件管理器主控台。
Install-Package IronOcr
安裝 IronOCR 將需要一些時間,但一旦完成我們便可以開始進行編碼範例。
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
ocr.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
ocr.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()
' Set the language for text recognition
ocr.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
在所有的 OCR 工具中,Azure OCR、Google Vision API 和 IronOCR 被認為是功能強大的 OCR 解決方案,能為文字擷取任務提供高準確度和高效能。 雖然 Azure OCR 和 Google OCR 提供具可擴展性基礎設施及廣泛語言支援的雲端 OCR 服務,但 IronOCR 以其最精確的解決方案而脫穎而出。
IronOCR 尤其適用於需要內部部署文本提取和卓越準確性的應用程式。 通過利用IronOCR,企業可以精簡文件處理工作流程,提高數據提取準確性,並從掃描文件和圖像中獲得有價值的見解,使其成為首選。
如需了解有關 IronOCR 及其服務的更多資訊,請造訪 IronOCR 文件頁面 授權,開始改變您處理圖像的方式。