Passport recognition settings
Contents
[
Hide
]
Aspose.OCR for .NET allows for very flexible customization of passport recognition accuracy, performance, and other settings by configuring the properties of the PassportRecognitionSettings
object.
These settings are specifically tailored for processing scanned or photographed passports.
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. |
Applicable to
Example
The following code example shows how to fine-tune passport recognition:
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
Aspose.OCR.PassportRecognitionSettings recognitionSettings = new Aspose.OCR.PassportRecognitionSettings();
recognitionSettings.AllowedCharacters = Aspose.OCR.CharactersAllowedType.LATIN_ALPHABET;
recognitionSettings.ThreadsCount = 2;
Aspose.OCR.RecognitionResult result = recognitionEngine.RecognizePassport("passport.png", recognitionSettings);
Console.WriteLine(result.RecognitionText);