Skip to content

Using BlinkID recognizers

Dino Gustin edited this page Feb 7, 2018 · 26 revisions

BlinkID recognizers include ID, passport, driver's license recognizers as well as generic recognizers such as MRTD recognizer for scanning MRZ. Concrete recognizers are listed at the bottom of this document.

If you completed Obtaining scanning results guide, you learned that in order to use a specific recognizer, you need to specify Recognizer Settings object in the initialization stage, and collect Recognizer Result object in the success callback.

Here we explain the general usage of BlinkID recognizers.

Back to "Getting started" guide.

Initializing BlinkID recognizers

Below is the sample source code which initializes the scanning for MRTD documents.

// To specify we want to perform MRTD (machine readable travel document) recognition, initialize the MRTD recognizer settings
PPMrtdRecognizerSettings *mrtdRecognizerSettings = [[PPMrtdRecognizerSettings alloc] init];

// Add MRTD Recognizer setting to a list of used recognizer settings
[settings.scanSettings addRecognizerSettings:mrtdRecognizerSettings];

Other BlinkID recognizers can be added the same way. Keep in mind that some recognizers have different properties which enable you to customize the scanning process for your specific use case. If you are using a specific recognizer we highly suggest listing through documentation of it's properties.

Retrieving results

Retrieving results is described in Obtaining scanning results section.

Keep in mind that every specific recognizer has it's own result class. For example PPMrtdRecognizerSettings used for initializing MRZ scanning outputs results as PPMrtdRecognizerResult in scanningViewController:didOutputResults: callback method.

Retrieving dewarped images

BlinkID recognizers can retrieve dewarped images of documents. In addition, some recognizer can also include dewarped images of some specific document parts. For example Singapore ID recognizer can also retrieve dewarped image of owners portrait.

To retrieve dewarped images you need to:

  • Enable output of dewarped images in PPMetadataSettings. This is done when creating PPSettings object. dewarpedImage property must be set to YES:
// Initialization of PPSettings. These settings will later be used for creation of PPCoordinator
PPSettings *settings = [[PPSettings alloc] init];

settings.metadataSettings.dewarpedImage = YES;
  • Enable output dewarped images for your recognizer. This step is not needed for all recognizers. Most recognizers have a property to enable outputting of dewarped images. This property must be set to YES. For example, PPSingaporeIDRecognizerSettings has property named displayFullDocumentImage.

  • Retrieve outputted images in scanningViewController:didOutputMetadata: callback method of PPScanningDelegate protocol. Below is sample source code of how this can be achieved:

- (void)scanningViewController:(UIViewController<PPScanningViewController> *)scanningViewController
             didOutputMetadata:(PPMetadata *)metadata {

    // Check whether outputted metadata is image
    if ([metadata isKindOfClass:[PPImageMetadata class]]) {
        PPImageMetadata *imageMetadata = (PPImageMetadata *)metadata;
		
		/**
		 * Check whether outputted image is dewarped image. If only dewarped images are outputted this condition isn't needed.
		 * However, this can be useful if current or succesful frame outputs are also enabled in PPMetadataSettings explained in first step of this section 
		 */
        if (imageMetadata.imageType == PPImageMetadataTypeDewarpedImage) {
            UIImage *image = imageMetadata.image;
			// process the image as you wish
        }		
    }
}

List of available BlinkID recognizers

BlinkID Description
PPAustraliaDLBackRecognizerSettings
PPAustraliaDLFrontRecognizerSettings
PPAusIDBackRecognizerSettings
PPAusIDCombinedRecognizerSettings
PPAusIDFrontRecognizerSettings
PPAusPassportRecognizerSettings
PPColombiaIDBackRecognizerSettings
PPColombiaIDFrontRecognizerSettings
PPCroIDBackRecognizerSettings
PPCroIDCombinedRecognizerSettings
PPCroIDFrontRecognizerSettings
PPCzIDBackRecognizerSettings
PPCzIDCombinedRecognizerSettings
PPCzIDFrontRecognizerSettings
PPDocumentFaceRecognizerSettings
PPEudlRecognizerSettings
PPGermanIDBackRecognizerSettings
PPGermanIDCombinedRecognizerSettings
PPGermanIDFrontRecognizerSettings
PPGermanOldIDRecognizerSettings
PPGermanPassportRecognizerSettings
PPHongKongIDFrontRecognizerSettings
PPIndonesianIDFrontRecognizerSettings
PPLivenessRecognizerSettings
PPiKadRecognizerSettings
PPMyKadBackRecognizerSettings
PPMyKadFrontRecognizerSettings
PPMyTenteraRecognizerSettings
PPMrtdCombinedRecognizerSettings
PPMrtdRecognizerSettings
PPNewZealandDLFrontRecognizerSettings
PPPolishIDBackRecognizerSettings
PPPolishIDCombinedRecognizerSettings
PPPolishIDFrontRecognizerSettings
PPRomanianIDFrontRecognizerSettings
PPSerbianIDBackRecognizerSettings
PPSerbianIDCombinedRecognizerSettings
PPSerbianIDFrontRecognizerSettings
PPSingaporeIDBackRecognizerSettings
PPSingaporeIDCombinedRecognizerSettings
PPSingaporeIDFrontRecognizerSettings
PPSlovakIDBackRecognizerSettings
PPSlovakIDCombinedRecognizerSettings
PPSlovakIDFrontRecognizerSettings
PPSlovenianIDBackRecognizerSettings
PPSlovenianIDCombinedRecognizerSettings
PPSlovenianIDFrontRecognizerSettings
PPSwissIDBackRecognizerSettings
PPSwissIDFrontRecognizerSettings
PPSwissPassportRecognizerSettings
PPUnitedArabEmiratesIDBackRecognizerSettings
PPUnitedArabEmiratesIDFrontRecognizerSettings
Clone this wiki locally