OpenCV detector is missing, how can I get it?

asked 2020-09-15 18:26:30 -0600

I am just trying out qr codes for the first time, using Python3.

I am following the instructions from this webpage:

When I get to "initialize the cv2 QRCode detector" I get this error in the Python shell:

initialize the cv2 QRCode detector detector = cv2.QRCodeDetector()

Traceback (most recent call last): File "<pyshell#20>", line 1, in <module> detector = cv2.QRCodeDetector() AttributeError: module 'cv2' has no attribute 'QRCodeDetector'

I installed OpenCV in Ubuntu with:

sudo apt install opencv-python3

How can I get the detector? AttributeError: module 'cv2' has no attribute 'QRCodeDetector'

edit retag flag offensive close merge delete

Comments

which opencv version is it ? try a:

cv2.__version__

(apt often schlepps in outdated stuffi)

berak gravatar imageberak ( 2020-09-16 00:51:07 -0600 )edit