在生产环境中测试,无水印。
随时随地满足您的需求。
获得30天的全功能产品。
几分钟内就能启动并运行。
在您的产品试用期间,全面访问我们的支持工程团队。
using IronOcr;
string imageText = new IronTesseract().Read(@"images\image.png").Text;
Imports IronOcr
Private imageText As String = (New IronTesseract()).Read("images\image.png").Text
IronOCR 在其自动检测和读取来自扫描不完美的图像和 PDF 文档中的文本的能力方面具有独特性。 IronTesseract
类提供了最简单的 API。
尝试其他代码示例以精细控制您的C# OCR操作。
IronOCR 提供了目前任何平台上最先进的 Tesseract 构建。 具有更高的速度、准确性以及原生的DLL和API。
支持适用于 .NET Framework、Standard、Core、Xamarin 和 Mono 的 Tesseract 3、Tesseract 4 和 Tesseract 5。
钢铁魔方
使用直观的应用程序接口读取
方法在 VB.NET 中执行 OCR文本
属性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为它扫描的每个页面返回一个高级结果对象。 此包括每个项目的位置数据、图像、文本、统计置信度、备选符号选择、字体名称、字体大小、字体装饰、字体粗细和位置。
IronOCR(光学字符识别)库使开发人员在将图像转换为文本时快速高效。IronOCR 与 .NET、VB .NET 和 C# 配合使用。我们的顶级 .NET 应用程序专为您——开发人员设计,以支持您为项目实现最佳性能。
OCR 接收并识别文本文件、条形码、QR 内容等。然而,IronOCR 还提供众多方法,允许您将 OCR 阅读和文本从图像添加到 Web、Windows 桌面或控制台 .NET 项目中,支持几乎不限的图像格式和文件,如 JPG、PNG、GIF、TIFF、BMP、JPEG 或 PDF。
尽管从图像输出的纯文本、字符、行和段落的识别结果可能看起来不简单,但您会发现 IronOCR 底层的结果比您最初想象的要简单。IronOCR 扫描图像以对齐,利用其噪声去除和过滤器检查质量和分辨率。它查看其属性,优化 OCR 引擎,并使用训练有素的人工智能网络来识别文本(来自图像),就像任何人一样。
即使对于计算机来说,OCR 也不是一个简单的过程。然而,IronOCR 使创建可搜索文档的整个过程更快捷、更简单,具有 100% 的准确性和极少的代码行数。
阅读教程软件不受地理边界的限制——企业在跨越边界的情况下运作,并依赖多种语言来实现其成果。同样,仅能识别单一种语言的光学字符识别 (OCR) 工具在各方面都是一个大问题!
通过提供多种 OCR 功能的多语言 OCR 库,您可以从扫描的 PDF 或扫描图像中创建多语言的可搜索 PDF 文档(从法语到中文!)。您的时间和精力得以简化,生成的动态、可搜索的 PDF 文档可以让您、您的客户或您的机构毫无限制地使用和重用。
IronOCR 库专注于您、您的业务和您的 OCR 需求,无论是内置还是按需,它支持多种语言。您的下一个 .NET 项目可以从语言兼容性担忧中解放出来!
无论是阿拉伯语、西班牙语、法语、德语、希伯来语、意大利语、日语、简体中文、繁体中文(普通话)、丹麦语、英语、芬兰语、葡萄牙语、俄语、西班牙语还是瑞典语,只需指出语言,我们就可以为您提供!您可以下载您偏好的语言包,或者联系我们的 24/7 支持以获取更多语言。
第一步是使用我们为 Windows Visual Studio 提供的 NuGet 包安装程序。
下载语言包IronOCR与竞争对手有何不同?除了让您轻松添加OCR功能、提取文本和扫描旋转图像外,它还具有从不完美的扫描中执行OCR的能力!相比之下,今天市场上的许多即用产品往往过于僵化和不准确,注定在现实世界的个人和企业应用中失败,因为多数只与机器打印的、高分辨率且完美调整的文本一起工作。
IronOCR通过其强大的IronTesseract DLL扩展了Google Tesseract的功能,该DLL是一个原生C# OCR库,具有比免费Tesseract库更高的稳定性和精确度。
有最好工具在手,即使您有一个不是很完美的扫描图像或存储在您的文件夹中的图像——IronOCR的图像处理库转换将清除噪声、旋转、减少失真和倾斜校正,并提高分辨率和对比度。高级光学字符识别(OCR)设置为您——编程人员——提供工具和代码,以一遍又一遍地产生最佳的可搜索结果。
搜索您需要的单词,永远不会对99.8-100%的准确结果失望,无限支持PDF文档、多帧TIFF文件、JPEG & JPEG2000、GIF、PNG、BMP、WBMP、System.Drawing.Image、System.Drawing.Bitmap、System.IO.Streams的图像、二进制图像数据(byte[])以及所有超出之物!
Tesseract的替代方案与 .NET Framework 中的其他 .NET 应用程序不同,您会发现 IronOCR 的软件包管理器控制台和识别文本控制台内的高级光学字符识别,使您的用户能够读取多个单词字体(从 Times New Roman 到任何花哨的或据说难以理解的字体)、粗细和样式,以从整个图像或扫描的图像中准确读取文本。我们能够选择图像的某些区域有助于提高速度和准确性。从几行到几段的多线程加快了 OCR 引擎的速度,并允许在多核机上读取多个文档。
我们的速度和准确性声明并不限于字符识别过程。相反,改进从安装开始,因为 IronOCR 的 .NET OCR 引擎是一个易于安装、完整且有文档记录的 .NET 软件库。Visual Studio 有一个 NuGet 包管理器安装,并且与 MVC、WebApp、桌面、控制台和服务器应用程序兼容多线程。
您可以实现 99.8-100% 的 OCR 准确性,而无需任何外部网络服务、持续费用或将机密文档发送到互联网上。无需繁琐的 C++ 编码,当您需要全面支持多字符、单词、行、段落、文本和文档的 PDF OCR 功能时,IronOCR 是明智的选择。
我们为希望完善其编码的开发人员提供最佳选项,因为 IronOCR 开箱即用,无需进行性能调整或对输入图像进行大量修改。最新的 IronOCR 版本工作速度惊人快——速度提高了高达十倍,错误率比以前的版本减少了 250% 以上。我们升级了我们自己的构建版本,以通过提供完美的 OCR 平台支持您的目标!
查看完整功能列表即使在使用移动设备时,我们完善的.NET OCR库也能让开发者“无忧无虑”地编码,因为IronOCR支持将内容导出为简单的直接和复杂文本、机器编码文本、条形码数据或结构化对象模型数据。您可以将内容段落、行、单词、字符和图像字符串结果拆分,以便直接在您的.NET应用程序中使用。
从源代码到最终结果——如果您不能将其导出到您的应用程序,那么生成的数据将毫无用处。IronOCR理解这一点,并允许您将OCR结果导出为XHTML,以便能够在更广泛的应用程序中使用可持续格式,并与复杂网站集成,更不用说更快的加载时间了!
然而,这种支持并不止于此。将OCR导出为可搜索的PDF文档的功能使您、您的客户和组织可以随时存储和检索PDF文档!这尤其有利于当您有一个30页的合同时,您可以在数据库中用几个关键词进行搜索,同时也使您的公司在合规性方面表现出色,因为可搜索PDF文档被证明对视障人士有益。
除了以上功能,您还可以将结果导出为OCR格式,该格式代表您的OCR输出、布局信息和样式信息,并将相关信息嵌入标准HTML中。
了解更多C# 光学字符识别 ASP.NET
Iron的团队在.NET软件组件市场拥有超过10年的经验。