diff --git a/BlinkID/package.json b/BlinkID/package.json index 2ae0ae3..531ec92 100644 --- a/BlinkID/package.json +++ b/BlinkID/package.json @@ -1,6 +1,6 @@ { "name": "blinkid-cordova", - "version": "5.0.0", + "version": "5.1.0", "description": "A small and powerful ID card scanning library", "cordova": { "id": "blinkid-cordova", diff --git a/BlinkID/plugin.xml b/BlinkID/plugin.xml index 06f6870..8f34a8f 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -2,7 +2,7 @@ + version="5.1.0"> BlinkIdScanner A small and powerful ID card scanning library diff --git a/BlinkID/scripts/initIOSFramework.sh b/BlinkID/scripts/initIOSFramework.sh index 80b3c50..b73aece 100755 --- a/BlinkID/scripts/initIOSFramework.sh +++ b/BlinkID/scripts/initIOSFramework.sh @@ -4,7 +4,7 @@ HERE="$(dirname "$(test -L "$0" && readlink "$0" || echo "$0")")" pushd "${HERE}/../src/ios/" > /dev/null -LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.0.0/blinkid-ios_v5.0.0.zip' +LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.1.0/blinkid-ios_v5.1.0.zip' FILENAME='blinkid-ios.zip' # check if Microblink framework and bundle already exist diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIDSerializationUtils.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIDSerializationUtils.java index 8c99381..48cf64b 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIDSerializationUtils.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIDSerializationUtils.java @@ -26,6 +26,12 @@ public static JSONObject serializeMrzResult(MrzResult mrzResult) throws JSONExce jsonMrz.put("applicationReceiptNumber", mrzResult.getApplicationReceiptNumber()); jsonMrz.put("immigrantCaseNumber", mrzResult.getImmigrantCaseNumber()); jsonMrz.put("mrzText", mrzResult.getMrzText()); + jsonMrz.put("sanitizedOpt1", mrzResult.getSanitizedOpt1()); + jsonMrz.put("sanitizedOpt2", mrzResult.getSanitizedOpt2()); + jsonMrz.put("sanitizedNationality", mrzResult.getSanitizedNationality()); + jsonMrz.put("sanitizedIssuer", mrzResult.getSanitizedIssuer()); + jsonMrz.put("sanitizedDocumentCode", mrzResult.getSanitizedDocumentCode()); + jsonMrz.put("sanitizedDocumentNumber", mrzResult.getSanitizedDocumentNumber()); jsonMrz.put("mrzParsed", mrzResult.isMrzParsed()); jsonMrz.put("mrzVerified", mrzResult.isMrzVerified()); return jsonMrz; diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java index 75704e5..900ffa2 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java @@ -11,6 +11,7 @@ public final class BlinkIdCombinedRecognizerSerialization implements RecognizerS @Override public Recognizer createRecognizer(JSONObject jsonRecognizer) { com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer(); + recognizer.setAllowBlurFilter(jsonRecognizer.optBoolean("allowBlurFilter", true)); recognizer.setFaceImageDpi(jsonRecognizer.optInt("faceImageDpi", 250)); recognizer.setFullDocumentImageDpi(jsonRecognizer.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(BlinkIDSerializationUtils.deserializeExtensionFactors(jsonRecognizer.optJSONObject("fullDocumentImageExtensionFactors"))); diff --git a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java index e6b182f..124df1a 100644 --- a/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/phonegap/plugins/microblink/recognizers/serialization/BlinkIdRecognizerSerialization.java @@ -11,6 +11,7 @@ public final class BlinkIdRecognizerSerialization implements RecognizerSerializa @Override public Recognizer createRecognizer(JSONObject jsonRecognizer) { com.microblink.entities.recognizers.blinkid.generic.BlinkIdRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.generic.BlinkIdRecognizer(); + recognizer.setAllowBlurFilter(jsonRecognizer.optBoolean("allowBlurFilter", true)); recognizer.setFaceImageDpi(jsonRecognizer.optInt("faceImageDpi", 250)); recognizer.setFullDocumentImageDpi(jsonRecognizer.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(BlinkIDSerializationUtils.deserializeExtensionFactors(jsonRecognizer.optJSONObject("fullDocumentImageExtensionFactors"))); diff --git a/BlinkID/src/android/libBlinkID.gradle b/BlinkID/src/android/libBlinkID.gradle index f2a36d9..8279544 100644 --- a/BlinkID/src/android/libBlinkID.gradle +++ b/BlinkID/src/android/libBlinkID.gradle @@ -5,7 +5,7 @@ repositories { } dependencies { - implementation('com.microblink:blinkid:5.0.0@aar') { + implementation('com.microblink:blinkid:5.1.0@aar') { transitive = true } } diff --git a/BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m b/BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m index 9f645e5..e7b6952 100644 --- a/BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m +++ b/BlinkID/src/ios/sources/MBBlinkIDSerializationUtils.m @@ -29,7 +29,13 @@ +(NSDictionary *) serializeMrzResult:(MBMrzResult *)mrzResult { @"immigrantCaseNumber" : mrzResult.immigrantCaseNumber, @"mrzText" : mrzResult.mrzText, @"mrzParsed" : [NSNumber numberWithBool:mrzResult.isParsed], - @"mrzVerified" : [NSNumber numberWithBool:mrzResult.isVerified] + @"mrzVerified" : [NSNumber numberWithBool:mrzResult.isVerified], + @"sanitizedOpt1" : mrzResult.sanitizedOpt1, + @"sanitizedOpt2" : mrzResult.sanitizedOpt2, + @"sanitizedNationality" : mrzResult.sanitizedNationality, + @"sanitizedIssuer" : mrzResult.sanitizedIssuer, + @"sanitizedDocumentCode" : mrzResult.sanitizedDocumentCode, + @"sanitizedDocumentNumber" : mrzResult.sanitizedDocumentNumber }; } diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m index d32894d..c8675c6 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m @@ -16,6 +16,12 @@ -(instancetype) init { -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { MBBlinkIdCombinedRecognizer *recognizer = [[MBBlinkIdCombinedRecognizer alloc] init]; + { + id allowBlurFilter = [jsonRecognizer valueForKey:@"allowBlurFilter"]; + if (allowBlurFilter != nil) { + recognizer.allowBlurFilter = [(NSNumber *)allowBlurFilter boolValue]; + } + } { id faceImageDpi = [jsonRecognizer valueForKey:@"faceImageDpi"]; if (faceImageDpi != nil) { diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m index 06c94cc..9e3825c 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdRecognizerWrapper.m @@ -16,6 +16,12 @@ -(instancetype) init { -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { MBBlinkIdRecognizer *recognizer = [[MBBlinkIdRecognizer alloc] init]; + { + id allowBlurFilter = [jsonRecognizer valueForKey:@"allowBlurFilter"]; + if (allowBlurFilter != nil) { + recognizer.allowBlurFilter = [(NSNumber *)allowBlurFilter boolValue]; + } + } { id faceImageDpi = [jsonRecognizer valueForKey:@"faceImageDpi"]; if (faceImageDpi != nil) { diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index 5be619a..2ce961b 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -299,6 +299,36 @@ function MrzResult(nativeMRZResult) { this.mrzParsed = nativeMRZResult.mrzParsed; /** true if all check digits inside MRZ are correct, false otherwise. */ this.mrzVerified = nativeMRZResult.mrzVerified; + + /** + * Sanitized field opt1 + */ + this.sanitizedOpt1 = nativeMRZResult.sanitizedOpt1; + + /** + * Sanitized field opt2 + */ + this.sanitizedOpt2 = nativeMRZResult.sanitizedOpt2; + + /** + * Sanitized field nationality + */ + this.sanitizedNationality = nativeMRZResult.sanitizedNationality; + + /** + * Sanitized field issuer + */ + this.sanitizedIssuer = nativeMRZResult.sanitizedIssuer; + + /** + * Sanitized document code + */ + this.sanitizedDocumentCode = nativeMRZResult.sanitizedDocumentCode; + + /** + * Sanitized document number + */ + this.sanitizedDocumentNumber = nativeMRZResult.sanitizedDocumentNumber; } /** @@ -476,7 +506,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -519,7 +549,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side * of the document and values do not match, this method will return DataMatchResultFailed. Result will - * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. + * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. */ this.documentDataMatch = nativeResult.documentDataMatch; @@ -539,7 +569,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -549,12 +579,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; @@ -579,7 +609,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone + * The data extracted from the machine readable zone */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -620,7 +650,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { /** * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -641,41 +671,48 @@ BlinkID.prototype.BlinkIdCombinedRecognizerResult = BlinkIdCombinedRecognizerRes function BlinkIdCombinedRecognizer() { Recognizer.call(this, 'BlinkIdCombinedRecognizer'); + /** + * Defines whether blured frames filtering is allowed + * + * + */ + this.allowBlurFilter = true; + /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; @@ -694,7 +731,7 @@ function BlinkIdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -749,7 +786,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.employer = nativeResult.employer; /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -759,7 +796,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * full document image if enabled with returnFullDocumentImage property. + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -784,7 +821,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.maritalStatus = nativeResult.maritalStatus; /** - * The data extracted from the machine readable zone + * The data extracted from the machine readable zone */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -840,41 +877,48 @@ BlinkID.prototype.BlinkIdRecognizerResult = BlinkIdRecognizerResult; function BlinkIdRecognizer() { Recognizer.call(this, 'BlinkIdRecognizer'); + /** + * Defines whether blured frames filtering is allowed + * + * + */ + this.allowBlurFilter = true; + /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; @@ -893,22 +937,22 @@ function DocumentFaceRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Quadrangle represeting corner points of the document within the input image. + * Quadrangle represeting corner points of the document within the input image. */ this.documentLocation = nativeResult.documentLocation != null ? new Quadrilateral(nativeResult.documentLocation) : null; /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Quadrangle represeting corner points of the face image within the input image. + * Quadrangle represeting corner points of the face image within the input image. */ this.faceLocation = nativeResult.faceLocation != null ? new Quadrilateral(nativeResult.faceLocation) : null; /** - * full document image if enabled with returnFullDocumentImage property. + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -920,7 +964,7 @@ BlinkID.prototype.DocumentFaceRecognizerResult = DocumentFaceRecognizerResult; /** * Class for configuring Document Face Recognizer Recognizer. - * + * * Document Face Recognizer recognizer is used for scanning documents containing face images. */ function DocumentFaceRecognizer() { @@ -928,56 +972,56 @@ function DocumentFaceRecognizer() { /** * Type of docment this recognizer will scan. - * - * + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Defines how many times the same document should be detected before the detector * returns this document as a result of the deteciton - * + * * Higher number means more reliable detection, but slower processing - * - * + * + * */ this.numStableDetectionsThreshold = 6; /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; @@ -996,12 +1040,12 @@ function MrtdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; @@ -1009,33 +1053,33 @@ function MrtdCombinedRecognizerResult(nativeResult) { * Returns DataMatchResultSuccess if data from scanned parts/sides of the document match, * DataMatchResultFailed otherwise. For example if date of expiry is scanned from the front and back side * of the document and values do not match, this method will return DataMatchResultFailed. Result will - * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. + * be DataMatchResultSuccess only if scanned values for all fields that are compared are the same. */ this.documentDataMatch = nativeResult.documentDataMatch; /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; /** - * Returns the Data extracted from the machine readable zone. + * Returns the Data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; /** * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -1047,7 +1091,7 @@ BlinkID.prototype.MrtdCombinedRecognizerResult = MrtdCombinedRecognizerResult; /** * MRTD Combined recognizer - * + * * MRTD Combined recognizer is used for scanning both front and back side of generic IDs. */ function MrtdCombinedRecognizer() { @@ -1055,85 +1099,85 @@ function MrtdCombinedRecognizer() { /** * Whether special characters are allowed - * - * + * + * */ this.allowSpecialCharacters = false; /** * Whether returning of unparsed results is allowed - * - * + * + * */ this.allowUnparsedResults = false; /** * Whether returning of unverified results is allowed * Unverified result is result that is parsed, but check digits are incorrect. - * - * + * + * */ this.allowUnverifiedResults = false; /** * Type of document this recognizer will scan. - * - * + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Defines how many times the same document should be detected before the detector * returns this document as a result of the deteciton - * + * * Higher number means more reliable detection, but slower processing - * - * + * + * */ this.numStableDetectionsThreshold = 6; /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; /** * Whether or not recognition result should be signed. - * - * + * + * */ this.signResult = false; @@ -1152,12 +1196,12 @@ function MrtdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * full document image if enabled with returnFullDocumentImage property. + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; /** - * Returns the Data extracted from the machine readable zone. + * Returns the Data extracted from the machine readable zone. */ this.mrzResult = nativeResult.mrzResult != null ? new MrzResult(nativeResult.mrzResult) : null; @@ -1175,53 +1219,53 @@ function MrtdRecognizer() { /** * Whether special characters are allowed - * - * + * + * */ this.allowSpecialCharacters = false; /** * Whether returning of unparsed results is allowed - * - * + * + * */ this.allowUnparsedResults = false; /** * Whether returning of unverified results is allowed * Unverified result is result that is parsed, but check digits are incorrect. - * - * + * + * */ this.allowUnverifiedResults = false; /** * Defines if glare detection should be turned on/off. - * - * + * + * */ this.detectGlare = true; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; @@ -1240,12 +1284,12 @@ function PassportRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1268,46 +1312,46 @@ function PassportRecognizer() { /** * Defines if glare detection should be turned on/off. - * - * + * + * */ this.detectGlare = true; /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; @@ -1326,12 +1370,12 @@ function VisaRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * face image from the document if enabled with returnFaceImage property. + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -1354,46 +1398,46 @@ function VisaRecognizer() { /** * Defines if glare detection should be turned on/off. - * - * + * + * */ this.detectGlare = true; /** * Property for setting DPI for face images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.faceImageDpi = 250; /** * Property for setting DPI for full document images * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * + * */ this.fullDocumentImageDpi = 250; /** * Image extension factors for full document image. - * + * * @see ImageExtensionFactors - * + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Sets whether face image from ID card should be extracted - * - * + * + * */ this.returnFaceImage = false; /** * Sets whether full document image of ID card should be extracted. - * - * + * + * */ this.returnFullDocumentImage = false; diff --git a/Release notes.md b/Release notes.md index 930f7e6..a05548b 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,6 @@ +## 5.1.0 +- Updated to [Android SDK v5.1.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.1.0) and [iOS SDK v5.1.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.1.0) + ## 5.0.0 - Updated to [Android SDK v5.0.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.0.0) and [iOS SDK v5.0.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.0.0) diff --git a/www/index.html b/www/index.html index df4e1cf..c44e3fa 100644 --- a/www/index.html +++ b/www/index.html @@ -34,9 +34,13 @@

Demo App

Successful Image:

-
+

Document Image:

- + +
+
+

Document Image:

+

Face Image:

diff --git a/www/js/index.js b/www/js/index.js index d8c1e42..47b0cfb 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -41,14 +41,18 @@ var app = { var successfulImageDiv = document.getElementById('successfulImageDiv'); var successfulImage = document.getElementById('successfulImage'); - var documentImageDiv = document.getElementById('documentImageDiv'); - var documentImage = document.getElementById('documentImage'); + var documentFrontImageDiv = document.getElementById('documentFrontImageDiv'); + var documentFrontImage = document.getElementById('documentFrontImage'); + + var documentBackImageDiv = document.getElementById('documentBackImageDiv'); + var documentBackImage = document.getElementById('documentBackImage'); var faceImageDiv = document.getElementById('faceImageDiv'); var faceImage = document.getElementById('faceImage'); successfulImageDiv.style.visibility = "hidden" - documentImageDiv.style.visibility = "hidden" + documentFrontImageDiv.style.visibility = "hidden" + documentBackImageDiv.style.visibility = "hidden" faceImageDiv.style.visibility = "hidden" // to scan any machine readable travel document (passports, visa's and IDs with @@ -58,23 +62,23 @@ var app = { // wrap recognizer with SuccessFrameGrabberRecognizer to obtain camera frame from the successful scan // var mrtdSuccessFrameGrabber = new cordova.plugins.BlinkID.SuccessFrameGrabberRecognizer(mrtdRecognizer); - // BlinkIDRecognizer automatically classifies different document types and scans the data from + // BlinkIDCombinedRecognizer automatically classifies different document types and scans the data from // the supported document - var blinkIdRecognizer = new cordova.plugins.BlinkID.BlinkIdRecognizer(); - blinkIdRecognizer.returnFullDocumentImage = true; - blinkIdRecognizer.returnFaceImage = true; + var blinkIdCombinedRecognizer = new cordova.plugins.BlinkID.BlinkIdCombinedRecognizer(); + blinkIdCombinedRecognizer.returnFullDocumentImage = true; + blinkIdCombinedRecognizer.returnFaceImage = true; // there are lots of Recognizer objects in BlinkID - check blinkIdScanner.js for full reference var blinkidOverlaySettings = new cordova.plugins.BlinkID.BlinkIdOverlaySettings(); // create RecognizerCollection from any number of recognizers that should perform recognition - var recognizerCollection = new cordova.plugins.BlinkID.RecognizerCollection([blinkIdRecognizer /*, mrtdSuccessFrameGrabber */]); + var recognizerCollection = new cordova.plugins.BlinkID.RecognizerCollection([blinkIdCombinedRecognizer /*, mrtdSuccessFrameGrabber */]); // package name/bundleID com.microblink.blinkid var licenseKeys = { - android: 'sRwAAAAWY29tLm1pY3JvYmxpbmsuYmxpbmtpZJ9ew00uWSf86/uxZPHEBpL6LHXqPogMlETCNKjFP9T0z4TWTOJHROqlTx/kfMKYmpqvZN7v3J6f3+/kQflgDR0tvDECMzG1iXlfUJWnQXpABOO6F8sLzJmbJO7TjJv1DAjuv+2D1uez1LjErzyqCy7jFrtjpza9uUCLMrFopL9KuQ1/N+jxW/byQl6BtUeaj1IYBZzAhrUDBofLSlv6WC9GUrCqmO+TdgQvjUiSfx/60kU7bmBZX/T6A2hAfGvRWpfKo12NYs3a', - ios: 'sRwAAAEWY29tLm1pY3JvYmxpbmsuYmxpbmtpZFG2rW9X4lA0y++pNbzF7dz9sUsKWf1O171v7p1KOz04YJKGXS2t3YVBp5x38oTYfdsfXwga2Ki4o9RYh+wdvBZ9bAE08ZydNo4qTKZjU/oLXyLApN6fUTtpRfiLZylZNy/lUIq54jhl630DoQxMvx4FahFrhvpXvr97k+s+W1S/+recESxqIr4wn096VTnymYygiS3QUzv8NZRmSYzfk6QBQ1Lz61UjTBgGHI45atU1HU9FMzjullnPrW3pU6lQYDlx3h7Jcn59' + android: 'sRwAAAAWY29tLm1pY3JvYmxpbmsuYmxpbmtpZJ9ew00uWSf86/uxZPXcApL6+YU0qR1SNvPfKyc5E00is1auAGGbyzPE6yLmrUG5ceNJjfJE7ihlZKLIl0orBS45M/k6U8LXcRyIxr/MXp8rnfn9vzGJg64yQYrIT/FdNK10BPq6Lcrf9dzbxXwiZQyUn9fMJTQdmkPwtm9HWllLfKMNFXGYOEgyg6NmbpmXn1Vbb9GGACKkJeO1zIaNqxCOkRmRITslkbIZrbjvKrBEqWs3LWFdxcQbhzLINYzNlGOW0TlgrQVE1YzLxw==', + ios: 'sRwAAAEWY29tLm1pY3JvYmxpbmsuYmxpbmtpZFG2rW9X4lA0y++pNbi97tyK509NZKKdrPKO7LUkgQ3Y08FFOY/IuFiDmjbTswsq/T80cjYEmEZBKY/ksAAR2mtdd4SycKJTKAttKgg1yzeImVi6ueb/Vt5iH4LiL+ZKVDapJsGU2e5vvCfkMpd4cPbtRBS3+PBxR3RSPHKVprHZ0aDTwVoKu5bw2thcFyoZGbvQuSDtAA4eUyuPk/QT5CHe+IUfCpJ2NqHWxRRLkDWEbSsTCzdbz9eRFPUk0DvR5Glk7KCOXHMdFZfm4A==' }; scanButton.addEventListener('click', function() { @@ -94,23 +98,29 @@ var app = { // if not cancelled, every recognizer will have its result property updated successfulImageDiv.style.visibility = "hidden" - documentImageDiv.style.visibility = "hidden" + documentFrontImageDiv.style.visibility = "hidden" + documentBackImageDiv.style.visibility = "hidden" faceImageDiv.style.visibility = "hidden" - if (blinkIdRecognizer.result.resultState == cordova.plugins.BlinkID.RecognizerResultState.valid) { - var resultDocumentImage = blinkIdRecognizer.result.fullDocumentImage; - if (resultDocumentImage) { - documentImage.src = "data:image/jpg;base64, " + resultDocumentImage; - documentImageDiv.style.visibility = "visible"; + if (blinkIdCombinedRecognizer.result.resultState == cordova.plugins.BlinkID.RecognizerResultState.valid) { + var resultDocumentFrontImage = blinkIdCombinedRecognizer.result.fullDocumentFrontImage; + if (resultDocumentFrontImage) { + documentFrontImage.src = "data:image/jpg;base64, " + resultDocumentFrontImage; + documentFrontImageDiv.style.visibility = "visible"; + } + var resultDocumentBackImage = blinkIdCombinedRecognizer.result.fullDocumentBackImage; + if (resultDocumentBackImage) { + documentBackImage.src = "data:image/jpg;base64, " + resultDocumentBackImage; + documentBackImageDiv.style.visibility = "visible"; } - var resultFaceImage = blinkIdRecognizer.result.faceImage; + var resultFaceImage = blinkIdCombinedRecognizer.result.faceImage; if (resultFaceImage) { faceImage.src = "data:image/jpg;base64, " + resultFaceImage; faceImageDiv.style.visibility = "visible"; } var fieldDelim = "
"; - var blinkIdResult = blinkIdRecognizer.result; + var blinkIdResult = blinkIdCombinedRecognizer.result; var resultString = "First name: " + blinkIdResult.firstName + fieldDelim +