BlinkID / blinkid-ios

Everything you need to add AI-driven ID scanning into your native iOS app.
https://microblink.com/products/blinkid
384 stars 89 forks source link

Front Image for USDL #128

Closed veenunalla closed 6 years ago

veenunalla commented 6 years ago

Hi, How can i get the front image for the US Driving license .

Delegate Method scanningViewController:(UIViewController )scanningViewController didOutputMetadata:(PPMetadata )metadata

is not able to call when i implement PPCameraOverlayViewController . Can you help me .

veenunalla commented 6 years ago

My Code is

` - (PPCameraCoordinator *)coordinatorWithError:(NSError **)error {

/** 0. Check if scanning is supported */

if ([PPCameraCoordinator isScanningUnsupportedForCameraType:PPCameraTypeBack error:error]) {
    return nil;
}

/** 1. Initialize the Scanning settings */

// Initialize the scanner settings object. This initialize settings with all default values.
PPSettings *settings = [[PPSettings alloc] init];

// tell which metadata you want to receive. Metadata collection takes CPU time - so use it only if necessary!
settings.metadataSettings.dewarpedImage = YES; // get dewarped image of ID documents

/** 2. Setup the license key */
// Visit www.microblink.com to get the license key for your app
settings.licenseSettings.licenseKey = @"5MHTZY5W-4XCPMYQY-T2BRUFRR-GYFOLRSV-CLLVKEWX-KUJNOVIS-25KRE56S-S7OZ5WPL";
// This demo license key is valid until 2017-08-03

// To specify we want to perform USDL (US Driver's license) recognition, initialize the USDL recognizer settings
PPUsdlRecognizerSettings *usdlRecognizerSettings = [[PPUsdlRecognizerSettings alloc] init];
// Set this to YES to scan even barcode not compliant with standards
// For example, malformed PDF417 barcodes which were incorrectly encoded
// Use only if necessary because it slows down the recognition process
// Default: NO
usdlRecognizerSettings.scanUncertain = NO;

// Set this to YES to scan barcodes which don't have quiet zone (white area) around it
// Disable if you need a slight speed boost
// Default: YES
usdlRecognizerSettings.allowNullQuietZone = YES;
[settings.scanSettings addRecognizerSettings:usdlRecognizerSettings];

// Add additional recognizers if necessary.
// Check Microblink header files for all classes with RecognizerSettings suffix.

/** 4. Initialize the Scanning Coordinator object */

PPCameraCoordinator *coordinator = [[PPCameraCoordinator alloc] initWithSettings:settings];

return coordinator;

} `

I am unable to call `

Can i have any working code for getting front image of US Driving License and Thumb of it .

juraskrlec commented 6 years ago

Hi @veenunalla

for full front image you will need to use another recognizer, for example PPDocumentFaceRecognizerSettings and set returnFullDocument property to YES; Now in didOutputMetadata, you will need to check if PPMetadata is kind of class PPImageMetadata and cast it to PPImageMetadat and check its name property for FULL_DOCUMENT_IMAGE. After that, you can extract image with image property on PPImageMetadata. Hope this helps,

Best, Jura

veenunalla commented 6 years ago

Yes but PPDocumentFaceRecognizerSettings is called always . I need to scan front image of driving license and QR code for US Driving License back image . But by using PPDocumentFaceRecognizerSetting it always calls the didOutputMetadata method . How can i retrieve the back image data using USDL Recognizer

Can i use both PPDocumentFaceRecognizerSetting and PPUsdlRecognizerSettings in PPSettings