Skip to content

Commit d87a34c

Browse files
committed
Update test.py
1 parent 79e5de2 commit d87a34c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import cv2
12
import barcodeQrSDK
23
from time import sleep
34

45
# set license
5-
barcodeQrSDK.initLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==")
6+
ret = barcodeQrSDK.initLicense(
7+
"DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==")
8+
print('initLicense: {}'.format(ret))
69

710
# initialize barcode reader
811
reader = barcodeQrSDK.createInstance()
@@ -31,7 +34,6 @@
3134
print(result.y4)
3235

3336
# decodeMat()
34-
import cv2
3537
image = cv2.imread("test.png")
3638
results, elapsed_time = reader.decodeMat(image)
3739
print('Elapsed time: ' + str(elapsed_time) + 'ms')
@@ -50,6 +52,8 @@
5052
# decodeMatAsync()
5153
print('')
5254
print('Test decodeMatAsync()')
55+
56+
5357
def callback(results, elapsed_time):
5458
print('Elapsed time: ' + str(elapsed_time) + 'ms')
5559
for result in results:
@@ -63,9 +67,9 @@ def callback(results, elapsed_time):
6367
print(result.y3)
6468
print(result.x4)
6569
print(result.y4)
66-
67-
import cv2
70+
71+
6872
image = cv2.imread("test.png")
6973
reader.addAsyncListener(callback)
7074
reader.decodeMatAsync(image)
71-
sleep(1)
75+
sleep(1)

0 commit comments

Comments
 (0)