修正图像方向
旋转
将图像顺时针旋转若干度。要逆时针旋转,请使用负数。
抗倾斜
使图像旋转,使其正向上且正交。 这对于OCR非常有用,因为Tesseract对扫描倾斜的容忍度可以低至5度。
缩放
按比例缩放OcrInput页面。
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
Private ocrTesseract = New IronTesseract()
Private 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)Install-Package IronOcr
旋转将图像顺时针旋转若干度。要逆时针旋转,请使用负数。
使图像旋转,使其正向上且正交。 这对于OCR非常有用,因为Tesseract对扫描倾斜的容忍度可以低至5度。
按比例缩放OcrInput页面。