Skip to content

Commit 37f7802

Browse files
fix: support the long document number type for TD1 (#11)
1 parent 718b2cb commit 37f7802

File tree

1 file changed

+36
-60
lines changed

1 file changed

+36
-60
lines changed

template.json

Lines changed: 36 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,124 +3,112 @@
33
{
44
"Name": "ReadPassportAndId",
55
"OutputOriginalImage": 0,
6-
"ImageROIProcessingNameArray": [
7-
"roi-passport-and-id"
8-
],
9-
"SemanticProcessingNameArray": ["sp-passport-and-id"],
6+
"ImageROIProcessingNameArray": ["roi-passport-and-id"],
7+
"SemanticProcessingNameArray": ["sp-passport-and-id"],
108
"Timeout": 2000
119
},
1210
{
1311
"Name": "ReadPassport",
1412
"OutputOriginalImage": 0,
15-
"ImageROIProcessingNameArray": [
16-
"roi-passport"
17-
],
18-
"SemanticProcessingNameArray": ["sp-passport"],
13+
"ImageROIProcessingNameArray": ["roi-passport"],
14+
"SemanticProcessingNameArray": ["sp-passport"],
1915
"Timeout": 2000
2016
},
2117
{
2218
"Name": "ReadId",
2319
"OutputOriginalImage": 0,
24-
"ImageROIProcessingNameArray": [
25-
"roi-id"
26-
],
27-
"SemanticProcessingNameArray": ["sp-id"],
20+
"ImageROIProcessingNameArray": ["roi-id"],
21+
"SemanticProcessingNameArray": ["sp-id"],
2822
"Timeout": 2000
2923
}
3024
],
3125
"TargetROIDefOptions": [
3226
{
3327
"Name": "roi-passport-and-id",
34-
"TaskSettingNameArray": [
35-
"task-passport-and-id"
36-
]
28+
"TaskSettingNameArray": ["task-passport-and-id"]
3729
},
3830
{
3931
"Name": "roi-passport",
40-
"TaskSettingNameArray": [
41-
"task-passport"
42-
]
32+
"TaskSettingNameArray": ["task-passport"]
4333
},
4434
{
4535
"Name": "roi-id",
46-
"TaskSettingNameArray": [
47-
"task-id"
48-
]
36+
"TaskSettingNameArray": ["task-id"]
4937
}
5038
],
5139
"TextLineSpecificationOptions": [
5240
{
5341
"Name": "tls-mrz-passport",
5442
"BaseTextLineSpecificationName": "tls-base",
55-
"StringLengthRange": [ 44, 44 ],
43+
"StringLengthRange": [44, 44],
5644
"OutputResults": 1,
5745
"ExpectedGroupsCount": 1,
5846
"ConcatResults": 1,
5947
"ConcatSeparator": "",
6048
"SubGroups": [
6149
{
6250
"StringRegExPattern": "(P[A-Z<][A-Z<]{3}[A-Z<]{39}){(44)}",
63-
"StringLengthRange": [ 44, 44 ],
51+
"StringLengthRange": [44, 44],
6452
"BaseTextLineSpecificationName": "tls-base"
6553
},
6654
{
6755
"StringRegExPattern": "([A-Z0-9<]{9}[0-9][A-Z<]{3}[0-9]{2}[(01-12)][(01-31)][0-9][MF<][0-9]{2}[(01-12)][(01-31)][0-9][A-Z0-9<]{14}[0-9<][0-9]){(44)}",
68-
"StringLengthRange": [ 44, 44 ],
56+
"StringLengthRange": [44, 44],
6957
"BaseTextLineSpecificationName": "tls-base"
7058
}
7159
]
7260
},
7361
{
7462
"Name": "tls-mrz-id-td2",
7563
"BaseTextLineSpecificationName": "tls-base",
76-
"StringLengthRange": [ 36, 36 ],
64+
"StringLengthRange": [36, 36],
7765
"OutputResults": 1,
7866
"ExpectedGroupsCount": 1,
7967
"ConcatResults": 1,
8068
"ConcatSeparator": "",
8169
"SubGroups": [
8270
{
8371
"StringRegExPattern": "([ACI][A-Z<][A-Z<]{3}[A-Z<]{31}){(36)}",
84-
"StringLengthRange": [ 36, 36 ],
72+
"StringLengthRange": [36, 36],
8573
"BaseTextLineSpecificationName": "tls-base"
8674
},
8775
{
8876
"StringRegExPattern": "([A-Z0-9<]{9}[0-9][A-Z<]{3}[0-9]{2}[(01-12)][(01-31)][0-9][MF<][0-9]{2}[(01-12)][(01-31)][0-9][A-Z0-9<]{8}){(36)}",
89-
"StringLengthRange": [ 36, 36 ],
77+
"StringLengthRange": [36, 36],
9078
"BaseTextLineSpecificationName": "tls-base"
9179
}
9280
]
9381
},
9482
{
9583
"Name": "tls-mrz-id-td1",
9684
"BaseTextLineSpecificationName": "tls-base",
97-
"StringLengthRange": [ 30, 30 ],
85+
"StringLengthRange": [30, 30],
9886
"OutputResults": 1,
9987
"ExpectedGroupsCount": 1,
10088
"ConcatResults": 1,
10189
"ConcatSeparator": "",
10290
"SubGroups": [
10391
{
104-
"StringRegExPattern": "([ACI][A-Z<][A-Z<]{3}[A-Z0-9<]{9}[0-9][A-Z0-9<]{15}){(30)}",
105-
"StringLengthRange": [ 30, 30 ],
92+
"StringRegExPattern": "([ACI][A-Z<][A-Z<]{3}[A-Z0-9<]{9}[0-9<][A-Z0-9<]{15}){(30)}",
93+
"StringLengthRange": [30, 30],
10694
"BaseTextLineSpecificationName": "tls-base"
10795
},
10896
{
10997
"StringRegExPattern": "([0-9]{2}[(01-12)][(01-31)][0-9][MF<][0-9]{2}[(01-12)][(01-31)][0-9][A-Z<]{3}[A-Z0-9<]{11}[0-9]){(30)}",
110-
"StringLengthRange": [ 30, 30 ],
98+
"StringLengthRange": [30, 30],
11199
"BaseTextLineSpecificationName": "tls-base"
112100
},
113101
{
114102
"StringRegExPattern": "([A-Z<]{30}){(30)}",
115-
"StringLengthRange": [ 30, 30 ],
103+
"StringLengthRange": [30, 30],
116104
"BaseTextLineSpecificationName": "tls-base"
117105
}
118106
]
119107
},
120108
{
121109
"Name": "tls-base",
122110
"CharacterModelName": "MRZ",
123-
"CharHeightRange": [ 5, 1000, 1 ],
111+
"CharHeightRange": [5, 1000, 1],
124112
"BinarizationModes": [
125113
{
126114
"BlockSizeX": 30,
@@ -132,11 +120,11 @@
132120
],
133121
"ConfusableCharactersCorrection": {
134122
"ConfusableCharacters": [
135-
[ "0", "O" ],
136-
[ "1", "I" ],
137-
[ "5", "S" ]
123+
["0", "O"],
124+
["1", "I"],
125+
["5", "S"]
138126
],
139-
"FontNameArray": [ "OCR_B" ]
127+
"FontNameArray": ["OCR_B"]
140128
}
141129
}
142130
],
@@ -223,7 +211,7 @@
223211
],
224212
"TextDetectionMode": {
225213
"Mode": "TTDM_LINE",
226-
"CharHeightRange": [ 5, 1000, 1 ],
214+
"CharHeightRange": [5, 1000, 1],
227215
"Direction": "HORIZONTAL",
228216
"Sensitivity": 7
229217
}
@@ -233,49 +221,37 @@
233221
{
234222
"Name": "sp-passport-and-id",
235223
"ReferenceObjectFilter": {
236-
"ReferenceTargetROIDefNameArray": [
237-
"roi-passport-and-id"
238-
]
224+
"ReferenceTargetROIDefNameArray": ["roi-passport-and-id"]
239225
},
240-
"TaskSettingNameArray": [
241-
"dcp-passport-and-id"
242-
]
226+
"TaskSettingNameArray": ["dcp-passport-and-id"]
243227
},
244228
{
245229
"Name": "sp-passport",
246230
"ReferenceObjectFilter": {
247-
"ReferenceTargetROIDefNameArray": [
248-
"roi-passport"
249-
]
231+
"ReferenceTargetROIDefNameArray": ["roi-passport"]
250232
},
251-
"TaskSettingNameArray": [
252-
"dcp-passport"
253-
]
233+
"TaskSettingNameArray": ["dcp-passport"]
254234
},
255235
{
256236
"Name": "sp-id",
257237
"ReferenceObjectFilter": {
258-
"ReferenceTargetROIDefNameArray": [
259-
"roi-id"
260-
]
238+
"ReferenceTargetROIDefNameArray": ["roi-id"]
261239
},
262-
"TaskSettingNameArray": [
263-
"dcp-id"
264-
]
240+
"TaskSettingNameArray": ["dcp-id"]
265241
}
266242
],
267243
"CodeParserTaskSettingOptions": [
268244
{
269245
"Name": "dcp-passport",
270-
"CodeSpecifications": [ "MRTD_TD3_PASSPORT" ]
246+
"CodeSpecifications": ["MRTD_TD3_PASSPORT"]
271247
},
272248
{
273249
"Name": "dcp-id",
274-
"CodeSpecifications": [ "MRTD_TD1_ID", "MRTD_TD2_ID" ]
250+
"CodeSpecifications": ["MRTD_TD1_ID", "MRTD_TD2_ID"]
275251
},
276252
{
277253
"Name": "dcp-passport-and-id",
278-
"CodeSpecifications": [ "MRTD_TD3_PASSPORT", "MRTD_TD1_ID", "MRTD_TD2_ID" ]
254+
"CodeSpecifications": ["MRTD_TD3_PASSPORT", "MRTD_TD1_ID", "MRTD_TD2_ID"]
279255
}
280256
]
281-
}
257+
}

0 commit comments

Comments
 (0)