I am trying to read datamatrix code by rasp using python.
I'm using pylibdmtx to read the code, but it only works on my notebook. When I put the same code on the raspberry it can't read the code. At the moment my raspberry is reading only qrcode and barcode.
I have two rasp one with raspbian and the other with ubuntu core, neither of which worked.
An example code below
import cv2
import time
from pylibdmtx.pylibdmtx import decode
data = None
video = cv2.VideoCapture(0)
video.set(cv2.CAP_PROP_FPS, 19)
while video.isOpened():
time.sleep(1/9)
ret, frame = video.read()
if ret is False:
break
decodeObjects = decode(frame,
timeout=1000,
max_count=1,
corrections=3)
for obj in decodeObjects:
if obj.data:
data = obj
if data:
break
video.release()
cv2.destroyAllWindows()
print(data)