在生產環境中測試,無浮水印。
無論您在哪裡需要,它都能運作。
立即獲取 30 天完整功能版產品。
幾分鐘內即可完成安裝並開始使用。
在產品試用期間,您可隨時聯繫我們的技術支援團隊
改善來自低品質掃描檔與照片的輸入內容。使用我們的預處理濾鏡來清理、校正並增強難以處理的影像,以達到最高的 OCR 準確度。
您可直接在 IronOCR 內輕鬆將輸入內容二值化,將影像轉為清晰的黑白版本。此濾鏡能有效將文字從複雜背景中分離出來,減少雜訊,使文字擷取更輕鬆且更可靠。
學習如何:在 .NET C# 中修正圖片色彩以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Apply binarize affect
imageInput.Binarize();
// Export the modified image
imageInput.SaveAsImages("binarize.jpg");
將彩色圖像轉換為灰階圖像——這是為圖像應用更進階的前置處理濾鏡所必需的關鍵步驟。
學習如何:在 .NET C# 中修正圖片色彩以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Apply grayscale affect
imageInput.ToGrayScale();
// Export the modified image
imageInput.SaveAsImages("grayscale.jpg");
替換影像中的特定色域,讓您能在執行 OCR 之前移除浮水印、彩色背景或其他干擾元素。
學習如何:在 .NET C# 中修正圖片色彩以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
IronSoftware.Drawing.Co/lor currentColor = new IronSoftware.Drawing.Co/lor("#DB645C");
IronSoftware.Drawing.Co/lor newColor = IronSoftware.Drawing.Co/lor.DarkCyan;
// Replace color
imageInput.ReplaceColor(currentColor, newColor, 80);
// Export the modified image
imageInput.SaveAsImages("replaceColor");
加粗圖像中的字元,有助於連接文字中的斷裂線條,並提升對模糊或細小字體的辨識度。
學習如何:使用濾鏡修正圖像以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Apply Dilate filter
imageInput.Dilate();
// Export filtered image
imageInput.SaveAsImages("dilate.jpg");
將圖像中的字元間距拉大,有助於分離相互接觸或重疊的字元。
學習如何:使用濾鏡修正圖像以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Apply Erode filter
imageInput.Erode();
// Export filtered image
imageInput.SaveAsImages("erode.jpg");
替換影像中的特定色域,讓您能在執行 OCR 之前移除浮水印、彩色背景或其他干擾元素。
學習如何:在 .NET C# 中修正圖片色彩以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
IronSoftware.Drawing.Co/lor currentColor = new IronSoftware.Drawing.Co/lor("#DB645C");
IronSoftware.Drawing.Co/lor newColor = IronSoftware.Drawing.Co/lor.DarkCyan;
// Replace color
imageInput.ReplaceColor(currentColor, newColor, 80);
// Export the modified image
imageInput.SaveAsImages("replaceColor");
自動偵測並校正傾斜或歪斜的影像,大幅提升不完美掃描檔的 OCR 辨識準確度。
學習如何:在 .NET C# 中修正圖片方向以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Apply Deskew filter
imageInput.Deskew();
透過程式碼將圖片旋轉任意角度,以確保文字方向正確,方便 OCR 引擎進行辨識。
學習如何:在 .NET C# 中修正圖片方向以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Rotate the image 180 degrees clockwise
imageInput.Rotate(180);
// Export the modified image
imageInput.SaveAsImages("rotate");
自動偵測頁面方向(0、90、180、270 度),有助於在 OCR 處理前進行方向校正。即使文件被倒置掃描,仍能確保高準確度。
了解如何:偵測頁面旋轉using IronOcr;
using var input = new OcrInput();
// Load PDF document
input.LoadPdf("Clockwise90.pdf");
// Detect page rotation
var results = input.DetectPageOrientation();
// Ouput result
foreach(var result in results)
{
Console.WriteLine(result.PageNumber);
Console.WriteLine(result.HighConfidence);
Console.WriteLine(result.RotationAngle);
}
將圖片調整為最適合 OCR 的解析度,可顯著提升低解析度原始檔案的辨識準確度。
學習如何:在 .NET C# 中修正圖片方向以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("paragraph_skewed.png");
// Apply scale
imageInput.Scale(70);
// Export the modified image
imageInput.SaveAsImages("rotate");
對於缺乏元資料的低解析度圖像或掃描文件,請手動設定每英寸點數 (DPI)。提供 DPI 值可引導 OCR 引擎,並顯著提升辨識品質。
學習如何:C# Tesseract 圖片 DPIusing IronOcr;
using System;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.TargetDPI = 300;
ocrInput.LoadImage(@"images\image.png");
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
透過演算法提升低解析度影像的銳利度與清晰度,從模糊或像素化的原始資料中擷取文字。
學習如何:使用濾鏡修正圖像以利閱讀using IronOcr;
// Instantiate IronTesseract
IronTesseract ocrTesseract = new IronTesseract();
// Add image
using var imageInput = new OcrImageInput("sample.jpg");
// Apply enhance resolution filter
imageInput.EnhanceResolution();
// Export filtered image
imageInput.SaveAsImages("sharpen.jpg");
透過單一智慧化方法,套用經過精心設計的前置處理濾鏡鏈。濾鏡精靈會自動分析輸入影像,並套用最佳的修正序列,以獲得最理想的 OCR 結果。
了解如何:篩選精靈using IronOcr;
var ocrTesseract = new IronTesseract();
// WIZARD - If you are unsure which filters to use,
// use the debug-wizard to test all combinations:
string codeToRun = OcrInputFilterWizard.Run(@"images\image.png", out double confidence, ocrTesseract);
Console.WriteLine($"Confidence: {confidence}");
Console.WriteLine(codeToRun);
透過僅鎖定圖片中含有文字的特定區域,節省處理時間。只需定義一個矩形區域,即可隔離並從表單、表格或雜亂的背景中擷取文字。
學習如何:使用 C# 透過 Tesseract OCR 擷取圖片的特定區域using IronOcr;
using IronSoftware.Drawing;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
var ContentArea = new Rectangle(x: 215, y: 1250, width: 1335, height: 280);
ocrInput.LoadImage("img/example.png", ContentArea);
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);