修正图像方向
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);
NuGet Download
PM > Install-Package IronOcr
修正图像方向

修正图像方向

IronOCR的OcrInput包含内置的方法以调整图像方向以获得最佳OCR准确性:

  • Rotate(double degrees):以给定角度顺时针旋转图像; use negative values for counter-clockwise rotations
  • Deskew(int maxDeskewAngle = 45):最多矫正到最大角度(默认为45°); 如果校正已应用则返回true
  • Scale(int percent, bool scaleCrop = true):按比例调整图像尺寸(例如150为150%)
探索 C# 中的图像方向校正技术
在 GitHub 上查看

准备开始了吗?

Nuget Downloads 6,357,159版本:2026.11刚刚发布