mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge remote-tracking branch 'origin/master' into improvement/fishyqr-integration
This commit is contained in:
commit
6bb02778f9
@ -4,7 +4,7 @@ from datetime import datetime
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
from pyzbar.pyzbar import decode
|
||||
from pyzbar.pyzbar import decode, ZBarSymbol
|
||||
|
||||
from fishy.helper.helper import get_documents
|
||||
|
||||
@ -37,7 +37,8 @@ def get_qr_location(og_img):
|
||||
mask = np.zeros_like(img)
|
||||
cv2.drawContours(mask, cnt, i, 255, -1)
|
||||
x, y, w, h = cv2.boundingRect(cnt[i])
|
||||
qr_result = decode(og_img[y:h + y, x:w + x])
|
||||
qr_result = decode(og_img[y:h + y, x:w + x],
|
||||
symbols=[ZBarSymbol.QRCODE])
|
||||
if qr_result:
|
||||
valid_crops.append(((x, y, x + w, y + h), area))
|
||||
|
||||
@ -47,7 +48,7 @@ def get_qr_location(og_img):
|
||||
# noinspection PyBroadException
|
||||
def get_values_from_image(img):
|
||||
try:
|
||||
for qr in decode(img):
|
||||
for qr in decode(img, symbols=[ZBarSymbol.QRCODE]):
|
||||
vals = qr.data.decode('utf-8').split(",")
|
||||
return tuple(float(v) for v in vals)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user