Ask Your Question

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

asked 2016-09-04 14:12:12 -0500

jishnujcm gravatar image

using opencv 3.1.0 running opencv-python tutorial example

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-09-05 00:56:45 -0500

berak gravatar image
  • there is no such thing as cv2.cv2 (probably a typo on your side)
  • opencv's main repo has :
    1. cv2.createBackgroundSubtractorMOG2()
    2. cv2.createBackgroundSubtractorKNN()
  • both cv2.createBackgroundSubtractorMOG() and cv2.createBackgroundSubtractorGMG() were moved to the cv2.bgsegm module in opencv_contrib (to use those, you'll have to rebuild cv2 with contrib src)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-09-04 14:12:12 -0500

Seen: 5,385 times

Last updated: Sep 05 '16