我刚开始在python中使用OpenCV 3.0。我正在尝试其中一个例子" didgits.py"我收到属性错误:
Traceback (most recent call last):
File "C:\Users\Arpit Jindal\Desktop\opencv\sources\samples\python2\digits.py", line 171, in <module>
model = KNearest(k=4)
File "C:\Users\Arpit Jindal\Desktop\opencv\sources\samples\python2\digits.py", line 77, in __init__
self.model = cv2.KNearest()
AttributeError: 'module' object has no attribute 'KNearest'
然后我评论了KNearest
的代码并仅针对SVM
进行了尝试,并且我再次收到了属性错误:
Traceback (most recent call last):
File "C:\Users\Arpit Jindal\Desktop\opencv\sources\samples\python2\digits.py", line 177, in <module>
model = SVM(C=2.67, gamma=5.383)
File "C:\Users\Arpit Jindal\Desktop\opencv\sources\samples\python2\digits.py", line 89, in __init__
self.params = dict( kernel_type = cv2.SVM_RBF,
AttributeError: 'module' object has no attribute 'SVM_RBF'
我试图在OpenCV中搜索这些变量,但无法找到任何内容。
python示例是否未更新?我在哪里可以找到完整的python API列表和OpenCV3.0 python的参考手册,因为在线docs还没有完成机器学习,因为我发现2.4.9中提到了很多python API但没有在3.0?