From 1123ed56ca659736ae0e9c2b0bab3c8e63b3d572 Mon Sep 17 00:00:00 2001 From: Matija Krizanec Date: Tue, 29 Jun 2021 18:02:04 +0200 Subject: [PATCH 1/3] [android] update bindings and license key for v5.12.0 --- .../plugins/cordova/SerializationUtils.java | 15 - .../BlinkIDSerializationUtils.java | 15 + ...linkIdCombinedRecognizerSerialization.java | 6 +- .../BlinkIdRecognizerSerialization.java | 2 +- BlinkID/src/android/libBlinkID.gradle | 4 +- BlinkID/www/blinkIdScanner.js | 590 ++++++------------ sample_files/www/js/index.js | 2 +- 7 files changed, 220 insertions(+), 414 deletions(-) diff --git a/BlinkID/src/android/java/com/microblink/plugins/cordova/SerializationUtils.java b/BlinkID/src/android/java/com/microblink/plugins/cordova/SerializationUtils.java index c7fb4aa..9e056ff 100644 --- a/BlinkID/src/android/java/com/microblink/plugins/cordova/SerializationUtils.java +++ b/BlinkID/src/android/java/com/microblink/plugins/cordova/SerializationUtils.java @@ -11,7 +11,6 @@ import com.microblink.results.date.DateResult; import com.microblink.entities.Entity; import com.microblink.entities.recognizers.blinkid.imageoptions.extension.ImageExtensionFactors; -import com.microblink.entities.recognizers.blinkid.generic.RecognitionModeFilter; import org.json.JSONArray; import org.json.JSONException; @@ -124,18 +123,4 @@ public static ImageExtensionFactors deserializeExtensionFactors(JSONObject jsonE } } - public static RecognitionModeFilter deserializeRecognitionModeFilter(JSONObject json) { - if (json != null) { - boolean enableMrzId = (boolean)json.optBoolean("enableMrzId", true); - boolean enableMrzVisa = (boolean)json.optBoolean("enableMrzVisa", true); - boolean enableMrzPassport = (boolean)json.optBoolean("enableMrzPassport", true); - boolean enablePhotoId = (boolean)json.optBoolean("enablePhotoId", true); - boolean enableBarcodeId = (boolean)json.optBoolean("enableBarcodeId", true); - boolean enableFullDocumentRecognition = (boolean)json.optBoolean("enableFullDocumentRecognition", true); - return new RecognitionModeFilter(enableMrzId, enableMrzVisa, enableMrzPassport, enablePhotoId, enableBarcodeId, enableFullDocumentRecognition); - } else { - return new RecognitionModeFilter(); - } - } - } \ No newline at end of file diff --git a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIDSerializationUtils.java b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIDSerializationUtils.java index 4d3ea51..9320a3a 100644 --- a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIDSerializationUtils.java +++ b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIDSerializationUtils.java @@ -10,6 +10,7 @@ import com.microblink.entities.recognizers.blinkid.generic.barcode.BarcodeResult; import com.microblink.entities.recognizers.blinkid.idbarcode.BarcodeElements; import com.microblink.entities.recognizers.blinkid.idbarcode.BarcodeElementKey; +import com.microblink.entities.recognizers.blinkid.generic.RecognitionModeFilter; import org.json.JSONArray; import org.json.JSONException; @@ -158,4 +159,18 @@ public static JSONObject serializeBarcodeElements(BarcodeElements barcodeElement return jsonBarcodeElements; } + public static RecognitionModeFilter deserializeRecognitionModeFilter(JSONObject json) { + if (json != null) { + boolean enableMrzId = (boolean)json.optBoolean("enableMrzId", true); + boolean enableMrzVisa = (boolean)json.optBoolean("enableMrzVisa", true); + boolean enableMrzPassport = (boolean)json.optBoolean("enableMrzPassport", true); + boolean enablePhotoId = (boolean)json.optBoolean("enablePhotoId", true); + boolean enableBarcodeId = (boolean)json.optBoolean("enableBarcodeId", true); + boolean enableFullDocumentRecognition = (boolean)json.optBoolean("enableFullDocumentRecognition", true); + return new RecognitionModeFilter(enableMrzId, enableMrzVisa, enableMrzPassport, enablePhotoId, enableBarcodeId, enableFullDocumentRecognition); + } else { + return new RecognitionModeFilter(); + } + } + } \ No newline at end of file diff --git a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java index b659142..cadd045 100644 --- a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdCombinedRecognizerSerialization.java @@ -13,14 +13,16 @@ public final class BlinkIdCombinedRecognizerSerialization implements RecognizerS public Recognizer createRecognizer(JSONObject jsonObject) { com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer recognizer = new com.microblink.entities.recognizers.blinkid.generic.BlinkIdCombinedRecognizer(); recognizer.setAllowBlurFilter(jsonObject.optBoolean("allowBlurFilter", true)); + recognizer.setAllowUncertainFrontSideScan(jsonObject.optBoolean("allowUncertainFrontSideScan", false)); recognizer.setAllowUnparsedMrzResults(jsonObject.optBoolean("allowUnparsedMrzResults", false)); recognizer.setAllowUnverifiedMrzResults(jsonObject.optBoolean("allowUnverifiedMrzResults", true)); recognizer.setAnonymizationMode(com.microblink.entities.recognizers.blinkid.generic.AnonymizationMode.values()[jsonObject.optInt("anonymizationMode", 4) - 1]); recognizer.setFaceImageDpi(jsonObject.optInt("faceImageDpi", 250)); recognizer.setFullDocumentImageDpi(jsonObject.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(SerializationUtils.deserializeExtensionFactors(jsonObject.optJSONObject("fullDocumentImageExtensionFactors"))); + recognizer.setMaxAllowedMismatchesPerField(jsonObject.optInt("maxAllowedMismatchesPerField", 0)); recognizer.setPaddingEdge((float)jsonObject.optDouble("paddingEdge", 0.0)); - recognizer.setRecognitionModeFilter(SerializationUtils.deserializeRecognitionModeFilter(jsonObject.optJSONObject("recognitionModeFilter"))); + recognizer.setRecognitionModeFilter(BlinkIDSerializationUtils.deserializeRecognitionModeFilter(jsonObject.optJSONObject("recognitionModeFilter"))); recognizer.setReturnFaceImage(jsonObject.optBoolean("returnFaceImage", false)); recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false)); recognizer.setReturnSignatureImage(jsonObject.optBoolean("returnSignatureImage", false)); @@ -43,6 +45,7 @@ public JSONObject serializeResult(Recognizer recognizer) { jsonResult.put("address", result.getAddress()); jsonResult.put("age", result.getAge()); jsonResult.put("backImageAnalysisResult", BlinkIDSerializationUtils.serializeImageAnalysisResult(result.getBackImageAnalysisResult())); + jsonResult.put("backProcessingStatus", SerializationUtils.serializeEnum(result.getBackProcessingStatus())); jsonResult.put("backVizResult", BlinkIDSerializationUtils.serializeVizResult(result.getBackVizResult())); jsonResult.put("barcodeResult", BlinkIDSerializationUtils.serializeBarcodeResult(result.getBarcodeResult())); jsonResult.put("classInfo", BlinkIDSerializationUtils.serializeClassInfo(result.getClassInfo())); @@ -62,6 +65,7 @@ public JSONObject serializeResult(Recognizer recognizer) { jsonResult.put("faceImage", SerializationUtils.encodeImageBase64(result.getFaceImage())); jsonResult.put("firstName", result.getFirstName()); jsonResult.put("frontImageAnalysisResult", BlinkIDSerializationUtils.serializeImageAnalysisResult(result.getFrontImageAnalysisResult())); + jsonResult.put("frontProcessingStatus", SerializationUtils.serializeEnum(result.getFrontProcessingStatus())); jsonResult.put("frontVizResult", BlinkIDSerializationUtils.serializeVizResult(result.getFrontVizResult())); jsonResult.put("fullDocumentBackImage", SerializationUtils.encodeImageBase64(result.getFullDocumentBackImage())); jsonResult.put("fullDocumentFrontImage", SerializationUtils.encodeImageBase64(result.getFullDocumentFrontImage())); diff --git a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdRecognizerSerialization.java b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdRecognizerSerialization.java index a5c3144..6930ed1 100644 --- a/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdRecognizerSerialization.java +++ b/BlinkID/src/android/java/com/microblink/plugins/cordova/recognizers/serialization/BlinkIdRecognizerSerialization.java @@ -20,7 +20,7 @@ public Recognizer createRecognizer(JSONObject jsonObject) { recognizer.setFullDocumentImageDpi(jsonObject.optInt("fullDocumentImageDpi", 250)); recognizer.setFullDocumentImageExtensionFactors(SerializationUtils.deserializeExtensionFactors(jsonObject.optJSONObject("fullDocumentImageExtensionFactors"))); recognizer.setPaddingEdge((float)jsonObject.optDouble("paddingEdge", 0.0)); - recognizer.setRecognitionModeFilter(SerializationUtils.deserializeRecognitionModeFilter(jsonObject.optJSONObject("recognitionModeFilter"))); + recognizer.setRecognitionModeFilter(BlinkIDSerializationUtils.deserializeRecognitionModeFilter(jsonObject.optJSONObject("recognitionModeFilter"))); recognizer.setReturnFaceImage(jsonObject.optBoolean("returnFaceImage", false)); recognizer.setReturnFullDocumentImage(jsonObject.optBoolean("returnFullDocumentImage", false)); recognizer.setReturnSignatureImage(jsonObject.optBoolean("returnSignatureImage", false)); diff --git a/BlinkID/src/android/libBlinkID.gradle b/BlinkID/src/android/libBlinkID.gradle index e66bfb2..4744cbe 100644 --- a/BlinkID/src/android/libBlinkID.gradle +++ b/BlinkID/src/android/libBlinkID.gradle @@ -2,11 +2,11 @@ repositories { jcenter() mavenCentral() //mavenLocal() - maven { url 'http://maven.microblink.com' } + maven { url 'https://maven.microblink.com' } } dependencies { - implementation('com.microblink:blinkid:5.11.0@aar') { + implementation('com.microblink:blinkid:5.12.0@aar') { transitive = true } } diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index b0dd1a1..4cc0099 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -347,7 +347,10 @@ BlinkID.prototype.ProcessingStatus = Object.freeze( UnsupportedByLicense: 14, /** Front side recognition has completed successfully, and recognizer is waiting for the other side to be scanned. */ - AwaitingOtherSide: 15 + AwaitingOtherSide: 15, + + /** Side not scanned. */ + NotScanned: 16 } ); @@ -770,7 +773,12 @@ BlinkID.prototype.Region = Object.freeze( Tabasco: 106, TamilNadu: 107, Yucatan: 108, - Zacatecas: 109 + Zacatecas: 109, + Aguascalientes: 110, + BajaCaliforniaSur: 111, + Campeche: 112, + Colima: 113, + QuintanaRooBenitoJuarez: 114 } ); @@ -825,7 +833,8 @@ BlinkID.prototype.Type = Object.freeze( ProofOfAgeCard: 44, RefugeeId: 45, TribalId: 46, - VeteranId: 47 + VeteranId: 47, + CitizenshipCertificate: 48 } ); @@ -2055,25 +2064,6 @@ function BarcodeElements(nativeBarcodeElements) { this.values = nativeBarcodeElements.values; } -/** - * Result of the data matching algorithm for scanned parts/sides of the document. - */ -var DataMatchResult = Object.freeze( - { - /** Data matching has not been performed. */ - NotPerformed : 1, - /** Data does not match. */ - Failed : 2, - /** Data match. */ - Success : 3 - } -); - -/** - * Possible values for Document Data Match Result field. - */ -BlinkID.prototype.DataMatchResult = DataMatchResult - /** Possible supported detectors for documents containing face image */ var DocumentFaceDetectorType = Object.freeze( { @@ -2091,25 +2081,6 @@ var DocumentFaceDetectorType = Object.freeze( */ BlinkID.prototype.DocumentFaceDetectorType = DocumentFaceDetectorType; -/** - * Extension factors relative to corresponding dimension of the full image. For example, - * upFactor and downFactor define extensions relative to image height, e.g. - * when upFactor is 0.5, upper image boundary will be extended for half of image's full - * height. - */ -function ImageExtensionFactors() { - /** image extension factor relative to full image height in UP direction. */ - this.upFactor = 0.0; - /** image extension factor relative to full image height in RIGHT direction. */ - this.rightFactor = 0.0; - /** image extension factor relative to full image height in DOWN direction. */ - this.downFactor = 0.0; - /** image extension factor relative to full image height in LEFT direction. */ - this.leftFactor = 0.0; -} - -BlinkID.prototype.ImageExtensionFactors = ImageExtensionFactors; - /** * RecognitionModeFilter is used to enable/disable recognition of specific document groups. * Setting is taken into account only if the right for that document is purchased. @@ -2130,6 +2101,43 @@ function RecognitionModeFilter() { } BlinkID.prototype.RecognitionModeFilter = RecognitionModeFilter; +/** + * Result of the data matching algorithm for scanned parts/sides of the document. + */ +var DataMatchResult = Object.freeze( + { + /** Data matching has not been performed. */ + NotPerformed : 1, + /** Data does not match. */ + Failed : 2, + /** Data match. */ + Success : 3 + } +); + +/** + * Possible values for Document Data Match Result field. + */ +BlinkID.prototype.DataMatchResult = DataMatchResult + +/** + * Extension factors relative to corresponding dimension of the full image. For example, + * upFactor and downFactor define extensions relative to image height, e.g. + * when upFactor is 0.5, upper image boundary will be extended for half of image's full + * height. + */ +function ImageExtensionFactors() { + /** image extension factor relative to full image height in UP direction. */ + this.upFactor = 0.0; + /** image extension factor relative to full image height in RIGHT direction. */ + this.rightFactor = 0.0; + /** image extension factor relative to full image height in DOWN direction. */ + this.downFactor = 0.0; + /** image extension factor relative to full image height in LEFT direction. */ + this.leftFactor = 0.0; +} + +BlinkID.prototype.ImageExtensionFactors = ImageExtensionFactors; // COMMON CLASSES @@ -2355,7 +2363,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional name information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -2371,28 +2379,31 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference - * between now and date of birth. Now is current time on the device. - * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * Defines possible color and moire statuses determined from scanned back image. + * Image analysis result for the scanned document back side image */ this.backImageAnalysisResult = nativeResult.backImageAnalysisResult; /** - * Defines the data extracted from the back side visual inspection zone. + * Status of the last back side recognition process. + */ + this.backProcessingStatus = nativeResult.backProcessingStatus; + + /** + * The data extracted from the back side visual inspection zone. */ this.backVizResult = nativeResult.backVizResult; /** - * Defines the data extracted from the barcode. + * The data extracted from the barcode. */ this.barcodeResult = nativeResult.barcodeResult; /** - * The classification information. + * The document class information. */ this.classInfo = nativeResult.classInfo; @@ -2417,12 +2428,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.dateOfIssue = nativeResult.dateOfIssue != null ? new Date(nativeResult.dateOfIssue) : null; /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Defines digital signature of recognition results. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Defines digital signature version. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; @@ -2432,10 +2443,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.documentAdditionalNumber = nativeResult.documentAdditionalNumber; /** - * 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. + * Defines result of the data matching algorithm for scanned parts/sides of the document. */ this.documentDataMatch = nativeResult.documentDataMatch; @@ -2461,17 +2469,11 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current - * time on the device with the date of expiry. - * - * @return true if the document has expired, false in following cases: - * document does not expire (date of expiry is permanent) - * date of expiry has passed - * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; @@ -2481,22 +2483,27 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * Defines possible color and moire statuses determined from scanned front image. + * Image analysis result for the scanned document front side image */ this.frontImageAnalysisResult = nativeResult.frontImageAnalysisResult; /** - * Defines the data extracted from the front side visual inspection zone. + * Status of the last front side recognition process. + */ + this.frontProcessingStatus = nativeResult.frontProcessingStatus; + + /** + * The data extracted from the front side visual inspection zone. */ this.frontVizResult = nativeResult.frontVizResult; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * Back side image of the document */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * Front side image of the document */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; @@ -2526,7 +2533,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; @@ -2546,7 +2553,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.placeOfBirth = nativeResult.placeOfBirth; /** - * Defines status of the last recognition process. + * Status of the last recognition process. */ this.processingStatus = nativeResult.processingStatus; @@ -2576,8 +2583,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.residentialStatus = nativeResult.residentialStatus; /** - * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * {true} if recognizer has finished scanning first side and is now scanning back side, */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -2587,7 +2593,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.sex = nativeResult.sex; /** - * image of the signature if enabled with returnSignatureImage property. + * Signature image from the document */ this.signatureImage = nativeResult.signatureImage; @@ -2598,137 +2604,103 @@ BlinkIdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResul BlinkID.prototype.BlinkIdCombinedRecognizerResult = BlinkIdCombinedRecognizerResult; /** - * Recognizer which can scan front and back side of the United States driver license. + * A generic recognizer which can scan front and back side of the document. */ function BlinkIdCombinedRecognizer() { Recognizer.call(this, 'BlinkIdCombinedRecognizer'); /** - * Defines whether blured frames filtering is allowed - * - * + * Defines whether blured frames filtering is allowed. */ this.allowBlurFilter = true; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed - * - * + * Proceed with scanning the back side even if the front side result is uncertain. + */ + this.allowUncertainFrontSideScan = false; + + /** + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed - * Unverified MRZ is parsed, but check digits are incorrect - * - * + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. */ this.allowUnverifiedMrzResults = true; /** - * Defines whether sensitive data should be removed from images, result fields or both. - * The setting only applies to certain documents - * - * + * Whether sensitive data should be removed from images, result fields or both. */ this.anonymizationMode = AnonymizationMode.FullResult; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case - * padding edge and image edge are the same. - * Recommended value is 0.02f. - * - * + * Configure the number of characters per field that are allowed to be inconsistent in data match. + */ + this.maxAllowedMismatchesPerField = 0; + + /** + * Padding is a minimum distance from the edge of the frame and it is defined */ this.paddingEdge = 0.0; /** - * Enable or disable recognition of specific document groups supported by the current license. - * - * + * Currently set recognition mode filter. */ this.recognitionModeFilter = new RecognitionModeFilter(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Sets whether signature image from ID card should be extracted. - * - * + * Defines whether signature image will be available in result. */ this.returnSignatureImage = false; /** * Configure the recognizer to only work on already cropped and dewarped images. - * This only works for still images - video feeds will ignore this setting. - * - * */ this.scanCroppedDocumentImage = false; /** - * Whether or not recognition result should be signed. - * - * + * Defines whether or not recognition result should be signed. */ this.signResult = false; /** - * Property for setting DPI for signature images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for signature image that should be returned. */ this.signatureImageDpi = 250; /** - * Skip back side capture and processing step when back side of the document is not supported - * - * + * Skip back side capture and processing step when back side of the document is not supported. */ this.skipUnsupportedBack = false; /** - * Defines whether result characters validatation is performed. - * If a result member contains invalid character, the result state cannot be valid - * - * + * Whether result characters validatation is performed. */ this.validateResultCharacters = true; @@ -2747,7 +2719,7 @@ function BlinkIdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional address information of the document owner. + * The additional name information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -2763,18 +2735,16 @@ function BlinkIdRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference - * between now and date of birth. Now is current time on the device. - * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * Defines the data extracted from the barcode. + * The data extracted from the barcode. */ this.barcodeResult = nativeResult.barcodeResult; /** - * The classification information. + * The document class information. */ this.classInfo = nativeResult.classInfo; @@ -2825,17 +2795,11 @@ function BlinkIdRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current - * time on the device with the date of expiry. - * - * @return true if the document has expired, false in following cases: - * document does not expire (date of expiry is permanent) - * date of expiry has passed - * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; @@ -2845,7 +2809,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -2855,7 +2819,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.fullName = nativeResult.fullName; /** - * Defines possible color and moire statuses determined from scanned image. + * Image analysis result for the scanned document image */ this.imageAnalysisResult = nativeResult.imageAnalysisResult; @@ -2880,7 +2844,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; @@ -2900,7 +2864,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.placeOfBirth = nativeResult.placeOfBirth; /** - * Defines status of the last recognition process. + * Status of the last recognition process. */ this.processingStatus = nativeResult.processingStatus; @@ -2935,12 +2899,12 @@ function BlinkIdRecognizerResult(nativeResult) { this.sex = nativeResult.sex; /** - * image of the signature if enabled with returnSignatureImage property. + * Signature image from the document */ this.signatureImage = nativeResult.signatureImage; /** - * Defines the data extracted from the visual inspection zone + * The data extracted from the visual inspection zone. */ this.vizResult = nativeResult.vizResult; @@ -2951,123 +2915,83 @@ BlinkIdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.e BlinkID.prototype.BlinkIdRecognizerResult = BlinkIdRecognizerResult; /** - * The Blink ID Recognizer is used for scanning Blink ID. + * Generic BlinkID recognizer. */ function BlinkIdRecognizer() { Recognizer.call(this, 'BlinkIdRecognizer'); /** - * Defines whether blured frames filtering is allowed - * - * + * Defines whether blured frames filtering is allowed" */ this.allowBlurFilter = true; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed - * - * + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed - * Unverified MRZ is parsed, but check digits are incorrect - * - * + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. */ this.allowUnverifiedMrzResults = true; /** - * Defines whether sensitive data should be removed from images, result fields or both. - * The setting only applies to certain documents - * - * + * Whether sensitive data should be removed from images, result fields or both. */ this.anonymizationMode = AnonymizationMode.FullResult; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case - * padding edge and image edge are the same. - * Recommended value is 0.02f. - * - * + * Padding is a minimum distance from the edge of the frame and it is defined */ this.paddingEdge = 0.0; /** - * Enable or disable recognition of specific document groups supported by the current license. - * - * + * Currently set recognition mode filter. */ this.recognitionModeFilter = new RecognitionModeFilter(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Sets whether signature image from ID card should be extracted. - * - * + * Defines whether signature image will be available in result. */ this.returnSignatureImage = false; /** * Configure the recognizer to only work on already cropped and dewarped images. - * This only works for still images - video feeds will ignore this setting. - * - * */ this.scanCroppedDocumentImage = false; /** - * Property for setting DPI for signature images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for signature image that should be returned. */ this.signatureImageDpi = 250; /** - * Defines whether result characters validatation is performed. - * If a result member contains invalid character, the result state cannot be valid - * - * + * Whether result characters validatation is performed. */ this.validateResultCharacters = true; @@ -3086,22 +3010,22 @@ function DocumentFaceRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Quadrangle represeting corner points of the document within the input image. + * The location of document detection in coordinate system of full input frame. */ 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 */ this.faceImage = nativeResult.faceImage; /** - * Quadrangle represeting corner points of the face image within the input image. + * The location of face detection in coordinate system of cropped full document image. */ this.faceLocation = nativeResult.faceLocation != null ? new Quadrilateral(nativeResult.faceLocation) : null; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3112,65 +3036,43 @@ DocumentFaceRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.DocumentFaceRecognizerResult = DocumentFaceRecognizerResult; /** - * Class for configuring Document Face Recognizer Recognizer. - * - * Document Face Recognizer recognizer is used for scanning documents containing face images. + * Recognizer for detecting holder's photo on documents containing image. */ function DocumentFaceRecognizer() { Recognizer.call(this, 'DocumentFaceRecognizer'); /** - * Type of docment this recognizer will scan. - * - * + * Currently used detector type. */ 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 - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ 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 - * - * + * Minimum number of stable detections required for detection to be successful. */ this.numStableDetectionsThreshold = 6; /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -3200,15 +3102,11 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference - * between now and date of birth. Now is current time on the device. - * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * Type of the barcode scanned - * - * @return Type of the barcode + * The format of the scanned barcode. */ this.barcodeType = nativeResult.barcodeType; @@ -3244,8 +3142,6 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * The document type deduced from the recognized barcode - * - * @return Type of the document */ this.documentType = nativeResult.documentType; @@ -3261,19 +3157,11 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current - * time on the device with the date of expiry. - * - * @return true if the document has expired, false in following cases: - * document does not expire (date of expiry is permanent) - * date of expiry has passed - * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** * Document specific extended elements that contain all barcode fields in their original form. - * - * Currently this is only filled for AAMVACompliant documents. */ this.extendedElements = nativeResult.extendedElements; @@ -3343,7 +3231,7 @@ function IdBarcodeRecognizerResult(nativeResult) { this.race = nativeResult.race; /** - * Byte array with result of the scan + * The raw bytes contained inside barcode. */ this.rawData = nativeResult.rawData; @@ -3353,7 +3241,7 @@ function IdBarcodeRecognizerResult(nativeResult) { this.religion = nativeResult.religion; /** - * The residential stauts of the document owner. + * The residential status of the document owner. */ this.residentialStatus = nativeResult.residentialStatus; @@ -3373,13 +3261,12 @@ function IdBarcodeRecognizerResult(nativeResult) { this.street = nativeResult.street; /** - * Retrieves string content of scanned data + * String representation of data inside barcode. */ this.stringData = nativeResult.stringData; /** - * Flag indicating uncertain scanning data - * E.g obtained from damaged barcode. + * True if returned result is uncertain, i.e. if scanned barcode was incomplete (i.e. */ this.uncertain = nativeResult.uncertain; @@ -3415,46 +3302,42 @@ function MrtdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Defines digital signature of recognition results. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Defines digital signature version. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * 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. + * Defines result of the data matching algorithm for scanned parts/sides of the document. */ this.documentDataMatch = nativeResult.documentDataMatch; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * back side image of the document if enabled with returnFullDocumentImage property. + * Back side image of the document */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * front side image of the document if enabled with returnFullDocumentImage property. + * Front side image of the document */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; /** - * Returns 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; /** - * Returns true if recognizer has finished scanning first side and is now scanning back side, - * false if it's still scanning first side. + * {true} if recognizer has finished scanning first side and is now scanning back side, */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -3465,94 +3348,64 @@ MrtdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.MrtdCombinedRecognizerResult = MrtdCombinedRecognizerResult; /** - * MRTD Combined recognizer - * - * MRTD Combined recognizer is used for scanning both front and back side of generic IDs. + * Recognizer for combined reading of face from front side of documents and MRZ from back side of + * * Machine Readable Travel Document. */ function MrtdCombinedRecognizer() { Recognizer.call(this, 'MrtdCombinedRecognizer'); /** - * Whether special characters are allowed - * - * + * Whether special characters are allowed. */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed - * - * + * 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. - * - * + * Whether returning of unverified results is allowed. */ this.allowUnverifiedResults = false; /** - * Type of document this recognizer will scan. - * - * + * Currently used detector type. */ 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 - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ 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 - * - * + * Minimum number of stable detections required for detection to be successful. */ this.numStableDetectionsThreshold = 6; /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Whether or not recognition result should be signed. - * - * + * Defines whether or not recognition result should be signed. */ this.signResult = false; @@ -3571,12 +3424,12 @@ function MrtdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; /** - * Returns 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; @@ -3587,60 +3440,43 @@ MrtdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.empt BlinkID.prototype.MrtdRecognizerResult = MrtdRecognizerResult; /** - * Recognizer that can recognizer Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) + * Recognizer that can recognize Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) */ function MrtdRecognizer() { Recognizer.call(this, 'MrtdRecognizer'); /** - * Whether special characters are allowed - * - * + * Whether special characters are allowed. */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed - * - * + * 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. - * - * + * Whether returning of unverified results is allowed. */ this.allowUnverifiedResults = false; /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; @@ -3659,22 +3495,22 @@ function PassportRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Digital signature of the recognition result. Available only if enabled with signResult property. + * Defines digital signature of recognition results. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Version of the digital signature. Available only if enabled with signResult property. + * Defines digital signature version. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3696,61 +3532,42 @@ function PassportRecognizer() { Recognizer.call(this, 'PassportRecognizer'); /** - * Defines whether to anonymize Netherlands MRZ - * - * + * Defines whether the Netherlands MRZ should be anonymized. */ this.anonymizeNetherlandsMrz = true; /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ this.detectGlare = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; /** - * Whether or not recognition result should be signed. - * - * + * Defines whether or not recognition result should be signed. */ this.signResult = false; @@ -3769,12 +3586,12 @@ function VisaRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * face image from the document if enabled with returnFaceImage property. + * Face image from the document */ this.faceImage = nativeResult.faceImage; /** - * full document image if enabled with returnFullDocumentImage property. + * Image of the full document */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3796,47 +3613,32 @@ function VisaRecognizer() { Recognizer.call(this, 'VisaRecognizer'); /** - * Defines if glare detection should be turned on/off. - * - * + * Defines whether glare detector is enabled. */ this.detectGlare = true; /** - * Property for setting DPI for face images - * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception - * - * + * The DPI (Dots Per Inch) for face image that should be returned. */ 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 - * - * + * The DPI (Dots Per Inch) for full document image that should be returned. */ this.fullDocumentImageDpi = 250; /** - * Image extension factors for full document image. - * - * @see ImageExtensionFactors - * + * The extension factors for full document image. */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Sets whether face image from ID card should be extracted - * - * + * Defines whether face image will be available in result. */ this.returnFaceImage = false; /** - * Sets whether full document image of ID card should be extracted. - * - * + * Defines whether full document image will be available in */ this.returnFullDocumentImage = false; diff --git a/sample_files/www/js/index.js b/sample_files/www/js/index.js index e0f340d..8a244e1 100644 --- a/sample_files/www/js/index.js +++ b/sample_files/www/js/index.js @@ -77,7 +77,7 @@ var app = { // package name/bundleID com.microblink.sample var licenseKeys = { - android: 'sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdZhZkGlTu9U3ORtDZCu0vFoxWJyF0dnv88NTiJO9pmEXPFZB9pVlO146QMSXVLAnYzACtQkatIeij7DU7ncIxLPulqRre/pOorG7HaWypuPGrotFAut0fJMJSckpf7QQC5N/97MV4Mdjk/JA6zeC83V0JqSEIMBisJRSeL4H1BqrcrDqhZpMjddPQQ+e8XVAmL2WxPsTubyqQDFvU6VSGE2nVIxbsXfpKApGRPSD7d+m46zsK6X86hMuMIu9sdtABD0AS0Bzm8HpaJZWkP51L6Ag9Dor9Iqluw0RTm+WgsQzycLBJ80iJwxryFiKOWtiPlvxQPAqn16CDT7J6h/z', + android: 'sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdZhZkGlTu9U3Potlw+N+WELcAfo3ZNjCGrjwPbX72/Lj68v4Wsf9m+5MlNQBduVAB4w8aalo+BzHOMQomzhSX//WJlF+gsu8YbPc7YiWkKgmlubu9m4LOLM6yAaUWSoHauvy6imEIN0XB9ZOLRv/lN9+3zro2jbDglRX6TXDbLNjkYIUAZfmXEBW+smfQ0606630P6TBTps2nV8Dr/ZQcQ8H18tQOsG6nzFEbJoddztEOcWCp1pzNP8wHf3W848HxYiOqjTcXoA6GxzAJKyv6U2JUFZqlkiLNWok/qY6++srGoDsh0LXCu8xVwi/2MM8/DZ3Qqa9HkHIdJ6amkeifQ==', ios: 'sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP4FpSuS/38JVOWaLMUMW+4CSRlPH5nVsy5f+xFjYutJX80GcvEyclw+SM7cjBwSazdaGilBWPcwulKICq141a1XBnYLt5nSyhDrP+PNnId8bqFT1ic1A71TubT8iroMgkbLhW7lnjNgPDyuw/2aqsS8U/pkkk8YgekN0IZm5M/0q1CSLtAehIswt5CoFtYcG1DIuGnaTvVNoRGUu7+HaVXAmxGFENiITmrOpLXFSJXFRdyBQHd3rfLgBDzIEPvTIGoGVD0ZUFFziRMkk+om4QIQE8bYHx0L8WFNbkXf5WMw2hlf3cUJmDOI04Xx1FYrTYKlbam6Q+5OsEHXjTIt5' }; From 6c7d32dbe91b688b6455eab0ccaea5b64a5af261 Mon Sep 17 00:00:00 2001 From: Matija Krizanec Date: Wed, 30 Jun 2021 13:05:56 +0200 Subject: [PATCH 2/3] [iOS] update bindings and license key for v5.12.0 --- .../Overlays/MBOverlaySerializationUtils.m | 8 +- .../MBBlinkIdCombinedRecognizerWrapper.m | 14 + BlinkID/www/blinkIdScanner.js | 485 +++++++++++++----- sample_files/www/js/index.js | 2 +- 4 files changed, 379 insertions(+), 130 deletions(-) diff --git a/BlinkID/src/ios/sources/Overlays/MBOverlaySerializationUtils.m b/BlinkID/src/ios/sources/Overlays/MBOverlaySerializationUtils.m index a4c99c2..47c4063 100644 --- a/BlinkID/src/ios/sources/Overlays/MBOverlaySerializationUtils.m +++ b/BlinkID/src/ios/sources/Overlays/MBOverlaySerializationUtils.m @@ -32,8 +32,12 @@ +(void) extractCommonOverlaySettings:(NSDictionary *)jsonOverlaySettings overlay MBBaseOverlaySettings *baseOverlaySettings = (MBBaseOverlaySettings*)overlaySettings; { id enableBeep = [jsonOverlaySettings objectForKey:@"enableBeep"]; - if (enableBeep != nil && [(NSNumber*)enableBeep boolValue]) { - baseOverlaySettings.soundFilePath = @"PPBeep.wav"; + if ([enableBeep isKindOfClass:NSNumber.class]) { + if (((NSNumber*)enableBeep).boolValue) { + baseOverlaySettings.soundFilePath = @"PPBeep.wav"; + } else { + baseOverlaySettings.soundFilePath = @""; + } } } } diff --git a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m index ced3cf0..1c7787a 100644 --- a/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m +++ b/BlinkID/src/ios/sources/Recognizers/Wrappers/MBBlinkIdCombinedRecognizerWrapper.m @@ -23,6 +23,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { recognizer.allowBlurFilter = [(NSNumber *)allowBlurFilter boolValue]; } } + { + id allowUncertainFrontSideScan = [jsonRecognizer valueForKey:@"allowUncertainFrontSideScan"]; + if (allowUncertainFrontSideScan != nil) { + recognizer.allowUncertainFrontSideScan = [(NSNumber *)allowUncertainFrontSideScan boolValue]; + } + } { id allowUnparsedMrzResults = [jsonRecognizer valueForKey:@"allowUnparsedMrzResults"]; if (allowUnparsedMrzResults != nil) { @@ -59,6 +65,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { recognizer.fullDocumentImageExtensionFactors = [MBCommonSerializationUtils deserializeMBImageExtensionFactors:(NSDictionary*)fullDocumentImageExtensionFactors]; } } + { + id maxAllowedMismatchesPerField = [jsonRecognizer valueForKey:@"maxAllowedMismatchesPerField"]; + if (maxAllowedMismatchesPerField != nil) { + recognizer.maxAllowedMismatchesPerField = [(NSNumber *)maxAllowedMismatchesPerField integerValue]; + } + } { id paddingEdge = [jsonRecognizer valueForKey:@"paddingEdge"]; if (paddingEdge != nil) { @@ -137,6 +149,7 @@ -(NSDictionary *) serializeResult { [jsonResult setValue:self.result.address forKey:@"address"]; [jsonResult setValue:[NSNumber numberWithInteger:self.result.age] forKey:@"age"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeImageAnalysisResult:self.result.backImageAnalysisResult] forKey:@"backImageAnalysisResult"]; + [jsonResult setValue:[NSNumber numberWithInteger:(self.result.backProcessingStatus + 1)] forKey:@"backProcessingStatus"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeVizResult:self.result.backVizResult] forKey:@"backVizResult"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeBarcodeResult:self.result.barcodeResult] forKey:@"barcodeResult"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeClassInfo:self.result.classInfo] forKey:@"classInfo"]; @@ -156,6 +169,7 @@ -(NSDictionary *) serializeResult { [jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.faceImage] forKey:@"faceImage"]; [jsonResult setValue:self.result.firstName forKey:@"firstName"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeImageAnalysisResult:self.result.frontImageAnalysisResult] forKey:@"frontImageAnalysisResult"]; + [jsonResult setValue:[NSNumber numberWithInteger:(self.result.frontProcessingStatus + 1)] forKey:@"frontProcessingStatus"]; [jsonResult setValue:[MBBlinkIDSerializationUtils serializeVizResult:self.result.frontVizResult] forKey:@"frontVizResult"]; [jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.fullDocumentBackImage] forKey:@"fullDocumentBackImage"]; [jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.fullDocumentFrontImage] forKey:@"fullDocumentFrontImage"]; diff --git a/BlinkID/www/blinkIdScanner.js b/BlinkID/www/blinkIdScanner.js index 4cc0099..1616eb2 100644 --- a/BlinkID/www/blinkIdScanner.js +++ b/BlinkID/www/blinkIdScanner.js @@ -2363,7 +2363,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional name information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -2379,11 +2379,13 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference + * between now and date of birth. Now is current time on the device. + * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * Image analysis result for the scanned document back side image + * Defines possible color and moire statuses determined from scanned back image. */ this.backImageAnalysisResult = nativeResult.backImageAnalysisResult; @@ -2393,17 +2395,17 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.backProcessingStatus = nativeResult.backProcessingStatus; /** - * The data extracted from the back side visual inspection zone. + * Defines the data extracted from the back side visual inspection zone. */ this.backVizResult = nativeResult.backVizResult; /** - * The data extracted from the barcode. + * Defines the data extracted from the barcode. */ this.barcodeResult = nativeResult.barcodeResult; /** - * The document class information. + * The classification information. */ this.classInfo = nativeResult.classInfo; @@ -2428,12 +2430,12 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.dateOfIssue = nativeResult.dateOfIssue != null ? new Date(nativeResult.dateOfIssue) : null; /** - * Defines digital signature of recognition results. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Defines digital signature version. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; @@ -2443,7 +2445,10 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.documentAdditionalNumber = nativeResult.documentAdditionalNumber; /** - * Defines result of the data matching algorithm for scanned parts/sides of the document. + * 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. */ this.documentDataMatch = nativeResult.documentDataMatch; @@ -2469,11 +2474,17 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current + * time on the device with the date of expiry. + * + * @return true if the document has expired, false in following cases: + * document does not expire (date of expiry is permanent) + * date of expiry has passed + * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -2483,7 +2494,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * Image analysis result for the scanned document front side image + * Defines possible color and moire statuses determined from scanned front image. */ this.frontImageAnalysisResult = nativeResult.frontImageAnalysisResult; @@ -2493,17 +2504,17 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.frontProcessingStatus = nativeResult.frontProcessingStatus; /** - * The data extracted from the front side visual inspection zone. + * Defines the data extracted from the front side visual inspection zone. */ this.frontVizResult = nativeResult.frontVizResult; /** - * Back side image of the document + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * Front side image of the document + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; @@ -2533,7 +2544,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; @@ -2553,7 +2564,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.placeOfBirth = nativeResult.placeOfBirth; /** - * Status of the last recognition process. + * Defines status of the last recognition process. */ this.processingStatus = nativeResult.processingStatus; @@ -2583,7 +2594,8 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.residentialStatus = nativeResult.residentialStatus; /** - * {true} if recognizer has finished scanning first side and is now scanning back side, + * Returns true if recognizer has finished scanning first side and is now scanning back side, + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -2593,7 +2605,7 @@ function BlinkIdCombinedRecognizerResult(nativeResult) { this.sex = nativeResult.sex; /** - * Signature image from the document + * image of the signature if enabled with returnSignatureImage property. */ this.signatureImage = nativeResult.signatureImage; @@ -2604,103 +2616,152 @@ BlinkIdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResul BlinkID.prototype.BlinkIdCombinedRecognizerResult = BlinkIdCombinedRecognizerResult; /** - * A generic recognizer which can scan front and back side of the document. + * Recognizer which can scan front and back side of the United States driver license. */ function BlinkIdCombinedRecognizer() { Recognizer.call(this, 'BlinkIdCombinedRecognizer'); /** - * Defines whether blured frames filtering is allowed. + * Defines whether blured frames filtering is allowed + * + * */ this.allowBlurFilter = true; /** * Proceed with scanning the back side even if the front side result is uncertain. + * This only works for still images - video feeds will ignore this setting. + * + * */ this.allowUncertainFrontSideScan = false; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed + * + * */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed + * Unverified MRZ is parsed, but check digits are incorrect + * + * */ this.allowUnverifiedMrzResults = true; /** - * Whether sensitive data should be removed from images, result fields or both. + * Defines whether sensitive data should be removed from images, result fields or both. + * The setting only applies to certain documents + * + * */ this.anonymizationMode = AnonymizationMode.FullResult; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** * Configure the number of characters per field that are allowed to be inconsistent in data match. + * + * */ this.maxAllowedMismatchesPerField = 0; /** - * Padding is a minimum distance from the edge of the frame and it is defined + * Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case + * padding edge and image edge are the same. + * Recommended value is 0.02f. + * + * */ this.paddingEdge = 0.0; /** - * Currently set recognition mode filter. + * Enable or disable recognition of specific document groups supported by the current license. + * + * */ this.recognitionModeFilter = new RecognitionModeFilter(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether signature image will be available in result. + * Sets whether signature image from ID card should be extracted. + * + * */ this.returnSignatureImage = false; /** * Configure the recognizer to only work on already cropped and dewarped images. + * This only works for still images - video feeds will ignore this setting. + * + * */ this.scanCroppedDocumentImage = false; /** - * Defines whether or not recognition result should be signed. + * Whether or not recognition result should be signed. + * + * */ this.signResult = false; /** - * The DPI (Dots Per Inch) for signature image that should be returned. + * Property for setting DPI for signature images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.signatureImageDpi = 250; /** - * Skip back side capture and processing step when back side of the document is not supported. + * Skip back side capture and processing step when back side of the document is not supported + * + * */ this.skipUnsupportedBack = false; /** - * Whether result characters validatation is performed. + * Defines whether result characters validatation is performed. + * If a result member contains invalid character, the result state cannot be valid + * + * */ this.validateResultCharacters = true; @@ -2719,7 +2780,7 @@ function BlinkIdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The additional name information of the document owner. + * The additional address information of the document owner. */ this.additionalAddressInformation = nativeResult.additionalAddressInformation; @@ -2735,16 +2796,18 @@ function BlinkIdRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference + * between now and date of birth. Now is current time on the device. + * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * The data extracted from the barcode. + * Defines the data extracted from the barcode. */ this.barcodeResult = nativeResult.barcodeResult; /** - * The document class information. + * The classification information. */ this.classInfo = nativeResult.classInfo; @@ -2795,11 +2858,17 @@ function BlinkIdRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current + * time on the device with the date of expiry. + * + * @return true if the document has expired, false in following cases: + * document does not expire (date of expiry is permanent) + * date of expiry has passed + * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; @@ -2809,7 +2878,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.firstName = nativeResult.firstName; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -2819,7 +2888,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.fullName = nativeResult.fullName; /** - * Image analysis result for the scanned document image + * Defines possible color and moire statuses determined from scanned image. */ this.imageAnalysisResult = nativeResult.imageAnalysisResult; @@ -2844,7 +2913,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; @@ -2864,7 +2933,7 @@ function BlinkIdRecognizerResult(nativeResult) { this.placeOfBirth = nativeResult.placeOfBirth; /** - * Status of the last recognition process. + * Defines status of the last recognition process. */ this.processingStatus = nativeResult.processingStatus; @@ -2899,12 +2968,12 @@ function BlinkIdRecognizerResult(nativeResult) { this.sex = nativeResult.sex; /** - * Signature image from the document + * image of the signature if enabled with returnSignatureImage property. */ this.signatureImage = nativeResult.signatureImage; /** - * The data extracted from the visual inspection zone. + * Defines the data extracted from the visual inspection zone */ this.vizResult = nativeResult.vizResult; @@ -2915,83 +2984,123 @@ BlinkIdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.e BlinkID.prototype.BlinkIdRecognizerResult = BlinkIdRecognizerResult; /** - * Generic BlinkID recognizer. + * The Blink ID Recognizer is used for scanning Blink ID. */ function BlinkIdRecognizer() { Recognizer.call(this, 'BlinkIdRecognizer'); /** - * Defines whether blured frames filtering is allowed" + * Defines whether blured frames filtering is allowed + * + * */ this.allowBlurFilter = true; /** - * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed + * + * */ this.allowUnparsedMrzResults = false; /** - * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed. + * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed + * Unverified MRZ is parsed, but check digits are incorrect + * + * */ this.allowUnverifiedMrzResults = true; /** - * Whether sensitive data should be removed from images, result fields or both. + * Defines whether sensitive data should be removed from images, result fields or both. + * The setting only applies to certain documents + * + * */ this.anonymizationMode = AnonymizationMode.FullResult; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Padding is a minimum distance from the edge of the frame and it is defined + * Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case + * padding edge and image edge are the same. + * Recommended value is 0.02f. + * + * */ this.paddingEdge = 0.0; /** - * Currently set recognition mode filter. + * Enable or disable recognition of specific document groups supported by the current license. + * + * */ this.recognitionModeFilter = new RecognitionModeFilter(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether signature image will be available in result. + * Sets whether signature image from ID card should be extracted. + * + * */ this.returnSignatureImage = false; /** * Configure the recognizer to only work on already cropped and dewarped images. + * This only works for still images - video feeds will ignore this setting. + * + * */ this.scanCroppedDocumentImage = false; /** - * The DPI (Dots Per Inch) for signature image that should be returned. + * Property for setting DPI for signature images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.signatureImageDpi = 250; /** - * Whether result characters validatation is performed. + * Defines whether result characters validatation is performed. + * If a result member contains invalid character, the result state cannot be valid + * + * */ this.validateResultCharacters = true; @@ -3010,22 +3119,22 @@ function DocumentFaceRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * The location of document detection in coordinate system of full input frame. + * 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 + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * The location of face detection in coordinate system of cropped full document image. + * Quadrangle represeting corner points of the face image within the input image. */ this.faceLocation = nativeResult.faceLocation != null ? new Quadrilateral(nativeResult.faceLocation) : null; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3036,43 +3145,65 @@ DocumentFaceRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.DocumentFaceRecognizerResult = DocumentFaceRecognizerResult; /** - * Recognizer for detecting holder's photo on documents containing image. + * Class for configuring Document Face Recognizer Recognizer. + * + * Document Face Recognizer recognizer is used for scanning documents containing face images. */ function DocumentFaceRecognizer() { Recognizer.call(this, 'DocumentFaceRecognizer'); /** - * Currently used detector type. + * Type of docment this recognizer will scan. + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Minimum number of stable detections required for detection to be successful. + * 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; /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -3102,11 +3233,15 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * The current age of the document owner in years. It is calculated difference + * between now and date of birth. Now is current time on the device. + * @return current age of the document owner in years or -1 if date of birth is unknown. */ this.age = nativeResult.age; /** - * The format of the scanned barcode. + * Type of the barcode scanned + * + * @return Type of the barcode */ this.barcodeType = nativeResult.barcodeType; @@ -3142,6 +3277,8 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * The document type deduced from the recognized barcode + * + * @return Type of the document */ this.documentType = nativeResult.documentType; @@ -3157,11 +3294,19 @@ function IdBarcodeRecognizerResult(nativeResult) { /** * Checks whether the document has expired or not by comparing the current + * time on the device with the date of expiry. + * + * @return true if the document has expired, false in following cases: + * document does not expire (date of expiry is permanent) + * date of expiry has passed + * date of expiry is unknown and it is not permanent */ this.expired = nativeResult.expired; /** * Document specific extended elements that contain all barcode fields in their original form. + * + * Currently this is only filled for AAMVACompliant documents. */ this.extendedElements = nativeResult.extendedElements; @@ -3231,7 +3376,7 @@ function IdBarcodeRecognizerResult(nativeResult) { this.race = nativeResult.race; /** - * The raw bytes contained inside barcode. + * Byte array with result of the scan */ this.rawData = nativeResult.rawData; @@ -3241,7 +3386,7 @@ function IdBarcodeRecognizerResult(nativeResult) { this.religion = nativeResult.religion; /** - * The residential status of the document owner. + * The residential stauts of the document owner. */ this.residentialStatus = nativeResult.residentialStatus; @@ -3261,12 +3406,13 @@ function IdBarcodeRecognizerResult(nativeResult) { this.street = nativeResult.street; /** - * String representation of data inside barcode. + * Retrieves string content of scanned data */ this.stringData = nativeResult.stringData; /** - * True if returned result is uncertain, i.e. if scanned barcode was incomplete (i.e. + * Flag indicating uncertain scanning data + * E.g obtained from damaged barcode. */ this.uncertain = nativeResult.uncertain; @@ -3302,42 +3448,46 @@ function MrtdCombinedRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Defines digital signature of recognition results. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Defines digital signature version. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * Defines result of the data matching algorithm for scanned parts/sides of the document. + * 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. */ this.documentDataMatch = nativeResult.documentDataMatch; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Back side image of the document + * back side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentBackImage = nativeResult.fullDocumentBackImage; /** - * Front side image of the document + * front side image of the document if enabled with returnFullDocumentImage property. */ this.fullDocumentFrontImage = nativeResult.fullDocumentFrontImage; /** - * 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; /** - * {true} if recognizer has finished scanning first side and is now scanning back side, + * Returns true if recognizer has finished scanning first side and is now scanning back side, + * false if it's still scanning first side. */ this.scanningFirstSideDone = nativeResult.scanningFirstSideDone; @@ -3348,64 +3498,94 @@ MrtdCombinedRecognizerResult.prototype = new RecognizerResult(RecognizerResultSt BlinkID.prototype.MrtdCombinedRecognizerResult = MrtdCombinedRecognizerResult; /** - * Recognizer for combined reading of face from front side of documents and MRZ from back side of - * * Machine Readable Travel Document. + * MRTD Combined recognizer + * + * MRTD Combined recognizer is used for scanning both front and back side of generic IDs. */ function MrtdCombinedRecognizer() { Recognizer.call(this, 'MrtdCombinedRecognizer'); /** - * Whether special characters are allowed. + * Whether special characters are allowed + * + * */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed. + * Whether returning of unparsed results is allowed + * + * */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed. + * Whether returning of unverified results is allowed + * Unverified result is result that is parsed, but check digits are incorrect. + * + * */ this.allowUnverifiedResults = false; /** - * Currently used detector type. + * Type of document this recognizer will scan. + * + * */ this.detectorType = DocumentFaceDetectorType.TD1; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Minimum number of stable detections required for detection to be successful. + * 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; /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether or not recognition result should be signed. + * Whether or not recognition result should be signed. + * + * */ this.signResult = false; @@ -3424,12 +3604,12 @@ function MrtdRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; /** - * 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; @@ -3440,43 +3620,60 @@ MrtdRecognizerResult.prototype = new RecognizerResult(RecognizerResultState.empt BlinkID.prototype.MrtdRecognizerResult = MrtdRecognizerResult; /** - * Recognizer that can recognize Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) + * Recognizer that can recognizer Machine Readable Zone (MRZ) of the Machine Readable Travel Document (MRTD) */ function MrtdRecognizer() { Recognizer.call(this, 'MrtdRecognizer'); /** - * Whether special characters are allowed. + * Whether special characters are allowed + * + * */ this.allowSpecialCharacters = false; /** - * Whether returning of unparsed results is allowed. + * Whether returning of unparsed results is allowed + * + * */ this.allowUnparsedResults = false; /** - * Whether returning of unverified results is allowed. + * Whether returning of unverified results is allowed + * Unverified result is result that is parsed, but check digits are incorrect. + * + * */ this.allowUnverifiedResults = false; /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; @@ -3495,22 +3692,22 @@ function PassportRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Defines digital signature of recognition results. + * Digital signature of the recognition result. Available only if enabled with signResult property. */ this.digitalSignature = nativeResult.digitalSignature; /** - * Defines digital signature version. + * Version of the digital signature. Available only if enabled with signResult property. */ this.digitalSignatureVersion = nativeResult.digitalSignatureVersion; /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3532,42 +3729,61 @@ function PassportRecognizer() { Recognizer.call(this, 'PassportRecognizer'); /** - * Defines whether the Netherlands MRZ should be anonymized. + * Defines whether to anonymize Netherlands MRZ + * + * */ this.anonymizeNetherlandsMrz = true; /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; /** - * Defines whether or not recognition result should be signed. + * Whether or not recognition result should be signed. + * + * */ this.signResult = false; @@ -3586,12 +3802,12 @@ function VisaRecognizerResult(nativeResult) { RecognizerResult.call(this, nativeResult.resultState); /** - * Face image from the document + * face image from the document if enabled with returnFaceImage property. */ this.faceImage = nativeResult.faceImage; /** - * Image of the full document + * full document image if enabled with returnFullDocumentImage property. */ this.fullDocumentImage = nativeResult.fullDocumentImage; @@ -3613,32 +3829,47 @@ function VisaRecognizer() { Recognizer.call(this, 'VisaRecognizer'); /** - * Defines whether glare detector is enabled. + * Defines if glare detection should be turned on/off. + * + * */ this.detectGlare = true; /** - * The DPI (Dots Per Inch) for face image that should be returned. + * Property for setting DPI for face images + * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception + * + * */ this.faceImageDpi = 250; /** - * The DPI (Dots Per Inch) for full document image that should be returned. + * 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; /** - * The extension factors for full document image. + * Image extension factors for full document image. + * + * @see ImageExtensionFactors + * */ this.fullDocumentImageExtensionFactors = new ImageExtensionFactors(); /** - * Defines whether face image will be available in result. + * Sets whether face image from ID card should be extracted + * + * */ this.returnFaceImage = false; /** - * Defines whether full document image will be available in + * Sets whether full document image of ID card should be extracted. + * + * */ this.returnFullDocumentImage = false; diff --git a/sample_files/www/js/index.js b/sample_files/www/js/index.js index 8a244e1..2c435a1 100644 --- a/sample_files/www/js/index.js +++ b/sample_files/www/js/index.js @@ -78,7 +78,7 @@ var app = { // package name/bundleID com.microblink.sample var licenseKeys = { android: 'sRwAAAAVY29tLm1pY3JvYmxpbmsuc2FtcGxlU9kJdZhZkGlTu9U3Potlw+N+WELcAfo3ZNjCGrjwPbX72/Lj68v4Wsf9m+5MlNQBduVAB4w8aalo+BzHOMQomzhSX//WJlF+gsu8YbPc7YiWkKgmlubu9m4LOLM6yAaUWSoHauvy6imEIN0XB9ZOLRv/lN9+3zro2jbDglRX6TXDbLNjkYIUAZfmXEBW+smfQ0606630P6TBTps2nV8Dr/ZQcQ8H18tQOsG6nzFEbJoddztEOcWCp1pzNP8wHf3W848HxYiOqjTcXoA6GxzAJKyv6U2JUFZqlkiLNWok/qY6++srGoDsh0LXCu8xVwi/2MM8/DZ3Qqa9HkHIdJ6amkeifQ==', - ios: 'sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP4FpSuS/38JVOWaLMUMW+4CSRlPH5nVsy5f+xFjYutJX80GcvEyclw+SM7cjBwSazdaGilBWPcwulKICq141a1XBnYLt5nSyhDrP+PNnId8bqFT1ic1A71TubT8iroMgkbLhW7lnjNgPDyuw/2aqsS8U/pkkk8YgekN0IZm5M/0q1CSLtAehIswt5CoFtYcG1DIuGnaTvVNoRGUu7+HaVXAmxGFENiITmrOpLXFSJXFRdyBQHd3rfLgBDzIEPvTIGoGVD0ZUFFziRMkk+om4QIQE8bYHx0L8WFNbkXf5WMw2hlf3cUJmDOI04Xx1FYrTYKlbam6Q+5OsEHXjTIt5' + ios: 'sRwAAAEVY29tLm1pY3JvYmxpbmsuc2FtcGxl1BIcP4FpSuS/38JVPpankFQ/Bcr7WvDAxkCq8h6GBBsKnan7jmJz5oRDF0VOwEv8zcz2tsAexgAWBzhWNxEvz2I2UYi7CSHjlbw0ppsdoL5WCQPrg6i+aiCRIxht1V8ObYlBvqTi69Pk0HXXwmpcIt7r01khjOlXdS7Mdn89IcW2R6bcYVIjID87iTpDG+SNFZ6ITQQsyv/c7VfkyEQ/2zl2J0Yln6a1OYGNCIDhfZjlTxK4H8ovNrrwvgR66jsKv0WBx2LLajjYOVdsMLueajw8caSpUlRtSpzCMAQB3FgD5OYEhDugRChfESwa4C8tAv7h9QUzU8TMpJeg7paXnee6MA==' }; function buildResult(result, key) { From 15aa3dda2df2b5e444f5908ef9d7b6d977302ced Mon Sep 17 00:00:00 2001 From: Matija Krizanec Date: Wed, 30 Jun 2021 13:15:10 +0200 Subject: [PATCH 3/3] update version and release notes for v5.12.0 --- BlinkID/package.json | 2 +- BlinkID/plugin.xml | 2 +- BlinkID/scripts/initIOSFramework.sh | 2 +- Release notes.md | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BlinkID/package.json b/BlinkID/package.json index f63573e..300767e 100644 --- a/BlinkID/package.json +++ b/BlinkID/package.json @@ -1,6 +1,6 @@ { "name": "blinkid-cordova", - "version": "5.11.0", + "version": "5.12.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 cf9461b..1b28fd4 100644 --- a/BlinkID/plugin.xml +++ b/BlinkID/plugin.xml @@ -2,7 +2,7 @@ + version="5.12.0"> BlinkIdScanner A small and powerful ID card scanning library diff --git a/BlinkID/scripts/initIOSFramework.sh b/BlinkID/scripts/initIOSFramework.sh index 6f84358..9cca877 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.11.0/Microblink.xcframework.zip' +LINK='https://github.com/BlinkID/blinkid-ios/releases/download/v5.12.0/Microblink.xcframework.zip' FILENAME='Microblink.xcframework.zip' # check if Microblink framework and bundle already exist diff --git a/Release notes.md b/Release notes.md index 2526cda..b7f59d8 100644 --- a/Release notes.md +++ b/Release notes.md @@ -1,3 +1,6 @@ +## 5.12.0 +- Updated to [Android SDK v5.12.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.12.0) and [iOS SDK v5.12.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.12.0) + ## 5.11.0 - Updated to [Android SDK v5.11.0](https://github.com/BlinkID/blinkid-android/releases/tag/v5.11.0) and [iOS SDK v5.11.0](https://github.com/BlinkID/blinkid-ios/releases/tag/v5.11.0)