【问题标题】:AttributeError: 'module' object has no attribute 'BOWImgDescriptorExtractor' in Opencv pythonAttributeError:“模块”对象在 Opencv python 中没有属性“BOWImgDescriptorExtractor”
【发布时间】:2016-05-03 09:06:14
【问题描述】:

变得非常困惑。四处搜索,但找不到任何有用的帮助。我得到了错误

Traceback(最近一次调用最后一次):文件“main_test.py”,第 105 行,在 train(descriptors,image_classes,image_paths) 文件“main_test.py”,第 40 行,在火车中 bow_extract = cv2.BOWImgDescriptorExtractor(descr_ext,matcher) AttributeError: 'module' object has no attribute 'BOWImgDescriptorExtractor'

我正在关注此链接代码: https://www.linkedin.com/pulse/machine-learning-image-detectioncats-vs-dogs-amrith-kumar 但我无法实现它并克服错误。

def train(descriptors,image_classes,image_paths):
  flann_params = dict(algorithm = 1, trees = 5)    
  matcher = cv2.FlannBasedMatcher(flann_params, {})
  bow_extract  = cv2.BOWImgDescriptorExtractor(descr_ext,matcher)
  bow_train = cv2.BOWKMeansTrainer(20)

【问题讨论】:

    标签: python opencv


    【解决方案1】:

    您还应该安装 opencv-contrib-python。请参阅pip 上的包。

    安装:

    pip install opencv-contrib-python
    

    【讨论】:

      猜你喜欢
      • 2018-02-14
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      • 1970-01-01
      • 2015-03-09
      • 2013-07-05
      • 2011-10-25
      相关资源
      最近更新 更多