https://www.toutiao.com/i6924143326145036804/?tt_from=mobile_qq&utm_campaign=client_share×tamp=1612171870&app=news_article&utm_source=mobile_qq&utm_medium=toutiao_android&use_new_style=1&req_id=202102011731090100270240120B002932&share_token=082c62a0-7505-4f3e-8a43-f37a1d3aef88&group_id=6924143326145036804
我试图复现这个文章的结果
import cv2
print(cv2.version.opencv_version)
detector = cv2.wechat_qrcode_WeChatQRCode("detect.prototxt", "detect.caffemodel", "sr.prototxt", "sr.caffemodel")
img = cv2.imread("img.jpg")
res, points = detector.detectAndDecode(img)
print(res, points)
结果提示:
4.5.1.48
Traceback (most recent call last):
File "C:/Users/fio/PycharmProjects/untitled2/fff.py", line 5, in <module>
detector = cv2.wechat_qrcode_WeChatQRCode("detect.prototxt", "detect.caffemodel", "sr.prototxt", "sr.caffemodel")
AttributeError: module 'cv2.cv2' has no attribute 'wechat_qrcode_WeChatQRCode'
可是我的2个opencv库都安装到最新版本了
opencv-contrib-python 4.5.1.48
opencv-python 4.5.1.48
这是什么原因导致无法跑通呢??