ID card recognition settings
Contents
[
Hide
]
Aspose.OCR for .NET allows for very flexible customization of ID card recognition accuracy, performance, and other settings by configuring the properties of the IDCardRecognitionSettings
object.
These settings are specifically tailored for processing scanned or photographed ID cards.
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 ID card recognition:
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
Aspose.OCR.IDCardRecognitionSettings recognitionSettings = new Aspose.OCR.IDCardRecognitionSettings();
recognitionSettings.AllowedCharacters = Aspose.OCR.CharactersAllowedType.LATIN_ALPHABET;
recognitionSettings.ThreadsCount = 2;
Aspose.OCR.RecognitionResult result = recognitionEngine.RecognizeIDCard("id-card.png", recognitionSettings);
Console.WriteLine(result.RecognitionText);