IronOCR的OcrInput包括内置的方法,以调整图像方向,实现最佳的OCR精度:
Rotate(double degrees): 按给定度数顺时针旋转图像; 逆时针旋转使用负值。Deskew(int maxDeskewAngle = 45): 校正最大角度为45°的倾斜; 如果应用了校正,则返回trueScale(int percent, bool scaleCrop = true): 按比例调整图像大小(例如150表示150%)
using IronOcr;
using System;
var ocrTesseract = new IronTesseract();
using var ocrInput = new OcrInput();
ocrInput.LoadImage("/path/file.png");
ocrInput.Rotate(90);
ocrInput.Deskew();
ocrInput.Scale(150);
var ocrResult = ocrTesseract.Read(ocrInput);
Console.WriteLine(ocrResult.Text);
Imports IronOcr
Imports System
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
ocrInput.LoadImage("/path/file.png")
ocrInput.Rotate(90)
ocrInput.Deskew()
ocrInput.Scale(150)
Dim ocrResult = ocrTesseract.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
End UsingImports IronOcr
Imports System
Dim ocrTesseract = New IronTesseract()
Using ocrInput = New OcrInput()
ocrInput.LoadImage("/path/file.png")
ocrInput.Rotate(90)
ocrInput.Deskew()
ocrInput.Scale(150)
Dim ocrResult = ocrTesseract.Read(ocrInput)
Console.WriteLine(ocrResult.Text)
End UsingIronOCR的OcrInput包括内置的方法,以调整图像方向,实现最佳的OCR精度:
Rotate(double degrees): 按给定度数顺时针旋转图像; 逆时针旋转使用负值。Deskew(int maxDeskewAngle = 45): 校正最大角度为45°的倾斜; 如果应用了校正,则返回trueScale(int percent, bool scaleCrop = true): 按比例调整图像大小(例如150表示150%)NuGet 下载量 6,411,693|版本:2026.11刚刚发布