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 |
---|---|---|---|
AllowedSymbols |
string |
All characters of the selected language | The whitelist of characters Aspose.OCR engine will look for. |
IgnoredSymbols |
string | none | A blacklist of characters that are ignored during recognition. |
Language |
Aspose.OCR.Language |
Aspose.OCR.Language.None |
Specify a language for recognition. |
ThreadsCount |
integer | auto | The number of CPU threads used for recognition. |
AutomaticColorInversion |
boolean | true |
Improve recognition accuracy of white text on a dark/black background. If you are not optimizing every aspect of recognition (for example, for online applications or entry-level devices), leave this setting set to true. |
Country |
Aspose.OCR.Country |
NONE |
Extract key passport details (such as a number, name, date of birth, and so on) for the specific country in addition to the entire passport text. See Supported countries section below. |
Supported countries
A list of countries for retrieving specific details (such as a number, name, date of birth, and so on) from passport images:
Value | Country |
---|---|
Aspose.OCR.Country.NONE |
Do not parse passport details (only recognize passport text). |
Aspose.OCR.Country.MADAGASCAR |
Parse Malagasy passports. |
Aspose.OCR.Country.USA |
Parse US passports. |
Applicable to
Example
The following code example shows how to fine-tune passport recognition:
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("passport1.png");
input.Add("passport2.png");
// Recognition settings
Aspose.OCR.PassportRecognitionSettings recognitionSettings = new Aspose.OCR.PassportRecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.ExtLatin;
// Recognize passports
List<Aspose.OCR.RecognitionResult> results = recognitionEngine.RecognizePassport(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
Console.WriteLine(result.RecognitionText);
}