在生产环境中测试,无水印。
随时随地满足您的需求。
获得30天的全功能产品。
几分钟内就能启动并运行。
在您的产品试用期间,全面访问我们的支持工程团队。
using IronOcr;
using System;
var ocrTesseract = new IronTesseract();
ocrTesseract.Language = OcrLanguage.Arabic;
using (var ocrInput = new OcrInput())
{
ocrInput.LoadImage(@"images\arabic.gif");
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
}
// Example with a Custom Trained Font Being used:
var ocrTesseractCustomerLang = new IronTesseract();
ocrTesseractCustomerLang.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata");
ocrTesseractCustomerLang.AddSecondaryLanguage(OcrLanguage.EnglishBest);
using (var ocrInput = new OcrInput())
{
ocrInput.LoadPdf(@"images\mixed-lang.pdf");
var ocrResult = ocrTesseractCustomerLang.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
}
Imports IronOcr
Imports System
Private ocrTesseract = New IronTesseract()
ocrTesseract.Language = OcrLanguage.Arabic
Using ocrInput As New OcrInput()
ocrInput.LoadImage("images\arabic.gif")
Dim ocrResult = ocrTesseract.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
End Using
' Example with a Custom Trained Font Being used:
Dim ocrTesseractCustomerLang = New IronTesseract()
ocrTesseractCustomerLang.UseCustomTesseractLanguageFile("custom_tesseract_files/custom.traineddata")
ocrTesseractCustomerLang.AddSecondaryLanguage(OcrLanguage.EnglishBest)
Using ocrInput As New OcrInput()
ocrInput.LoadPdf("images\mixed-lang.pdf")
Dim ocrResult = ocrTesseractCustomerLang.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
End Using
IronOCR支持125种国际语言。
除了默认安装的英语外,还可以通过NuGet添加语言包到您的.NET项目中,或者从我们的网站下载。语言页面.
大多数语言都有快速和标准版本可用。(推荐)和最佳质量。 最好可能更准确,但也更慢。
using IronOcr;
using IronSoftware.Drawing;
// We can delve deep into OCR results as an object model of
// Pages, Barcodes, Paragraphs, Lines, Words and Characters
// This allows us to explore, export and draw OCR content using other APIs/
var ocrTesseract = new IronTesseract();
ocrTesseract.Configuration.ReadBarCodes = true;
using var ocrInput = new OcrInput();
var pages = new int[] { 1, 2 };
ocrInput.LoadImageFrames("example.tiff", pages);
OcrResult ocrResult = ocrTesseract.Read(ocrInput);
foreach (var page in ocrResult.Pages)
{
// Page object
int PageNumber = page.PageNumber;
string PageText = page.Text;
int PageWordCount = page.WordCount;
// null if we dont set Ocr.Configuration.ReadBarCodes = true;
OcrResult.Barcode[] Barcodes = page.Barcodes;
AnyBitmap PageImage = page.ToBitmap(ocrInput);
double PageWidth = page.Width;
double PageHeight = page.Height;
double PageRotation = page.Rotation; // angular correction in degrees from OcrInput.Deskew()
foreach (var paragraph in page.Paragraphs)
{
// Pages -> Paragraphs
int ParagraphNumber = paragraph.ParagraphNumber;
string ParagraphText = paragraph.Text;
AnyBitmap ParagraphImage = paragraph.ToBitmap(ocrInput);
int ParagraphX_location = paragraph.X;
int ParagraphY_location = paragraph.Y;
int ParagraphWidth = paragraph.Width;
int ParagraphHeight = paragraph.Height;
double ParagraphOcrAccuracy = paragraph.Confidence;
OcrResult.TextFlow paragrapthText_direction = paragraph.TextDirection;
foreach (var line in paragraph.Lines)
{
// Pages -> Paragraphs -> Lines
int LineNumber = line.LineNumber;
string LineText = line.Text;
AnyBitmap LineImage = line.ToBitmap(ocrInput);
int LineX_location = line.X;
int LineY_location = line.Y;
int LineWidth = line.Width;
int LineHeight = line.Height;
double LineOcrAccuracy = line.Confidence;
double LineSkew = line.BaselineAngle;
double LineOffset = line.BaselineOffset;
foreach (var word in line.Words)
{
// Pages -> Paragraphs -> Lines -> Words
int WordNumber = word.WordNumber;
string WordText = word.Text;
AnyBitmap WordImage = word.ToBitmap(ocrInput);
int WordX_location = word.X;
int WordY_location = word.Y;
int WordWidth = word.Width;
int WordHeight = word.Height;
double WordOcrAccuracy = word.Confidence;
foreach (var character in word.Characters)
{
// Pages -> Paragraphs -> Lines -> Words -> Characters
int CharacterNumber = character.CharacterNumber;
string CharacterText = character.Text;
AnyBitmap CharacterImage = character.ToBitmap(ocrInput);
int CharacterX_location = character.X;
int CharacterY_location = character.Y;
int CharacterWidth = character.Width;
int CharacterHeight = character.Height;
double CharacterOcrAccuracy = character.Confidence;
// Output alternative symbols choices and their probability.
// Very useful for spellchecking
OcrResult.Choice[] Choices = character.Choices;
}
}
}
}
}
Imports IronOcr
Imports IronSoftware.Drawing
' We can delve deep into OCR results as an object model of
' Pages, Barcodes, Paragraphs, Lines, Words and Characters
' This allows us to explore, export and draw OCR content using other APIs/
Private ocrTesseract = New IronTesseract()
ocrTesseract.Configuration.ReadBarCodes = True
Dim ocrInput As New OcrInput()
Dim pages = New Integer() { 1, 2 }
ocrInput.LoadImageFrames("example.tiff", pages)
Dim ocrResult As OcrResult = ocrTesseract.Read(ocrInput)
For Each page In ocrResult.Pages
' Page object
Dim PageNumber As Integer = page.PageNumber
Dim PageText As String = page.Text
Dim PageWordCount As Integer = page.WordCount
' null if we dont set Ocr.Configuration.ReadBarCodes = true;
Dim Barcodes() As OcrResult.Barcode = page.Barcodes
Dim PageImage As AnyBitmap = page.ToBitmap(ocrInput)
Dim PageWidth As Double = page.Width
Dim PageHeight As Double = page.Height
Dim PageRotation As Double = page.Rotation ' angular correction in degrees from OcrInput.Deskew()
For Each paragraph In page.Paragraphs
' Pages -> Paragraphs
Dim ParagraphNumber As Integer = paragraph.ParagraphNumber
Dim ParagraphText As String = paragraph.Text
Dim ParagraphImage As AnyBitmap = paragraph.ToBitmap(ocrInput)
Dim ParagraphX_location As Integer = paragraph.X
Dim ParagraphY_location As Integer = paragraph.Y
Dim ParagraphWidth As Integer = paragraph.Width
Dim ParagraphHeight As Integer = paragraph.Height
Dim ParagraphOcrAccuracy As Double = paragraph.Confidence
Dim paragrapthText_direction As OcrResult.TextFlow = paragraph.TextDirection
For Each line In paragraph.Lines
' Pages -> Paragraphs -> Lines
Dim LineNumber As Integer = line.LineNumber
Dim LineText As String = line.Text
Dim LineImage As AnyBitmap = line.ToBitmap(ocrInput)
Dim LineX_location As Integer = line.X
Dim LineY_location As Integer = line.Y
Dim LineWidth As Integer = line.Width
Dim LineHeight As Integer = line.Height
Dim LineOcrAccuracy As Double = line.Confidence
Dim LineSkew As Double = line.BaselineAngle
Dim LineOffset As Double = line.BaselineOffset
For Each word In line.Words
' Pages -> Paragraphs -> Lines -> Words
Dim WordNumber As Integer = word.WordNumber
Dim WordText As String = word.Text
Dim WordImage As AnyBitmap = word.ToBitmap(ocrInput)
Dim WordX_location As Integer = word.X
Dim WordY_location As Integer = word.Y
Dim WordWidth As Integer = word.Width
Dim WordHeight As Integer = word.Height
Dim WordOcrAccuracy As Double = word.Confidence
For Each character In word.Characters
' Pages -> Paragraphs -> Lines -> Words -> Characters
Dim CharacterNumber As Integer = character.CharacterNumber
Dim CharacterText As String = character.Text
Dim CharacterImage As AnyBitmap = character.ToBitmap(ocrInput)
Dim CharacterX_location As Integer = character.X
Dim CharacterY_location As Integer = character.Y
Dim CharacterWidth As Integer = character.Width
Dim CharacterHeight As Integer = character.Height
Dim CharacterOcrAccuracy As Double = character.Confidence
' Output alternative symbols choices and their probability.
' Very useful for spellchecking
Dim Choices() As OcrResult.Choice = character.Choices
Next character
Next word
Next line
Next paragraph
Next page
IronOCR使用Tesseract 5为它扫描的每个页面返回一个高级结果对象。 此包括每个项目的位置数据、图像、文本、统计置信度、备选符号选择、字体名称、字体大小、字体装饰、字体粗细和位置。
无论是护照页面、发票、银行对账单、邮件、名片还是收据;光学字符识别 (OCR) 是一个基于模式识别、计算机视觉和机器学习的研究领域。公司在不同部门之间利用 OCR 从会计和金融系统、业务数字化、企业内容管理和数据报告系统中提取文本。
除此之外,还创建了其他成功案例。IronOCR 为 Google Tesseract 和 Microsoft 2021 Azure 认知服务增值,通过 IronOCR - 本地 C# OCR 库。
如果您希望将现实世界的图片转换为 99% 的准确率,请继续阅读,了解 IronOCR 如何让您构建一个高效、准确、可扩展并几乎与人类相媲美的光学字符识别应用程序。
由于不同的 API 声称对防护的高度信心,光学字符识别 (OCR) 被认为是一个已解决的现象。然而,各种产品往往刚性且不准确,它们在现实世界的应用中失败。同样,Tesseract OCR 适用于机器打印、高分辨率、完美的文本。
听起来不错?
但现实世界并不总是拥有完美打印和手写的高分辨率文本。相反,旋转的、倾斜的、低 DPI 的、背景噪声的和所有数字不完美的弊端都由 IronOCR 处理,包括从图像文件中提取手写文本。我们确保提供 99.8 - 100% 准确、可搜索的文档,并提供跨平台支持,包括 Windows、Linux、macOS、Microsoft Azure、AWS 和 Docker - 这就是为什么 C# 开发人员选择IronOCR而非(基本的)Tesseract OCR 的原因 - 它关乎于增值。
为自己配备最佳工具!
除此之外,IronOCR 还让您能够及时处理图像文档。如果这还不够,IronOCR API 功能还包括以下内容:
从本地 .dll 或 exe 安装过渡到单一信息来源 - 使用一个简单的 C# API 开发,支持的本地 .NET 组件库:
IronOCR API 的艺术并不仅止步于此;您可以继续探索我们的功能,以进一步了解我们的技术优势。我们通过开发可靠的解决方案来简化文档处理应用程序,并通过提供行业领先的功能来最大化商业收入,使业务复杂性减少一步:
我们的光学字符识别过程始于自动图像预处理,以增强图像文件,从而改善提取响应率。IronOCR 增值于您的工作,因为它使用户能够将示例基础图像文件提取为其最佳版本。IronOCR 包括所有方面:
由于 IronOCR 服务在 300 DPI(每英寸点数)的图像文件上最佳运行,任何明显偏离 200-300 DPI 范围的图像都将重新采样以适应目标范围。
这意味着将 600 DPI 图像下采样到 300 DPI 或将 100 DPI 图像上采样到 200 DPI,同时保持 99% 的信心。
由于 IronOCR 认知服务设计适用于单色图像,因此任何彩色或灰度图像都会转换为单色,使用自适应二值化算法。
算法比较区域内的像素密度,以决定阈值以将像素转换为单色。
IronOCR 查找文本线和字符模式,自动去倾斜和旋转输入图像资源到所需方向。
使用 IronOCR,图像文件会自动分析噪声的存在和数量。噪声基本上是扫描图像上发现的小斑点。然后,我们的自适应算法根据噪声颗粒的大小去除噪声。
一旦样本图像文件完成预处理,IronOCR 会将输入图像文件分解为不同的处理区域。
另一个准备阶段涉及将参考图像分解为不同的逻辑区域。IronOCR 首先通过空白和模式来定位图像中的文本和图片;文本区域与图像分开。
然后将其划分为区域 – 段落、列和文本块。图像和剩余的非文本像素在文本识别时被识别为要省略并纳入智能输出。然后,IronOCR 借助网格线和文本块将文本区域标记为表格。
执行多个、互相关联的步骤,将像素斑点转换为用户可以搜索的单行文本线程。包括字符分割、自适应分类、字典引用和影响最佳提取文本的其他相关过程。
通过使用 IronOCR API 服务,我们已经通过多种语言的多个数据文件示例对我们的工具进行了测试,包括词级别、符号准确性和 Microsoft Office 格式中的布局保留。虽然某些参数会自动测试;其他包括视觉检查。
IronOCR 让您可以将多个输入格式的 OCR 跨平台功能添加到一个您可以搜索的纯文本字符串中。为了提升您在使用 IronOCR 时的生产力,请从我们的免费教程文档开始,这将指导您使用 IronOCR。今天下载我们的 NuGet 包安装程序,并体验免费试用密钥或联系 24/7 个性化支持。无论您的团队规模如何,通过我们的终身授权来满足您的需求。
查看许可C# 光学字符识别 ASP.NET
Iron的团队在.NET软件组件市场拥有超过10年的经验。