CPassport library
Initializes the library
Note: This function must be called before any other function in the library can be used.
Syntax
Init(License As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] License | Null-terminated string that contains license key value |
Return Values
| Value | Description |
|---|---|
| LICENSE_VALID | License valid; library is ready to for use |
| LICENSE_INVALID | License invalid; all scanner operations disabled |
| LICENSE_EXPIRED | License expired; all scanner operations disabled |
| LICENSE_DOES_NOT_MATCH_LIBRARY | License invalid; all library operations disabled |
| GENERAL_ERR_PLUG_NOT_FOUND | Returned if the attached scanner is not one of the following: ScanShell 600. ScanShell 800. ScanShell 1000 |
| MAG_ERR_NO_READER_FOUND | Magnetic reader device not found on any PC ports |
Process
Section titled “Process”Processes the recently scanned passport image. When scanning the passport page using the ScanShell 1000, the opened page should be aligned to the top right corner which yields a rotated internal image. Before processing the image, it needs to be rotated by 180 degrees (using the RotateImage function).
The image should have the following properties:
- Color scheme: 24-bit (True color) } 256 Gray shades
- Image size: 3” x 5” (full page) | 1” x 5” (lower portion only)
After the function returns PASS_ERR_NONE, the library properties are loaded with analyzed text. Otherwise, the library property fields are empty. The raw data is scanned for format detection. If a specific format is detected, the data is parsed further and loads the library properties.
Syntax
Process() As LongReturn Values
| Value | Description |
|---|---|
| PASS_ERR_NONE | Function succeeded |
| LICENSE_INVALID | License invalid; library not initialized with proper license |
| INVALID_INTERNAL_IMAGE | No internal image loaded; scan an image first |
GetFace
Section titled “GetFace”Extracts the image rectangle of the person’s face from the source passport image. Remember that the original scanned image must be rotated by 180 degrees (so it is aligned correctly) before this function is called. This function works properly only for 3”x5” images. The destination image is generated in BITMAP format.
Syntax
GetFace(DestFile As String) As LongParameters
| Parameter | Description |
|---|---|
| [in] DestFile | Null-terminated string that contains the full name of the destination image file (which contains the face image from the passport) |
Return Values
| Value | Description |
|---|---|
| PASS_ERR_NONE | Function succeeded |
| LICENSE_INVALID | License invalid; library not initialized with proper license |
| PASS_ERR_CANNOT_DELETE_ DESTINATION_IMAGE | Returned when file with same name as the destination file already exists and can’t be overwritten |
| PASS_ERR_CANNOT_COPY_ TO_DESTINATION | Returned when destination file can’t be opened for write on disk |
| PASS_ERR_FACE_IMAGE_ NOT_FOUND | Could not retrieve the face image from the passport image |
CPassport library properties
Section titled “CPassport library properties”The CPassport library stores the detected textual information in an internal data structure. This structure is refreshed in each Process function call. The supported properties are:
| PassportNumber | NameFirst | NameMiddle |
|---|---|---|
| NameLast | ExpirationDate | DateOfBirth |
| Sex | PersonalNumber | Nationality |
| NationalityLong | Country | CountryLong |
Note: The Country field stands for the Passport Issuing country. The Country and Nationality fields can be in one of two formats: Regular Format (Nationality, Country) or Long Format (NationalityLong, CountryLong).
In Regular Format, the text is as it appears in the passport (for example, USA for United States and SGP for Singapore). In Long Format, the interpreted country names are displayed (for example, United States and Singapore).