Skip to content
Snippets Groups Projects
Commit 617ce147 authored by Tommy Persson's avatar Tommy Persson
Browse files

QR.

parent 70feaad3
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,7 @@ def image_callback(data): ...@@ -132,7 +132,7 @@ def image_callback(data):
frame_pil = PilImage.fromarray(scaledimg) frame_pil = PilImage.fromarray(scaledimg)
qr = qrcode.QRCode(box_size=10) qr = qrcode.QRCode(box_size=6)
if options.qr_time: if options.qr_time:
timestamp = time.time() timestamp = time.time()
qr.add_data(str(timestamp)) qr.add_data(str(timestamp))
...@@ -172,13 +172,14 @@ def image_callback(data): ...@@ -172,13 +172,14 @@ def image_callback(data):
image_pub.publish(msg) image_pub.publish(msg)
if options.decode: if options.decode:
retval, points = detector.detect(final_image) if not have_points:
print(retval, points) retval, points = detector.detect(final_image)
if retval: print(retval, points)
remembered_points = points if retval:
have_points = True remembered_points = points
else: have_points = True
print("FAILED TO FIND CODE, trying to use saved points") else:
print("FAILED TO FIND CODE, trying to use saved points")
if have_points: if have_points:
decoded_data, _ = detector.decode(final_image, remembered_points) decoded_data, _ = detector.decode(final_image, remembered_points)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment