在实际环境中测试
在生产中测试无水印。
随时随地为您服务。
在当今的数字化时代,光学字符识别技术 (光学字符识别) 对于希望从图像、PDF 和其他文档中高效提取文本的企业来说,OCR 技术已变得不可或缺。在众多 OCR 解决方案功能中,微软 Azure OCR 与谷歌 OCR 以及 IronOCR 作为主要竞争者,它们各自提供了独特的功能和能力。在本文中,我们将讨论这些 OCR 服务、它们的功能以及应该选择哪一种。
OCR 服务是基于云的平台,利用先进的机器学习算法从图像和文档中提取文本。它们提供一系列功能,包括多语言支持、布局检测和手写识别。Azure OCR、Google OCR 和 IronOCR 是广泛使用的 OCR 服务,各有其优势和应用。
......(英文 Azure OCR 该工具是 Microsoft Azure 认知服务套件的一部分,为文本识别任务提供了可靠且可扩展的解决方案。它支持多种语言和文档格式,适用于各种使用案例。Microsoft Azure OCR利用深度学习模型实现高精度的文本提取,使企业能够高效地简化文档处理工作流程Azure更像是一种计算机视觉服务。
文档格式:它可以处理各种文档格式,包括图像、PDF 和扫描文档。
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
谷歌 OCR作为谷歌云服务提供商的一部分,谷歌云为文本识别和文档分析提供了一个强大的平台。它利用谷歌先进的机器学习算法,提供准确的文本提取功能,并通过云计算提供图像标注和对象检测等附加功能。谷歌云平台 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 开发的 IronOCR 是一款适用于 .NET 应用程序的多功能 OCR 库,具有业界领先的 OCR 精确度和性能。与基于云的 OCR 服务不同,IronOCR 提供内部文本提取功能,因此适用于要求数据保密性和安全性的应用程序。IronOCR 在准确性方面表现出色,尤其是在涉及复杂布局、手写文本和嘈杂图像的情况下,使其成为寻求可靠 OCR 功能的企业的首选。
本地 OCR:它提供本地文本提取功能,使企业能够在本地处理敏感文档,而无需依赖外部服务。
可使用 NuGet 软件包管理器控制台安装 IronOCR,只需运行以下命令即可。
1.打开 Visual Studio,创建新项目或打开现有项目。
2.在工具栏中进入工具,选择 NuGet 包管理器。
3.现在从新出现的列表中选择软件包管理器控制台。
4.现在控制台将出现,运行以下命令并按回车键。
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 众所周知,IronOCR 是功能强大的 OCR 解决方案,可为文本提取任务提供高准确性和高性能。Azure OCR 和 Google OCR 提供基于云的 OCR 服务,具有可扩展的基础设施和广泛的语言支持,而 IronOCR 则是最准确的解决方案。
IronOCR 尤其适用于需要内部文本提取和卓越准确性的应用。通过利用 IronOCR,企业可以简化文档处理工作流程,提高数据提取的准确性,并从扫描的文档和图像中获取有价值的信息,使其成为首选。
要了解有关 IronOCR 及其服务的更多信息,请访问 IronOCR 文档页面 许可证,让你开始改变处理图像的方式。