Skip to content

Commit

Permalink
Change logic
Browse files Browse the repository at this point in the history
  • Loading branch information
P-ict0 committed Mar 5, 2024
1 parent afaa32c commit 0f6e2ab
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hmi/scripts/qr_code_decoder
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ class QRCodeDecode(AbstractHMIServer):
for _ in range(self.tries):
# gray_img = cv2.imdecode(self._image, cv2.IMREAD_GRAYSCALE)
gray_img = self._image
qr = qr_decode(gray_img)[0]
valid_qr = validate_image(gray_img, qr.rect)
qr_list = qr_decode(gray_img)
qr = None

for qr_i in qr_list:
valid_qr = validate_image(gray_img, qr_i.rect)
if valid_qr:
qr = qr_i
break

if not valid_qr:
# qr code does not occupy the required percentage of the screen
break
Expand Down

0 comments on commit 0f6e2ab

Please sign in to comment.