File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change
1
+ import cv2
1
2
import barcodeQrSDK
2
3
from time import sleep
3
4
4
5
# set license
5
- barcodeQrSDK .initLicense ("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==" )
6
+ ret = barcodeQrSDK .initLicense (
7
+ "DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==" )
8
+ print ('initLicense: {}' .format (ret ))
6
9
7
10
# initialize barcode reader
8
11
reader = barcodeQrSDK .createInstance ()
31
34
print (result .y4 )
32
35
33
36
# decodeMat()
34
- import cv2
35
37
image = cv2 .imread ("test.png" )
36
38
results , elapsed_time = reader .decodeMat (image )
37
39
print ('Elapsed time: ' + str (elapsed_time ) + 'ms' )
50
52
# decodeMatAsync()
51
53
print ('' )
52
54
print ('Test decodeMatAsync()' )
55
+
56
+
53
57
def callback (results , elapsed_time ):
54
58
print ('Elapsed time: ' + str (elapsed_time ) + 'ms' )
55
59
for result in results :
@@ -63,9 +67,9 @@ def callback(results, elapsed_time):
63
67
print (result .y3 )
64
68
print (result .x4 )
65
69
print (result .y4 )
66
-
67
- import cv2
70
+
71
+
68
72
image = cv2 .imread ("test.png" )
69
73
reader .addAsyncListener (callback )
70
74
reader .decodeMatAsync (image )
71
- sleep (1 )
75
+ sleep (1 )
You can’t perform that action at this time.
0 commit comments