Ask Your Question
1

Unable to use background subtractor.

asked 2017-11-15 15:18:52 -0600

maxisme gravatar image

I have installed opencv 3.3 when running python:

import cv2
cv2.__version__

returns:

'3.3.0'

unfortunately when running:

cv2.createBackgroundSubtractorMOG()

Python returns:

AttributeError: 'module' object has no attribute 'createBackgroundSubtractorMOG'

when I run:

cv2.bgsegm

Python returns:

ImportError: No module named bgsegm

What is going on?

edit retag flag offensive close merge delete

Comments

let's start here: "I have installed opencv 3.3" -- how so ?

berak gravatar imageberak ( 2017-11-15 16:07:58 -0600 )edit

you need to build cv2 from src with the contrib modules

(if you installed it via PIP or the like, it won't have it)

berak gravatar imageberak ( 2017-11-16 01:26:31 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-11-15 20:40:06 -0600

supra56 gravatar image

updated 2017-11-15 20:43:59 -0600

cv2.createBackgroundSubtractorMOG2

edit flag offensive delete link more

Comments

cv2.bgsegm.createBackgroundSubtractorMOG

supra56 gravatar imagesupra56 ( 2017-11-15 20:41:41 -0600 )edit
1

Another thing is try this cv2.BackgroundSubtractorMOG() instead cv2.createBackgroundSubtractorMOG()<== This is old one

supra56 gravatar imagesupra56 ( 2017-11-15 20:51:52 -0600 )edit

cv2.BackgroundSubtractorMOG() and cv2.createBackgroundSubtractorMOG() both are not working is their any other solution to find and solve this

Vamshi Reddy gravatar imageVamshi Reddy ( 2018-03-13 08:41:52 -0600 )edit

Just use this it works fine and smoothly when compared to other subtractors also efficiency is comparatively high for
cv2.bgsegm.createBackgroundSubtractorMOG() go with this

Vamshi Reddy gravatar imageVamshi Reddy ( 2018-03-13 08:50:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-15 15:18:52 -0600

Seen: 1,129 times

Last updated: Nov 15 '17