Skip to content

Commit 1870267

Browse files
committed
add example with authenticity
1 parent aad14f2 commit 1870267

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

example/IR.jpg

473 KB
Loading

example/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ This sample generates next text output:
5555
```text
5656
---------------------------------------------------------------------------
5757
Document Overall Status: not valid
58-
Document Number Visual: U0996738
59-
Document Number MRZ: U0996738
60-
Validity Of Document Number Visual: 1
61-
Validity Of Document Number MRZ: 1
58+
Document Number Visual: OO0000000
59+
Document Number MRZ: OO0000000
60+
Validity Of Document Number Visual: 0
61+
Validity Of Document Number MRZ: 0
6262
MRZ-Visual values comparison: 1
6363
---------------------------------------------------------------------------
6464
```

example/UV.jpg

557 KB
Loading

example/WHITE.jpg

580 KB
Loading

example/australia_passport.jpg

-586 KB
Binary file not shown.

example/example.py

+23-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,35 @@
1111
print("Found local license file. Using it for performing request...")
1212
regula_license = f.read()
1313

14-
with open("australia_passport.jpg", "rb") as f:
15-
input_image = f.read()
14+
with open("WHITE.jpg", "rb") as f:
15+
white_page_0 = f.read()
16+
17+
with open("IR.jpg", "rb") as f:
18+
ir_page_0 = f.read()
19+
20+
with open("UV.jpg", "rb") as f:
21+
uv_page_0 = f.read()
1622

1723
with DocumentReaderApi(host) as api:
1824
api.license = regula_license
1925

2026
params = ProcessParams(
21-
scenario=Scenario.FULL_PROCESS,
22-
result_type_output=[Result.STATUS, Result.TEXT, Result.IMAGES]
27+
scenario=Scenario.FULL_AUTH,
28+
result_type_output=[
29+
# actual results
30+
Result.STATUS, Result.AUTHENTICITY, Result.TEXT, Result.IMAGES,
31+
Result.DOCUMENT_TYPE, Result.DOCUMENT_TYPE_CANDIDATES,
32+
# legacy results
33+
Result.MRZ_TEXT, Result.VISUAL_TEXT, Result.BARCODE_TEXT, Result.RFID_TEXT,
34+
Result.VISUAL_GRAPHICS, Result.BARCODE_GRAPHICS, Result.RFID_GRAPHICS,
35+
Result.LEXICAL_ANALYSIS
36+
]
2337
)
24-
request = RecognitionRequest(process_params=params, images=[input_image])
38+
request = RecognitionRequest(process_params=params, images=[
39+
RecognitionImage(image=white_page_0, light_index=Light.WHITE, page_index=0),
40+
RecognitionImage(image=ir_page_0, light_index=Light.IR, page_index=0),
41+
RecognitionImage(image=uv_page_0, light_index=Light.UV, page_index=0),
42+
])
2543
response = api.process(request)
2644

2745
# status examples

0 commit comments

Comments
 (0)