Aspose.OCR的.NET OCR插件可以从使用相机或智能手机拍摄的照片中读取文本。先进的预处理滤镜和强大的字符检测算法能够处理旋转、失真和多噪声的图像,保持高准确率的OCR。内置的拼写检查器进一步改善识别结果。
OcrInput
对象中。Aspose.OCR.Metered metered = new Aspose.OCR.Metered(); | |
metered.SetMeteredKey("PublicKey", "PrivateKey"); | |
// This code recognize image | |
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr(); | |
// Add images to OcrInput object | |
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage); | |
input.Add("source1.png"); | |
input.Add("source2.jpg"); | |
// Set recognition areas detection mode | |
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings(); | |
recognitionSettings.DetectAreasMode = DetectAreasMode.PHOTO; | |
// Recognize image | |
List<Aspose.OCR.RecognitionResult> results = recognitionEngine.Recognize(input, recognitionSettings); | |
foreach(Aspose.OCR.RecognitionResult result in results) | |
{ | |
Console.WriteLine(result.RecognitionText); | |
} | |
//save as a file | |
results[0].Save("result.txt", Aspose.OCR.SaveFormat.Text); | |
//or | |
Aspose.OCR.AsposeOcr.SaveMultipageDocument("result.pdf", Aspose.OCR.SaveFormat.Pdf, results); |
默认情况下,Aspose.OCR 可以基于扩展拉丁字母自动识别多种语言。但是,指定特定语言可以显著提高识别准确性。在识别西里尔文、中文和印地文时,请明确指定语言。
Aspose.OCR 支持来自扫描仪或相机的常见格式,包括 PDF、JPEG、PNG 和 TIFF。识别结果以纯文本、HTML、Microsoft Word、PDF、JSON 和 XML 返回。
良好的图像质量对于准确的OCR至关重要。使用扫描仪或高分辨率相机。图书馆包含高级滤镜,可在识别之前自动改善图像质量。
浏览我们的在线文档或访问Aspose.OCR for .NET存储库获取代码示例和展示项目。