Closed jassiwaliaVC closed 5 years ago
Hi @jassiwaliaVC,
when using combined recognizer, in your case UsdlCombinedRecognizer
, don't wrap it with SuccessFrameGrabberRecognizer
. Add only usdlCombinedRecognizer
to recognizer collection, and when result is obtained instead usdlSuccessFrameGrabber.slaveRecognizer
, use usdlCombinedRecognizer
directly.
@i1E no luck this is my updated code, can u plz edit my code if it is wrong
scan() {
let usdlCombinedRecognizer = new window.cordova.plugins.BlinkID.UsdlCombinedRecognizer();
usdlCombinedRecognizer.returnFaceImage = true;
usdlCombinedRecognizer.returnFullDocumentImage = true;
let documentOverlaySettings = new window.cordova.plugins.BlinkID.DocumentVerificationOverlaySettings();
// create RecognizerCollection from any number of recognizers that should perform recognition
let recognizerCollection = new window.cordova.plugins.BlinkID.RecognizerCollection([usdlCombinedRecognizer]);
let licenseKeys = {
android: 'sRwAAAAXY29tLm9uZWJjZy5pZHNjYW5uZXJkZXZgrSTtAkdtBQOSkXe5VYYCa4Kv4FsowpNq6Q6kevm5y1Rg+mcpICc7mfJ6UGkbz0e5rbGHUfDrSw+/Da8RmbXqQNdZbeIaJTeA09rPdVbIgSNaCE0MPMtjs4GoIYvgLhUTCxUYOGYytrEDy+xXvWfSlgvnb4T4vJDjo8s7H9Vtto4YFDJg6Y1/r/sT6y8EKOe0505F4HUdM32JoO151b2hptIqRPC+qQCxpbaTqviIbbW4tUIXc72d',
ios: 'sRwAAAEXY29tLm9uZWJjZy5pZHNjYW5uZXJkZXaqsDWt96epsB3plipipFhh6ajAt2Jqa6SK6VoXFjtXKOwVtFDeohKhHrxl/NgbZzKlmKQHACT2i54VrtMDYr13qjdQn7WBD+QlfrVapmE6EhmfetkuCXgK8wTryy9ke7lYLw8243QABuWrQzn0JTZJYihkf7TrqMaG8ave/qeGtrPtqHeNpP4eSi7LlScty6vaf8pby4ZOsKSfrTzFfoBDA88I5E/F310Y4FFsUXw2ZAlQCOKemXTy'
};
window.cordova.plugins.BlinkID.scanWithCamera((cancelled) => {
if (cancelled) {
this.alertProvider.showToast('cancelled')
return;
}
// success frame is available in usdlRecognizer's successFrameGrabber wrapper's result as Base64 encoded JPEG
let successFrame = usdlCombinedRecognizer.result.fullDocumentImage;
if (successFrame) {
this.successFrame = "data:image/jpg;base64," + successFrame;
}
// Face image is returned as Base64 encoded JPEG
let resultFaceImage = usdlCombinedRecognizer.result.faceImage;
if (resultFaceImage) {
this.faceImage = "data:image/jpg;base64," + resultFaceImage;
}
let fields = usdlCombinedRecognizer.result.fields;
let USDLKeys = window.cordova.plugins.BlinkID.UsdlKeys;
let fieldDelim = "<br>";
let resultDiv = /** Personal information */
"USDL version: " + fields[USDLKeys.StandardVersionNumber] + fieldDelim +
"Family name: " + fields[USDLKeys.CustomerFamilyName] + fieldDelim +
"First name: " + fields[USDLKeys.CustomerFirstName] + fieldDelim +
"Date of birth: " + fields[USDLKeys.DateOfBirth] + fieldDelim +
"Sex: " + fields[USDLKeys.Sex] + fieldDelim +
"Eye color: " + fields[USDLKeys.EyeColor] + fieldDelim +
"Height: " + fields[USDLKeys.Height] + fieldDelim +
"Street: " + fields[USDLKeys.AddressStreet] + fieldDelim +
"City: " + fields[USDLKeys.AddressCity] + fieldDelim +
"Jurisdiction: " + fields[USDLKeys.AddressJurisdictionCode] + fieldDelim +
"Postal code: " + fields[USDLKeys.AddressPostalCode] + fieldDelim +
/** License information */
"Issue date: " + fields[USDLKeys.DocumentIssueDate] + fieldDelim +
"Expiration date: " + fields[USDLKeys.DocumentExpirationDate] + fieldDelim +
"Issuer ID: " + fields[USDLKeys.IssuerIdentificationNumber] + fieldDelim +
"Jurisdiction version: " + fields[USDLKeys.JurisdictionVersionNumber] + fieldDelim +
"Vehicle class: " + fields[USDLKeys.JurisdictionVehicleClass] + fieldDelim +
"Restrictions: " + fields[USDLKeys.JurisdictionRestrictionCodes] + fieldDelim +
"Endorsments: " + fields[USDLKeys.JurisdictionEndorsementCodes] + fieldDelim +
"Customer ID: " + fields[USDLKeys.CustomerIdNumber] + fieldDelim;
this.data = resultDiv;
// alert(JSON.stringify(this.data))
},
// Register the error callback
function errorHandler(err) {
alert('Error: ' + err);
},
documentOverlaySettings, recognizerCollection, licenseKeys
);
}
Hello @jassiwaliaVC
Can you please contact us at support@microblink.com with more details about the phone and sample of the document that you are trying to scan.
Best regards
thanx for the update @culoi it was device issue and it worked well in iphone6 and iphone X
Below is the code for US driving license but i am able to scan 2 out of 20 US driving cards from pdf in my PC. And same cards i scanned with Blinkid official app from playstore it scanned 11 out of 20 cards. Please correct me if i m using wrong code.
scan() { let usdlCombinedRecognizer = new window.cordova.plugins.BlinkID.UsdlCombinedRecognizer(); usdlCombinedRecognizer.returnFaceImage = true; usdlCombinedRecognizer.returnFullDocumentImage = true;
}