Python运行OpenCV: AttributeError: module ‘cv2‘ has no attribute ‘legacy‘
Python运行OpenCV: AttributeError: module 'cv2' has no attribute 'legacy'
·
- 代码
if tracker_type == 'CSRT':
tracker = cv2.legacy.TrackerCSRT_create()
elif tracker_type == 'KCF':
tracker = cv2.legacy.TrackerKCF_create()
- 解决办法
pip install --upgrade opencv-python opencv-contrib-python
更多推荐
所有评论(0)