using IronOcr;
using System;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadImage(@"images\image.png");
ocrInput.Deskew();
ocrInput.DeNoise();
ocrInput.Despeckle();
ocrInput.EnhanceResolution(225);
ocrInput.Sharpen();
ocrInput.Erode();
ocrInput.Dilate();
ocrInput.Scale(200);
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
Imports IronOcr
Imports System
Private ocrTesseract = New IronTesseract()
Private ocrInput = New OcrInput()
ocrInput.LoadImage("images\image.png")
ocrInput.Deskew()
ocrInput.DeNoise()
ocrInput.Despeckle()
ocrInput.EnhanceResolution(225)
ocrInput.Sharpen()
ocrInput.Erode()
ocrInput.Dilate()
ocrInput.Scale(200)
Dim ocrResult = ocrTesseract.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
Install-Package IronOcr
修復低品質的掃描檔與圖片
IronTesseractOCR 類別為 C# 和 .NET 開發人員提供細緻的控制權,使其能將 OCR(圖像與 PDF 轉文字)功能整合至應用程式中,並針對特定使用情境微調效能。