Receipt recognition settings

Aspose.OCR for .NET allows for very flexible customization of recognition accuracy, performance, and other settings by configuring the properties of the ReceiptRecognitionSettings object.

These settings are applicable when extracting text from scanned receipts in JPEG, PNG, TIFF, BMP, and GIF formats.

Setting Type Default value Description
AllowedCharacters Aspose.OCR.CharactersAllowedType Aspose.OCR.CharactersAllowedType.ALL The predefined whitelist of characters Aspose.OCR engine will look for.
AutoSkew boolean true Automatically correct image tilt (deskew) before proceeding to recognition.
IgnoredCharacters string none A blacklist of characters that are ignored during recognition.
Language Aspose.OCR.Language Aspose.OCR.Language.None Specify a language for recognition.
PreprocessingFilters Aspose.OCR.Models.PreprocessingFilters.PreprocessingFilter none Apply image processing filters that enhance an image before it is sent to the OCR engine.
ThreadsCount integer auto The number of CPU threads used for recognition.
UpscaleSmallFont boolean false Improve small font recognition and detection of dense lines.

Applicable to

Example

The following code example shows how to fine-tune receipt recognition:

Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
Aspose.OCR.ReceiptRecognitionSettings recognitionSettings = new Aspose.OCR.ReceiptRecognitionSettings();
recognitionSettings.AutoSkew = true;
recognitionSettings.Language = Aspose.OCR.Language.Latin;
recognitionSettings.ThreadsCount = 2;
Aspose.OCR.RecognitionResult result = recognitionEngine.RecognizeReceipt("receipt.png", recognitionSettings);
Console.WriteLine(result.RecognitionText);