
и использую приведенный ниже код:
Код: Выделить всё
import cv2
from pylibdmtx import pylibdmtx
import time
import os
image = cv2.imread('file1.png', cv2.IMREAD_UNCHANGED);
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
t1 = time.time()
msg = pylibdmtx.decode(thresh)
print(msg)
if msg:
print(msg[0].data.decode('utf-8'))
t2 = time.time()
print(t2-t1)
Подробнее здесь: https://stackoverflow.com/questions/782 ... -in-python
Мобильная версия