Skip to content

Commit

Permalink
parses identification from universal id scanning + adds template config
Browse files Browse the repository at this point in the history
  • Loading branch information
peterAnyline committed Jul 3, 2020
1 parent bd085a6 commit c4093a6
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<Content Include="Assets\jsonConfigs\mro_config_tin.json" />
<Content Include="Assets\anyline_capitals.traineddata" />
<Content Include="Assets\bottlecap.traineddata" />
<Content Include="Assets\jsonConfigs\id_config_template.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\FlashIcons\torch_auto.png" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"camera": {
"captureResolution": "1080p",
"zoomGesture": true
},
"flash": {
"mode": "manual",
"alignment": "bottom_right",
"imageOn": "flash_on",
"imageOff": "flash_off"
},
"viewPlugin": {
"plugin": {
"id": "ID",
"idPlugin": {
"templateConfig": {
"drivingLicense": {
"surname": {
"scanOption": 0,
"minConfidence": 40
},
"givenNames": {
"scanOption": 0,
"minConfidence": 40
},
"dateOfBirth": {
"scanOption": 0,
"minConfidence": 50
},
"placeOfBirth": {
"scanOption": 0,
"minConfidence": 50
},
"dateOfIssue": {
"scanOption": 0,
"minConfidence": 50
},
"dateOfExpiry": {
"scanOption": 1,
"minConfidence": 50
},
"authority": {
"scanOption": 1,
"minConfidence": 30
},
"documentNumber": {
"scanOption": 0,
"minConfidence": 40
},
"categories": {
"scanOption": 1,
"minConfidence": 30
},
"address": { "scanOption": 1 }
},
"idFront": {
"surname": {
"scanOption": 0,
"minConfidence": 60
},
"givenNames": {
"scanOption": 0,
"minConfidence": 60
},
"dateOfBirth": {
"scanOption": 0,
"minConfidence": 60
},
"placeOfBirth": {
"scanOption": 0,
"minConfidence": 60
},
"dateOfExpiry": {
"scanOption": 0,
"minConfidence": 60
},
"cardAccessNumber": {
"scanOption": 0,
"minConfidence": 60
},
"documentNumber": {
"scanOption": 0,
"minConfidence": 60
},
"nationality": {
"scanOption": 0,
"minConfidence": 60
}
}
}
}
},
"cutoutConfig": {
"style": "rect",
"maxWidthPercent": "90%",
"maxHeightPercent": "90%",
"alignment": "center",
"strokeWidth": 2,
"cornerRadius": 4,
"strokeColor": "FFFFFF",
"outerColor": "000000",
"outerAlpha": 0.3,
"ratioFromSize": {
"width": 50,
"height": 31
},
"cropPadding": {
"x": -30,
"y": -90
},
"cropOffset": {
"x": 0,
"y": 90
},
"feedbackStrokeColor": "0099FF"
},
"scanFeedback": {
"style": "contour_rect",
"visualFeedbackRedrawTimeout": 100,
"strokeColor": "0099FF",
"fillColor": "220099FF",
"beepOnResult": true,
"vibrateOnResult": true,
"strokeWidth": 2
},
"cancelOnResult": true
}
}
2 changes: 2 additions & 0 deletions Anyline Windows UWP Examples/Model/ExampleList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class ExampleList
private static readonly string MRZ = "Passport/MRZ";
private static readonly string DrivingLicense = "Driving License";
private static readonly string GermanIDFront = "German ID Front";
private static readonly string UniversalID = "Universal ID (alpha)";
private static readonly string LicensePlate = "EU License Plate";
private static readonly string UniversalSerialNumber = "Universal Serial Number";
private static readonly string VIN = "Vehicle Identification Number";
Expand All @@ -31,6 +32,7 @@ public static class ExampleList
new ExamplePlugin(MRZ, "id_config_mrz"),
new ExamplePlugin(DrivingLicense, "id_config_driving_license"),
new ExamplePlugin(GermanIDFront, "id_config_german_id_front"),
new ExamplePlugin(UniversalID, "id_config_template"),
}),
new ExampleCategory("Vehicle", new List<ExamplePlugin>{
new ExamplePlugin(LicensePlate, "vehicle_config_license_plate"),
Expand Down
8 changes: 8 additions & 0 deletions Anyline Windows UWP Examples/Model/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ public static void AddProperty(this Dictionary<string, object> dict, string name
{
value.CreatePropertyDictionary().ToList().ForEach(x => dict.Add(x.Key, x.Value));
}
else if(value is Identification id)
{
id.LayoutDefinition.CreatePropertyDictionary().ToList().ForEach(x => dict.Add(x.Key, x.Value));
foreach (var param in id)
{
dict.Add(param.Key, $"{param.Value} - (Confidence: {id.FieldConfidences[param.Key]})");
}
}
else if (value is MRZFieldConfidences || value is GermanIDFrontFieldConfidences || value is DrivingLicenseFieldConfidences)
{
value.CreatePropertyDictionary().ToList().ForEach(x => dict.Add($"{x.Key} (field confidence)", x.Value));
Expand Down

0 comments on commit c4093a6

Please sign in to comment.