最小示例代码:
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.DualTVL1OpticalFlow_create()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'cv2.cv2' has no attribute 'DualTVL1OpticalFlow_create'
>>> cv2.__version__
'4.1.1'
原因:cv2的版本之间兼容性,新版的cv2可能没有这个api了,具体可以查询opencv 4.1.1的doc
解决:改为使用opencv 3.4.2。如何切换?见我的博客:https://blog.csdn.net/qxqxqzzz/article/details/102790135
最小示例:
$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "he