在实际环境中测试
在生产中测试无水印。
随时随地为您服务。
光学字符识别 (光学字符识别)翻译是将扫描图像、PDF 和其他数字文档转换为机器可读文本的关键技术。 它广泛应用于文档处理、自动化工作流程以及需要解释人类可读文本的人工智能系统。 说到 OCR 服务,有很多 OCR 工具可以管理 OCR 任务。 其中包括亚马逊网络服务等云提供商(AWS)例如,微软 Azure 和谷歌云平台上的谷歌云视觉 API 提供了功能强大的云解决方案,而 IronOCR 等第三方库则为特定用例或需要功能强大的 OCR 库以频繁使用 OCR 的用户提供了可行的替代方案。
在本文中,我们将比较AWS OCR (AWS Textract), Azure OCR (Azure 认知服务)和IronOCR此外,译文还将重点介绍.NET、Java、Python 或 Node js 的功能、性能、价格和开发人员的可用性,以帮助您确定哪种工具最适合您的项目需求。
破损图片 添加自 Pixabay,请从您的文件中选择或将图片拖放到此处。
AWS TextractOCR 是亚马逊完全托管的 OCR 服务,用于从扫描文档、表格、表格等中提取文本。 Textract 与 AWS 生态系统深度集成,针对大规模云解决方案的使用进行了优化,同时支持实时和批量文档处理。
AWS Textract 性能卓越,尤其适用于大规模批量处理。 它可以高效地处理大量数据集,但实时处理可能会因文件量而出现轻微延迟。
Textract 与其他 AWS 服务(如 S3、Lambda 和 Rekognition)无缝集成,为在 AWS 环境中工作的开发人员提供协调一致的体验。 下面是一个基本的 C# 示例,说明如何将 Textract 与 AWS SDK 结合使用:
var textractClient = new AmazonTextractClient(RegionEndpoint.USEast1);
var request = new DetectDocumentTextRequest
{
Document = new Document
{
S3Object = new S3Object
{
Bucket = "your-bucket-name",
Name = "your-document-name"
}
}
};
var response = await textractClient.DetectDocumentTextAsync(request);
foreach (var block in response.Blocks)
{
Console.WriteLine($"Detected text: {block.Text}");
}
var textractClient = new AmazonTextractClient(RegionEndpoint.USEast1);
var request = new DetectDocumentTextRequest
{
Document = new Document
{
S3Object = new S3Object
{
Bucket = "your-bucket-name",
Name = "your-document-name"
}
}
};
var response = await textractClient.DetectDocumentTextAsync(request);
foreach (var block in response.Blocks)
{
Console.WriteLine($"Detected text: {block.Text}");
}
Dim textractClient = New AmazonTextractClient(RegionEndpoint.USEast1)
Dim request = New DetectDocumentTextRequest With {
.Document = New Document With {
.S3Object = New S3Object With {
.Bucket = "your-bucket-name",
.Name = "your-document-name"
}
}
}
Dim response = Await textractClient.DetectDocumentTextAsync(request)
For Each block In response.Blocks
Console.WriteLine($"Detected text: {block.Text}")
Next block
AWS Textract 采用按使用付费的方式。定价模式您可以在我们的网站上搜索".NET"、"Java"、"Python "或 "Node.js",根据处理的页数计费。 虽然按需使用成本效益较高,但大型项目的定价可能会很快累积。
Azure 认知服务OCR 解决方案旨在从图像和 PDF 中提取文本,并可轻松集成到基于 Azure 的应用程序中。 它适用于云和混合环境中的文档工作流,并可进行定制以处理大规模部署。
Azure OCR 擅长实时处理,其高效架构支持快速文本提取。 批处理功能也很强大,Azure 的可扩展云基础设施即使在负载高峰期也能确保顺利运行。
Azure OCR 与Azure Blob Storage 和Azure Functions 等其他 Azure 服务紧密集成,使构建端到端工作流变得简单。 该服务可通过REST API访问,下面是一个 C# 示例:
var client = new ComputerVisionClient(new ApiKeyServiceClientCredentials("your-api-key"))
{
Endpoint = "https://your-endpoint.cognitiveservices.azure.com/"
};
var ocrResult = await client.RecognizePrintedTextInStreamAsync(true, imageStream);
foreach (var region in ocrResult.Regions)
{
foreach (var line in region.Lines)
{
foreach (var word in line.Words)
{
Console.WriteLine(word.Text);
}
}
}
var client = new ComputerVisionClient(new ApiKeyServiceClientCredentials("your-api-key"))
{
Endpoint = "https://your-endpoint.cognitiveservices.azure.com/"
};
var ocrResult = await client.RecognizePrintedTextInStreamAsync(true, imageStream);
foreach (var region in ocrResult.Regions)
{
foreach (var line in region.Lines)
{
foreach (var word in line.Words)
{
Console.WriteLine(word.Text);
}
}
}
Dim client = New ComputerVisionClient(New ApiKeyServiceClientCredentials("your-api-key")) With {.Endpoint = "https://your-endpoint.cognitiveservices.azure.com/"}
Dim ocrResult = Await client.RecognizePrintedTextInStreamAsync(True, imageStream)
For Each region In ocrResult.Regions
For Each line In region.Lines
For Each word In line.Words
Console.WriteLine(word.Text)
Next word
Next line
Next region
Azure OCR 提供分级定价翻译费用根据交易数量计算。 对于已经使用 Azure 基础架构的企业来说,这通常被认为是具有成本效益的,但对于大型数据集来说,价格可能会大幅上涨。
IronOCR是一个专为 .NET 开发人员设计的强大的第三方 OCR 工具库。 它允许内部部署和基于云的实施,为需要严格控制 OCR 工具的开发人员提供了比 AWS 或 Azure 更大的灵活性。
IronOCR 经过优化,可以快速提取文本,尤其是在专用硬件上运行时。 对于需要在本地或混合云场景中处理数据的开发人员来说,IronOCR 是一个极佳的选择,即使在资源有限的环境中也能提供高性能。
IronOCR 功能强大,易于使用 C#。 下面是一个简单的例子:
using IronOcr;
// Creating a new instance of IronTesseract
var ocr = new IronTesseract();
// Creating a new IronOCR image input from the specified image filepath
using var input = new OcrImageInput("test.png");
// Setting the OCR language
ocr.Language = OcrLanguage.English;
// Reads the text from the provided OcrImageInput object and returns an OcrResult object containing the extracted text
OcrResult result = ocr.Read(input);
// Writing all of the text to a new text file and saving it
File.WriteAllText("result.txt", result.Text);
using IronOcr;
// Creating a new instance of IronTesseract
var ocr = new IronTesseract();
// Creating a new IronOCR image input from the specified image filepath
using var input = new OcrImageInput("test.png");
// Setting the OCR language
ocr.Language = OcrLanguage.English;
// Reads the text from the provided OcrImageInput object and returns an OcrResult object containing the extracted text
OcrResult result = ocr.Read(input);
// Writing all of the text to a new text file and saving it
File.WriteAllText("result.txt", result.Text);
Imports IronOcr
' Creating a new instance of IronTesseract
Private ocr = New IronTesseract()
' Creating a new IronOCR image input from the specified image filepath
Private input = New OcrImageInput("test.png")
' Setting the OCR language
ocr.Language = OcrLanguage.English
' Reads the text from the provided OcrImageInput object and returns an OcrResult object containing the extracted text
Dim result As OcrResult = ocr.Read(input)
' Writing all of the text to a new text file and saving it
File.WriteAllText("result.txt", result.Text)
IronOCR 的许可模式比 AWS 或 Azure 更为灵活。 您只需支付一次性费用即可获得永久许可证,这对于中小型项目来说更具成本效益。 作为奖励,IronOCR 还提供了一个免费试用起价为 $749,并提供企业使用的定制选项。
对比表强调了AWS Textract、Azure OCR和IronOCR之间的核心差异,重点关注准确性、支持格式、特殊功能、性能、集成和定价等关键因素。
AWS Textract 擅长处理表单和表格等结构化文档,是需要从扫描文档中提取详细数据的企业的不二之选。 另一方面,Azure OCR 凭借其卓越的多语言支持脱颖而出,是需要从不同语言中提取文本的全球应用程序的理想选择。
IronOCR该公司的与众不同之处在于其内部和本地处理能力,可提供手写识别、护照等专业文档处理和其他高级功能。条形码此外,译文还必须解释.NET、Java、Python 或 Node js 中的术语,而这些术语在基于云的解决方案中并不总是可用的。 此外,其定价模式以一次性 License 费用为基础,为需要本地 OCR 处理的小型项目或团队提供了长期的成本节约,而无需持续支付云费用。 每种解决方案都有其优势,因此选择合适的解决方案取决于您的项目规模、所需功能和部署环境。
在本文中,我们介绍了一些流行的、功能强大的 OCR 工具。 AWS Textract 和 Azure OCR 都提供了强大、可扩展的 OCR 功能,尤其适合已经在各自云生态系统中投资的企业。 AWS 在结构化文档处理方面表现出色,而 Azure 的多语言支持则是其强大优势。
但是IronOCR对于需要灵活的内部部署解决方案或偏好永久许可模式的开发人员而言,该译文尤为突出。 虽然纯粹的基于云的 OCR 工具(如我们今天介绍的工具),甚至是其他工具(如 Google OCR 工具)对于那些寻求不经常或基本 OCR 使用的人来说可能很受欢迎,但 IronPdf 致力于为那些需要更频繁使用 OCR 的人提供一个强大的工具,以处理几乎所有与 OCR 相关的任务。 它的 OCR 精确度高,易于集成到 .NET 项目中,并具有手写文本识别等高级功能,是正在寻找功能全面强大的 OCR 工具的 .NET 开发人员的有力竞争者。
最终,您在 AWS、Azure 和 IronOCR 之间的选择将取决于您的项目规模、预算和具体的 OCR 需求。