qrcode detector not in cv2 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: qrcode detector not in cv2 (/thread-29683.html) |
qrcode detector not in cv2 - Pedroski55 - Sep-15-2020 I am just following the instructions here, trying to learn how this works. I am now trying to read a qr code I made. this shows no errors: Quote:# read the QRCODE image But this does not work: Quote:# initialize the cv2 QRCode detector I get this in Idle: Quote:>>> detector = cv2.QRCodeDetector() The webpage says it was updated September 2020. I installed cv2 from Ubuntu: sudo apt-get install python3-opencv How do I get the detector? RE: qrcode detector not in cv2 - bowlofred - Sep-15-2020 If you do dir(cv2) in your REPL, do you get lots and lots of objects? Could you show some of the output?If you don't, I suspect your cv2 module is being shadowed by some other file locally. >>> len(dir(cv2)) 1946 >>> dir(cv2) ['', 'ACCESS_FAST', 'ACCESS_MASK', 'ACCESS_READ', 'ACCESS_RW', 'ACCESS_WRITE', 'ADAPTIVE_THRESH_GAUSSIAN_C', 'ADAPTIVE_THRESH_MEAN_C', 'AGAST_FEATURE_DETECTOR_AGAST_5_8', 'AGAST_FEATURE_DETECTOR_AGAST_7_12D', 'AGAST_FEATURE_DETECTOR_AGAST_7_12S', 'AGAST_FEATURE_DETECTOR_NONMAX_SUPPRESSION', 'AGAST_FEATURE_DETECTOR_OAST_9_16', 'AGAST_FEATURE_DETECTOR_THRESHOLD', 'AKAZE', 'AKAZE_DESCRIPTOR_KAZE', 'AKAZE_DESCRIPTOR_KAZE_UPRIGHT', 'AKAZE_DESCRIPTOR_MLDB', ... RE: qrcode detector not in cv2 - Pedroski55 - Sep-16-2020 EDIT: SOLVED: with advice from askubuntu, I downloaded pedro@pedro-512ssd:~$ pip3 install opencv-contrib-python Now the detector works!! Thanks for the reply: I got this info: Quote:>>> cv2 Looks like my cv2 is significantly shorter than your cv2 1704 to 1946! Maybe that's why the module is missing! How to change this? I have tried to install opencv- from pip3, but the install fails. Quote:pedro@pedro-512ssd:~$ pip3 install opencv-python |