OpenCV2 Python createBackgroundSubtractor module not found

后端 未结 7 1598
抹茶落季
抹茶落季 2020-12-31 05:02

I am trying to use cv2.createBackgroundSubtractorMOG2 () method in Python. I have tried both on my Mac and on my Raspberry Pi, and get the same error when running the follow

7条回答
  •  盖世英雄少女心
    2020-12-31 05:27

    I'm using

    >>> import cv2
    >>> cv2.__version__
    >>> 3.2.0
    

    and python 2.7.12. While I tried to use cv2.createBackgroundSubtractorMOG() I received the same error message (also tried without "create..."). But I was surprised when I discovered cv2.createBackgroundSubtractorKNN() with the same functionality instead ... and the test code works :) 2 days I was confused and couldn't find where the problem is.

提交回复
热议问题