【发布时间】:2018-07-03 01:59:10
【问题描述】:
我可以从 OpenCV 3.4.1 文档 (https://docs.opencv.org/3.4.1/dd/de1/classcv_1_1ml_1_1KNearest.html) 中看到 KNearest 函数存在。这正是我的版本,如下所示:
>>> import cv2
>>> cv2.__version__
'3.4.1'
但是,当我运行我的 python 代码时,它似乎不存在
knn = cv2.KNearest()
AttributeError: 'module' object has no attribute 'KNearest'
我在这方面很菜鸟。我错过了什么?对于这样的 OpenCV 版本,这是正确的功能吗?
【问题讨论】: