BlinkID / blinkid-cordova

ID scanning for cross-platform apps built with Cordova and Phonegap.
48 stars 34 forks source link

Back side of US DL #131

Open AlibekJ opened 3 years ago

AlibekJ commented 3 years ago

I am still struggling with capturing the backside of the USDL. If I use blinkIdCombinedRecognizer, I get front and back images, but not the USDL-specific data fields.

let recognizerCollection = 
new cordova.plugins.BlinkID.RecognizerCollection([mrtdSuccessFrameGrabber, 
blinkIdCombinedRecognizer]);

If I use usdlCombinedRecognizer like this:

let recognizerCollection = 
new cordova.plugins.BlinkID.RecognizerCollection([mrtdSuccessFrameGrabber, 
usdlCombinedRecognizer]);

I get all the data, but not the back image.

I tried using them both like this

let recognizerCollection = 
new cordova.plugins.BlinkID.RecognizerCollection([mrtdSuccessFrameGrabber, 
usdlCombinedRecognizer, 
blinkIdCombinedRecognizer]);

However the blinkIdCombinedRecognizer picks up the data first and usdlCombinedRecognizer.result comes back empty, so, again, I get the images but not the data.

mparadina commented 3 years ago

Hello @AlibekJ

Can you please tell me which specific data fields are not being returned when using the BlinkID combined recognizer?

Regards, Milan

AlibekJ commented 3 years ago

@mparadina

Here are the critical ones

let fields = usdlCombinedRecognizer.result.fields;
let USDLKeys = cordova.plugins.BlinkID.UsdlKeys;

middleName = fields[USDLKeys.CustomerMiddleName];
veteran = fields[USDLKeys.Veteran];
ssn = fields[USDLKeys.SocialSecurityNumber];
issuingState = fields[USDLKeys.IssuingJurisdictionName];

But other DL data such as fields[USDLKeys.EyeColor] is also valuable.

mparadina commented 3 years ago

Hi @AlibekJ

The data fields you've stressed out above are specific fields that are only obtainable by the USDL recognizer.

We do not support retrieving the specific fields with the BlinkID recognizer that can only be found on only one set of documents (for example eye color on the USDL), since the BlinkID recognizer is a generic recognizer, which contains a set of fields that are common for generally all types of documents that it currently supports reading.

However, it can return both front and back document images.

On the other hand, with the USDL recognizer, you can obtain the previously mentioned information, but it can not retrieve the backside image, since it only reads the barcode and extracts the information from it.

Hope this was helpful.

Regards, Milan

AlibekJ commented 3 years ago

That's right: I can have the back image or the data, but can not have both. Now when you understand the problem, would appreciate if you could suggest any way of solving this.

Middle name is a critical piece of information.

mparadina commented 3 years ago

Hi @AlibekJ

Apologies for keeping you waiting.

If your use-case requires getting the backside image, then we certainly recommend using the BlinkID recognizer.

For getting the middle name, currently, it is always displayed along with the last name, so you will need to put together your own parsing logic in order to retrieve it.

If your use-case requires obtaining the Issue state, you could obtain it with the ClassInfo.Region method.

Like I've said in my previous response, the other data is USDL specific, and for now, you would need to use the USDL recognizer in order to obtain them.

Hope this helps. Feel free to ask here or directly at support@microblink.com in case of any additional questions.

Regards, Milan

AlibekJ commented 3 years ago

This basically reiterates my initial comment: The problem is in the fact that I must choose between having the data or having the back side image.

I found a workaround which allows getting a raw image of the back side. I guess it will have to do until proper solution is found.

  let usdlCombinedRecognizer = new cordova.plugins.BlinkID.UsdlCombinedRecognizer();
usdlCombinedRecognizer.returnFaceImage = true;
usdlCombinedRecognizer.returnFullDocumentImage = true;
usdlCombinedRecognizer.allowMultipleResults = true;

var frameGrabber2 = new cordova.plugins.BlinkID.SuccessFrameGrabberRecognizer(usdlCombinedRecognizer);
frameGrabber2.allowMultipleResults = true;

var recognizerCollection = new cordova.plugins.BlinkID.RecognizerCollection([ /*whatever other recognizers you use */ frameGrabber2]);

//US DL data
usdlCombinedRecognizer.result;

//front image 
usdlCombinedRecognizer.result.fullDocumentImage

//back image, raw
recognizerCollection.recognizerArray[0].result.successFrame
mparadina commented 3 years ago

Hi @AlibekJ

If you've decided to use the USDL recognizer, I could also suggest using the MBCaptureHighResImage, when it comes to taking the image of the backside of the USDL.

MBCaptureHighResImage can return high-resolution MBImages with capture or still output.

Documentation: http://blinkid.github.io/blinkid-ios/Type%20Definitions.html#/c:MBRecognizerRunnerViewController.h@T@MBCaptureHighResImage

Hope this helps.

Regards, Milan