【问题标题】:Python does not find bgsegm from cv2Python 找不到来自 cv2 的 bgsegm
【发布时间】:2018-07-25 01:03:17
【问题描述】:

我正在尝试测试一些背景减法方法(遵循tutorial),但 Python 无法找到它们。

使用 Windows 和 Anaconda。我确保通过 conda 升级 opencv 并运行

pip install opencv-contrib-python

另一个相关question 中推荐的命令。

不过,我明白了:

(tracx) C:\Users\USER>python
Python 3.5.4 |Anaconda, Inc.| (default, Nov  8 2017, 14:34:30) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> fgbg = cv2.createBackgroundSubtractorMOG()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'cv2.cv2' has no attribute 'createBackgroundSubtractorMOG'
>>> quit()

【问题讨论】:

  • 你能让它工作吗?

标签: python opencv conda background-subtraction


【解决方案1】:

您一定在寻找f = cv2.bgsegm.createBackgroundSubtractorMOG()

该函数当前位于bgseg(背景分割)模块中。

【讨论】:

    猜你喜欢
    • 2018-11-13
    • 1970-01-01
    • 1970-01-01
    • 2013-11-29
    • 2020-01-21
    • 1970-01-01
    • 1970-01-01
    • 2016-06-01
    • 2021-05-19
    相关资源
    最近更新 更多