AttributeError: module 'cv2.cv2' has no attribute 'bgsegm

前端 未结 5 990
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 20:54
import numpy as np
import cv2
cap = cv2.VideoCapture(\'vtest.avi\')
fgbg = cv2.bgsegm.createBackgroundSubtractorMOG()
while(1):
    ret, frame = cap.read()
    fgmask =          


        
5条回答
  •  离开以前
    2021-02-19 21:19

    You need to install the contrib dependencies to get this working as it isn't part of the standard build.

    pip install opencv-contrib-python
    

提交回复
热议问题