C# + VB.NET: 自動光學字符識別 自動光學字符識別
using IronOcr;

string imageText = new IronTesseract().Read(@"images\image.png").Text;
Imports IronOcr

Private imageText As String = (New IronTesseract()).Read("images\image.png").Text

<p>IronOCR 能夠自動檢測並讀取來自掃描不完美的圖片和 PDF 文件中的文字,這點是獨特的。 <code>IronTesseract</code> 類提供了最簡單的 API。</p> <p>嘗試其他代碼示例以獲得對您的C# OCR操作的細粒度控制。</p> <p>IronOCR 提供了目前任何平台上已知的最先進的 Tesseract 構建。 具有提高的速度、準確性以及原生的 DLL 和 API。</p> <p>支持 Tesseract 3、Tesseract 4 和 Tesseract 5 的 .NET Framework、Standard、Core、Xamarin 和 Mono。</p> <div class="hsg-featured-snippet"> <h2>如何在 VB.NET 中進行 OCR</h2> <ol> <li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://nuget.org/packages/IronOcr/" target="_blank" rel="nofollow noopener noreferrer">安裝 VB.NET 函式庫以對影像或 PDF 進行 OCR</a></li> <li>實例化 <code>IronTesseract</code> 使用直觀的API</li> <li>利用 <code>讀取</code> 在 VB.NET 中執行 OCR 的方法</li> <li>透過存取 `Text` 屬性獲取 OCR 結果</li> <li>在一行程式碼中執行 2、3 和 4 個動作。</li> </ol> </div>

C# + VB.NET: 國際語言 國際語言
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

<p>IronOCR 支援 125 種國際語言。</p> <p>除了預設安裝的英語之外,還可以通過 NuGet 或從我們的網站下載添加到您的 .NET 項目的語言包。<a href="/csharp/ocr/languages/" target="_blank" rel="nofollow noopener noreferrer">語言頁面</a>.</p> <p>大多數語言都提供快速和標準版本。(推薦)及最佳品質。 更準確的可能會更慢。</p>

C# + VB.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

<p>IronOCR 使用 Tesseract 5 掃描每個頁面時,會返回一個進階的結果物件。 此包含每個項目的<strong>位置數據、圖像、文本、統計信心、替代符號選擇、字體名稱、字體大小裝飾、字體粗細和位置</strong>。</p> <ul> <li>頁面</li> <li>段落</li> <li>行文字</li> <li>Word</li> <li>個別字符</li> <li>和條碼</li> </ul>

Human Support related to VB.NET 中的 OCR

來自我們團隊的支持

有關產品或授權的查詢,Iron團隊隨時為您提供支持。請提交您的問題,我們會確保有人為您解答。

聯絡我們
Image To Text related to VB.NET 中的 OCR

在VB.NET應用程式中將圖像OCR轉換為文本

單頁或多頁都可以傳送到 IronOCR。 您將收到所有的文本、條碼和 QR 內容作為結果。將 OCR 功能添加到 .NET 控制台、網頁或桌面應用程序中。圖像可以以 PDF、JPG、PNG、GIF、BMP 和 TIFF 格式提交。

VB.NET, .NET, C#

查看教程
Fast And Polite Behavior related to VB.NET 中的 OCR

快速且準確的OCR結果

光學字元識別軟體以多種字體樣式查看內容,以實現準確的文本OCR。使用矩形讀取區域來提高速度和準確性。多核心多執行緒可提高OCR的讀取速度。

API 參考文件
Advanced Image related to VB.NET 中的 OCR

処理不完整掃描圖像识别

IronOCR真正特別之處在於它能夠讀取掃描效果不佳的文件。其獨特的預處理庫能夠減少背景雜訊、旋轉、變形和偏斜對齊,並簡化顏色和提高解析度及對比度。Iron 的 AutoOCR 和 Advanced OCR 設置為開發人員提供了每次都能達到最佳效果的工具。

了解更多
Support For Languages related to VB.NET 中的 OCR

多語言 OCR

語言包適用於:阿拉伯語、簡體中文、繁體中文、丹麥語、英語、芬蘭語、法語、德語、希伯來語、義大利語、日語、韓語、葡萄牙語、俄語、西班牙語和瑞典語。其他語言可應需求支援。

了解更多
Output Content related to VB.NET 中的 OCR

數據直接匯出到您的 VB.NET 應用程序

IronOCR 將內容輸出為純文字和條碼數據。替代的結構化數據對象模型允許開發人員以結構化標題、段落、行、單詞和字符的格式接收所有內容,直接輸入到 .NET 應用程序中。

了解更多
支持:
  • .NET Framework 4.0及以上版本支持C#、VB、F#
  • Microsoft Visual Studio. .NET 開發 IDE 圖標
  • NuGet 安裝程式支援 Visual Studio
  • JetBrains ReSharper C# 語言助理相容
  • Microsoft Azure C#.NET 託管平台相容

授權與定價

免費 社區開發授權。商業授權起價 $749。

項目C# + VB.NET庫授權

專案

開發人員C# + VB.NET 庫許可證

開發人員

組織 C# + VB.NET 庫授權

組織

代理機構 C# + VB.NET 庫許可

代理商

SaaS C# + VB.NET 程式庫授權

SaaS

OEM C# + VB.NET 庫許可證

OEM

查看完整授權選項  

VB.NET 光學字符識別教程

Tesseract 教學: 適用於C# | IronOCR

C# Tesseract 光學字符識別

吉姆·貝克是 Iron 的一名開發工程師,負責開發 OCR 產品。

IronOCR與Tesseract比較 for .NET

Jim 一直是 IronOCR 開發方面的領導人物。Jim 設計並構建了影像處理算法及 OCR 閱讀方法。

觀看 Jim 的 Tesseract 比較
如何在 .NET 中從圖像中讀取文字 | 教程

C# 光學字符識別 ASP.NET

傑瑪·貝克福德 - 微軟解決方案工程師

如何在C# .NET中讀取圖像中的文本

了解Gemma的團隊如何使用IronOCR從圖像中讀取文字,以用於他們的歸檔軟件。Gemma分享了她自己的程式碼範例。

查看 Gemma 的圖片轉文字教學
VB 程式設計師使用 IronOCR 來...

會計和金融系統

  • # 收據
  • # 報告
  • # 發票列印
為 ASP.NET 會計和財務系統添加 PDF 支持

企業數位化

  • # 文件資料
  • # 訂購與標籤
  • # 紙張替代
C# 業務數位化用例

企業內容管理

  • # 內容製作
  • # 文件管理
  • # 內容分發
.NET CMS PDF 支援

數據和報告應用程式

  • # 效能追蹤
  • # 趨勢映射
  • # 報告
C# PDF 報告
Iron .NET 客戶

成千上萬的企業、政府、中小企業和開發人員都信賴 Iron software 產品。

Iron 團隊在 .NET 軟體元件市場有超過 10 年的經驗。

馬瓦爾
Equinor
醫碼
澳新銀行
Nexudus
通用電氣
Vireq
福利