Browse our Products

Aspose.OCR for .NET 20.10 - Release Notes

All Features

KeySummaryCategory
OCRNET-243Add the language choose optionEnhancement
OCRNET-247Make an option to set a custom angle for the skew correction feature.Enhancement

Enhancements

  • added language choose option (supported languages: English, German, Portuguese, Spanish, French, Italian)
  • added option for manually setting angle for the skew correction feature.

Public API and Backwards Incompatible Changes

New API

MethodDescription
RecognitionResult RecognizeImage(string fullPath, RecognitionSettings settings)fullPath - path to the image, settings - object for parameters

Removed APIs

No Changes

Will be deprecated

string RecognizeImage(MemoryStream stream, Rectangle rect);

string RecognizeImage(string fullPath, Rectangle rect);

Usage Example

using System;
using Aspose.OCR;

namespace ProgramOCR
{
    class Program
    {
        static void Main(string[] args)
        {
            // Get API
            AsposeOcr api = new AsposeOcr();

            // Create license
            License lic = new License();

            // Set license 
            lic.SetLicense("Aspose.Total.lic");

            // Get image for recognize
            string fullPath = "D://myImg.png";

            // Recognize image           
            RecognitionResult result = api.RecognizeImage(fullPath, new RecognitionSettings
            {
                DetectAreas = true,
                RecognizeSingleLine = false,
                AutoSkew = true,
                Skew = 0.2,
                Laguage = Language.en,
                RecognitionAreas = new List<Rectangle>()
                {
                    new Rectangle(1,3,400,70),
                    new Rectangle(1,72,400,70)
                }
            });

            // Print result
           Console.WriteLine($"Text:\n {result.RecognitionText}");
           Console.WriteLine("Areas:");
           result.RecognitionAreasText.ForEach(a => Console.WriteLine($"{a}"));
           Console.WriteLine("Warnings:");
           result.Warnings.ForEach(w => Console.WriteLine($"{w}"));
           Console.WriteLine($"JSON: {result.GetJson()}");
        }
    }
}