Skip to content

Commit

Permalink
Merge pull request #72 from BlinkID/release/6.10
Browse files Browse the repository at this point in the history
Release/6.10
  • Loading branch information
mparadina authored Sep 13, 2024
2 parents 5b63ede + 77a9319 commit 6309c6e
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 19 deletions.
2 changes: 1 addition & 1 deletion BlinkID/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
}

dependencies {
implementation('com.microblink:blinkid:6.9.0@aar') {
implementation('com.microblink:blinkid:6.10.0@aar') {
transitive = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,14 @@ public static JSONObject serializeAdditionalProcessingInfo(AdditionalProcessingI
for (int i = 0; i < additionalProcessingInfo.getExtraPresentFields().length; ++i) {
extraPresentFieldsArr.put(SerializationUtils.serializeEnum(additionalProcessingInfo.getExtraPresentFields()[i]));
}
JSONArray imageExtractionFailuresArr = new JSONArray();
for (int i = 0; i < additionalProcessingInfo.getImageExtractionFailures().length; ++i) {
imageExtractionFailuresArr.put(SerializationUtils.serializeEnum(additionalProcessingInfo.getImageExtractionFailures()[i]));
}
jsonAdditionalProcessingInfo.put("missingMandatoryFields", missingMandatoryFieldsArr);
jsonAdditionalProcessingInfo.put("invalidCharacterFields", invalidCharacterFieldsArr);
jsonAdditionalProcessingInfo.put("extraPresentFields", extraPresentFieldsArr);
jsonAdditionalProcessingInfo.put("imageExtractionFailures", imageExtractionFailuresArr);
return jsonAdditionalProcessingInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ public final class BlinkIdMultiSideRecognizerSerialization implements Recognizer
public Recognizer<?> createRecognizer(JSONObject jsonObject) {
com.microblink.blinkid.entities.recognizers.blinkid.generic.BlinkIdMultiSideRecognizer recognizer = new com.microblink.blinkid.entities.recognizers.blinkid.generic.BlinkIdMultiSideRecognizer();
recognizer.setAdditionalAnonymization(BlinkIDSerializationUtils.deserializeClassAnonymizationSettings(jsonObject.optJSONArray("additionalAnonymization")));
recognizer.setAllowBarcodeScanOnly(jsonObject.optBoolean("allowBarcodeScanOnly", false));
recognizer.setAllowUncertainFrontSideScan(jsonObject.optBoolean("allowUncertainFrontSideScan", false));
recognizer.setAllowUnparsedMrzResults(jsonObject.optBoolean("allowUnparsedMrzResults", false));
recognizer.setAllowUnverifiedMrzResults(jsonObject.optBoolean("allowUnverifiedMrzResults", true));
recognizer.setAnonymizationMode(com.microblink.blinkid.entities.recognizers.blinkid.generic.AnonymizationMode.values()[jsonObject.optInt("anonymizationMode", 3)]);
recognizer.setBlurStrictnessLevel(com.microblink.blinkid.entities.recognizers.blinkid.generic.imageanalysis.StrictnessLevel.values()[jsonObject.optInt("blurStrictnessLevel", 1)]);
recognizer.setCombineFrameResults(jsonObject.optBoolean("combineFrameResults", true));
recognizer.setCustomClassRules(BlinkIDSerializationUtils.deserializeCustomClassRules(jsonObject.optJSONArray("customClassRules")));
recognizer.setEnableBlurFilter(jsonObject.optBoolean("enableBlurFilter", true));
recognizer.setEnableGlareFilter(jsonObject.optBoolean("enableGlareFilter", true));
Expand Down Expand Up @@ -57,6 +59,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("backVizResult", BlinkIDSerializationUtils.serializeVizResult(result.getBackVizResult()));
jsonResult.put("barcodeCameraFrame", SerializationUtils.encodeImageBase64(result.getBarcodeCameraFrame()));
jsonResult.put("barcodeResult", BlinkIDSerializationUtils.serializeBarcodeResult(result.getBarcodeResult()));
jsonResult.put("barcodeStepUsed", result.isBarcodeStepUsed());
jsonResult.put("bloodType", BlinkIDSerializationUtils.serializeStringResult(result.getBloodType()));
jsonResult.put("classInfo", BlinkIDSerializationUtils.serializeClassInfo(result.getClassInfo()));
jsonResult.put("dataMatch", BlinkIDSerializationUtils.serializeDataMatchResult(result.getDataMatch()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ public final class BlinkIdSingleSideRecognizerSerialization implements Recognize
public Recognizer<?> createRecognizer(JSONObject jsonObject) {
com.microblink.blinkid.entities.recognizers.blinkid.generic.BlinkIdSingleSideRecognizer recognizer = new com.microblink.blinkid.entities.recognizers.blinkid.generic.BlinkIdSingleSideRecognizer();
recognizer.setAdditionalAnonymization(BlinkIDSerializationUtils.deserializeClassAnonymizationSettings(jsonObject.optJSONArray("additionalAnonymization")));
recognizer.setAllowBarcodeScanOnly(jsonObject.optBoolean("allowBarcodeScanOnly", false));
recognizer.setAllowUnparsedMrzResults(jsonObject.optBoolean("allowUnparsedMrzResults", false));
recognizer.setAllowUnverifiedMrzResults(jsonObject.optBoolean("allowUnverifiedMrzResults", true));
recognizer.setAnonymizationMode(com.microblink.blinkid.entities.recognizers.blinkid.generic.AnonymizationMode.values()[jsonObject.optInt("anonymizationMode", 3)]);
recognizer.setBlurStrictnessLevel(com.microblink.blinkid.entities.recognizers.blinkid.generic.imageanalysis.StrictnessLevel.values()[jsonObject.optInt("blurStrictnessLevel", 1)]);
recognizer.setCombineFrameResults(jsonObject.optBoolean("combineFrameResults", true));
recognizer.setCustomClassRules(BlinkIDSerializationUtils.deserializeCustomClassRules(jsonObject.optJSONArray("customClassRules")));
recognizer.setEnableBlurFilter(jsonObject.optBoolean("enableBlurFilter", true));
recognizer.setEnableGlareFilter(jsonObject.optBoolean("enableGlareFilter", true));
Expand Down Expand Up @@ -50,6 +52,7 @@ public JSONObject serializeResult(Recognizer<?> recognizer) {
jsonResult.put("age", result.getAge());
jsonResult.put("barcodeCameraFrame", SerializationUtils.encodeImageBase64(result.getBarcodeCameraFrame()));
jsonResult.put("barcodeResult", BlinkIDSerializationUtils.serializeBarcodeResult(result.getBarcodeResult()));
jsonResult.put("barcodeStepUsed", result.isBarcodeStepUsed());
jsonResult.put("bloodType", BlinkIDSerializationUtils.serializeStringResult(result.getBloodType()));
jsonResult.put("cameraFrame", SerializationUtils.encodeImageBase64(result.getCameraFrame()));
jsonResult.put("classInfo", BlinkIDSerializationUtils.serializeClassInfo(result.getClassInfo()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ +(NSDictionary *)serializeAdditionalProcessingInfo:(MBAdditionalProcessingInfo *
return @{
@"missingMandatoryFields": additionalProcessingInfo.missingMandatoryFields,
@"invalidCharacterFields" : additionalProcessingInfo.invalidCharacterFields,
@"extraPresentFields": additionalProcessingInfo.extraPresentFields
@"extraPresentFields": additionalProcessingInfo.extraPresentFields,
@"imageExtractionFailures": additionalProcessingInfo.imageExtractionFailures
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
}
}
}
{
id allowBarcodeScanOnly = [jsonRecognizer valueForKey:@"allowBarcodeScanOnly"];
if (allowBarcodeScanOnly != nil) {
recognizer.allowBarcodeScanOnly = [(NSNumber *)allowBarcodeScanOnly boolValue];
}
}
{
id allowUncertainFrontSideScan = [jsonRecognizer valueForKey:@"allowUncertainFrontSideScan"];
if (allowUncertainFrontSideScan != nil) {
Expand Down Expand Up @@ -57,6 +63,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
recognizer.blurStrictnessLevel = [(NSNumber *)blurStrictnessLevel unsignedIntegerValue];
}
}
{
id combineFrameResults = [jsonRecognizer valueForKey:@"combineFrameResults"];
if (combineFrameResults != nil) {
recognizer.combineFrameResults = [(NSNumber *)combineFrameResults boolValue];
}
}
{
id customClassRules = [jsonRecognizer valueForKey:@"customClassRules"];
if (customClassRules != nil) {
Expand Down Expand Up @@ -194,6 +206,7 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeVizResult:self.result.backVizResult] forKey:@"backVizResult"];
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.barcodeCameraFrame] forKey:@"barcodeCameraFrame"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeBarcodeResult:self.result.barcodeResult] forKey:@"barcodeResult"];
[jsonResult setValue:[NSNumber numberWithBool:self.result.barcodeStepUsed] forKey:@"barcodeStepUsed"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.bloodType] forKey:@"bloodType"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeClassInfo:self.result.classInfo] forKey:@"classInfo"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeDataMatchResult:self.result.dataMatchResult] forKey:@"dataMatch"];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
}
}
}
{
id allowBarcodeScanOnly = [jsonRecognizer valueForKey:@"allowBarcodeScanOnly"];
if (allowBarcodeScanOnly != nil) {
recognizer.allowBarcodeScanOnly = [(NSNumber *)allowBarcodeScanOnly boolValue];
}
}
{
id allowUnparsedMrzResults = [jsonRecognizer valueForKey:@"allowUnparsedMrzResults"];
if (allowUnparsedMrzResults != nil) {
Expand All @@ -51,6 +57,12 @@ -(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer {
recognizer.blurStrictnessLevel = [(NSNumber *)blurStrictnessLevel unsignedIntegerValue];
}
}
{
id combineFrameResults = [jsonRecognizer valueForKey:@"combineFrameResults"];
if (combineFrameResults != nil) {
recognizer.combineFrameResults = [(NSNumber *)combineFrameResults boolValue];
}
}
{
id customClassRules = [jsonRecognizer valueForKey:@"customClassRules"];
if (customClassRules != nil) {
Expand Down Expand Up @@ -172,6 +184,7 @@ -(NSDictionary *) serializeResult {
[jsonResult setValue:[NSNumber numberWithInteger:self.result.age] forKey:@"age"];
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.barcodeCameraFrame] forKey:@"barcodeCameraFrame"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeBarcodeResult:self.result.barcodeResult] forKey:@"barcodeResult"];
[jsonResult setValue:[NSNumber numberWithBool:self.result.barcodeStepUsed] forKey:@"barcodeStepUsed"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMBStringResult:self.result.bloodType] forKey:@"bloodType"];
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.cameraFrame] forKey:@"cameraFrame"];
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeClassInfo:self.result.classInfo] forKey:@"classInfo"];
Expand Down
4 changes: 2 additions & 2 deletions BlinkID/ios/blinkid_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'blinkid_flutter'
s.version = '6.9.0'
s.version = '6.10.0'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
Expand All @@ -18,7 +18,7 @@ A new flutter plugin project.
s.dependency 'Flutter'
s.platform = :ios, '13.0'

s.dependency 'PPBlinkID', '~> 6.9.0'
s.dependency 'PPBlinkID', '~> 6.10.1'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
27 changes: 27 additions & 0 deletions BlinkID/lib/recognizers/blink_id_multi_side_recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ class BlinkIdMultiSideRecognizerResult extends RecognizerResult {
///Defines the data extracted from the barcode.
BarcodeResult? barcodeResult;

///This member indicates whether the barcode scanning step was utilized during the
/// process.
/// If the barcode scanning step was executed: a parsable barcode image will be stored in the
/// `barcodeCameraFrame`.
/// If the barcode scanning step was not executed: a parsable barcode image will be stored in the
/// `fullDocumentImage`.
bool? barcodeStepUsed;

///The blood type of the document owner.
StringResult? bloodType;

Expand Down Expand Up @@ -231,6 +239,8 @@ class BlinkIdMultiSideRecognizerResult extends RecognizerResult {

this.barcodeResult = nativeResult["barcodeResult"] != null ? BarcodeResult(Map<String, dynamic>.from(nativeResult["barcodeResult"])) : null;

this.barcodeStepUsed = nativeResult["barcodeStepUsed"];

this.bloodType = nativeResult["bloodType"] != null ? StringResult(Map<String, dynamic>.from(nativeResult["bloodType"])) : null;

this.classInfo = nativeResult["classInfo"] != null ? ClassInfo(Map<String, dynamic>.from(nativeResult["classInfo"])) : null;
Expand Down Expand Up @@ -343,6 +353,15 @@ class BlinkIdMultiSideRecognizer extends Recognizer {
List<ClassAnonymizationSettings> additionalAnonymization = [];

///Allows barcode recognition to proceed even if the initial extraction fails.
/// This only works for still images - video feeds will ignore this setting.
/// If the barcode recognition is successful, the recognizer will still end in a valid state.
/// This setting is applicable only to photo frames. For multi-side recognizers, it is permitted only for the back side.
///
///
bool allowBarcodeScanOnly = false;

///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.
///
Expand Down Expand Up @@ -376,6 +395,14 @@ class BlinkIdMultiSideRecognizer extends Recognizer {
StrictnessLevel blurStrictnessLevel = StrictnessLevel.Normal;

///Enables the aggregation of data from multiple frames.
/// Disabling this setting will yield higher-quality captured images, but it may slow down the scanning process due to the additional effort required to find the optimal frame.
/// Enabling this setting will simplify the extraction process, but the extracted data will be aggregated from multiple frames instead of being sourced from a single frame.
///
///
bool combineFrameResults = true;

///Get custom class rules.
List<CustomClassRules> customClassRules = [];
Expand Down
4 changes: 4 additions & 0 deletions BlinkID/lib/recognizers/blink_id_multi_side_recognizer.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions BlinkID/lib/recognizers/blink_id_single_side_recognizer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class BlinkIdSingleSideRecognizerResult extends RecognizerResult {
///Defines the data extracted from the barcode.
BarcodeResult? barcodeResult;

///This member indicates whether the barcode scanning step was utilized during the
/// process.
/// If the barcode scanning step was executed: a parsable barcode image will be stored in the
/// `barcodeCameraFrame`.
/// If the barcode scanning step was not executed: a parsable barcode image will be stored in the
/// `fullDocumentImage`.
bool? barcodeStepUsed;

///The blood type of the document owner.
StringResult? bloodType;

Expand Down Expand Up @@ -189,6 +197,8 @@ class BlinkIdSingleSideRecognizerResult extends RecognizerResult {

this.barcodeResult = nativeResult["barcodeResult"] != null ? BarcodeResult(Map<String, dynamic>.from(nativeResult["barcodeResult"])) : null;

this.barcodeStepUsed = nativeResult["barcodeStepUsed"];

this.bloodType = nativeResult["bloodType"] != null ? StringResult(Map<String, dynamic>.from(nativeResult["bloodType"])) : null;

this.cameraFrame = nativeResult["cameraFrame"];
Expand Down Expand Up @@ -289,6 +299,15 @@ class BlinkIdSingleSideRecognizer extends Recognizer {
List<ClassAnonymizationSettings> additionalAnonymization = [];

///Allows barcode recognition to proceed even if the initial extraction fails.
/// This only works for still images - video feeds will ignore this setting.
/// If the barcode recognition is successful, the recognizer will still end in a valid state.
/// This setting is applicable only to photo frames. For multi-side recognizers, it is permitted only for the back side.
///
///
bool allowBarcodeScanOnly = false;

///Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed
///
///
Expand All @@ -315,6 +334,14 @@ class BlinkIdSingleSideRecognizer extends Recognizer {
StrictnessLevel blurStrictnessLevel = StrictnessLevel.Normal;

///Enables the aggregation of data from multiple frames.
/// Disabling this setting will yield higher-quality captured images, but it may slow down the scanning process due to the additional effort required to find the optimal frame.
/// Enabling this setting will simplify the extraction process, but the extracted data will be aggregated from multiple frames instead of being sourced from a single frame.
///
///
bool combineFrameResults = true;

///Get custom class rules.
List<CustomClassRules> customClassRules = [];
Expand Down
Loading

0 comments on commit 6309c6e

Please sign in to comment.