Getting results

This page covers the description of how to get various kinds of results

Text Results

If you know exactly what text data are needed, the fastest way to get information is to use special functions.

Getting values

Getting values of text fields indicating fieldType:

// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES);
// Get date of birth
String dateOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_DATE_OF_BIRTH);
// Get document number
String documentNumber = results.getTextFieldValueByType(eVisualFieldType.FT_DOCUMENT_NUMBER);

Getting values of text fields indicating fieldType, lcid:

// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN);
// Get place of birth
String placeOfBirth = results.getTextFieldValueByType(eVisualFieldType.FT_PLACE_OF_BIRTH, LCID.GERMAN_GERMANY);

Getting values of text fields indicating fieldType, lcid, source:

// Get full name
String surnameAndGivenNames = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);
// Get address
String address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA);

Getting values of text fields indicating fieldType, lcid, source, original:

// Get surname
String surname = results.getTextFieldValueByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true);
// Get address
String address = results.getTextFieldValueByType(eVisualFieldType.FT_ADDRESS, LCID.LATIN, eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA, true);

Getting values of text fields indicating fieldType, source:

// Get surname
String surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);

Getting values of text fields indicating fieldType, source, original:

// Get surname
String surname = results.getTextFieldValueByTypeAndSource(eVisualFieldType.FT_SURNAME, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, true);

You can also go through all instances of text fields and obtain the desired information, e.g.:

for(DocumentReaderTextField textField : results.textResult.fields) {
    String value = results.getTextFieldValueByType(textField.fieldType, textField.lcid);
    Log.d("MainActivity", value + "\n");
}

Getting statuses

Getting statuses of text fields indicating fieldType (one of eCheckResult values):

// Get status of FT_SURNAME_AND_GIVEN_NAMES
int surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES);
// Get status of FT_DATE_OF_BIRTH
int dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH);

Getting statuses of text fields indicating fieldType, lcid (one of eCheckResult values):

// Get status of FT_SURNAME_AND_GIVEN_NAMES
int surnameAndGivenNames = results.getTextFieldStatusByType(eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, LCID.BELARUSIAN);
// Get status of FT_DATE_OF_BIRTH
int dateOfBirth = results.getTextFieldStatusByType(eVisualFieldType.FT_DATE_OF_BIRTH, LCID.LATIN);

Getting instances

Getting instances of text fields indicating fieldType:

DocumentReaderTextField textField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME);

Getting instances of graphic fields indicating fieldType, lcid:

DocumentReaderTextField textField = results.getTextFieldByType(eVisualFieldType.FT_SURNAME, LCID.BELARUSIAN);

Graphic Results

Getting values

Getting values of graphic fields indicating fieldType:

// Get document image
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE);
// Get portrait image
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT);

Getting values of graphic fields indicating fieldType, source:

// Get document image
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE);
// Get document image (uncropped)
Bitmap documentImageUncropped = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_UNCROPPED_IMAGE);
// Get portrait image
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS);

Getting values of graphic fields indicating fieldType, source, pageIndex:

// Get document image from the second page
Bitmap documentImage = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 1);
// Get portrait image from the first page
Bitmap portrait = results.getGraphicFieldImageByType(eGraphicFieldType.GF_PORTRAIT, eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS, 0);

Getting values of graphic fields indicating fieldType, source, pageIndex, light:

// Get document image from the first page with white light
Bitmap documentImageWhite = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL);
// Get document image from the first page with UV light
Bitmap documentImageUV = results.getGraphicFieldImageByType(eGraphicFieldType.GF_DOCUMENT_IMAGE, eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, eRPRM_Lights.RPRM_LIGHT_UV);

Getting statuses

Getting statuses of graphic fields indicating imageQualityCheckType (one of eCheckResult values):

// Get status of an image's focus
int imageFocus = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_FOCUS);
// Get status of images' glares
int imageGlares = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES);

Getting statuses of graphic fields indicating imageQualityCheckType, securityFeature (one of eCheckResult values):

// Get status of images' glares
int blank = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_BLANK);
int mrz = results.getQualityResult(eImageQualityCheckType.IQC_IMAGE_GLARES, eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_MRZ);

Getting instances

Getting instances of graphic fields indicating fieldType, source:

DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED);

Getting instances of text fields indicating fieldType, source, pageIndex:

DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0);

Getting instances of text fields indicating fieldType, source, pageIndex, light:

DocumentReaderGraphicField graphicField = results.getGraphicFieldByType(eGraphicFieldType.GF_SIGNATURE, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, 0, eRPRM_Lights.RPRM_LIGHT_WHITE_FULL);

Last updated