Closed tewhalen closed 10 months ago
You need to use createXXX factory methods for all background subtractor classes, e.g. backSub = cv2.bgsegm.createBackgroundSubtractorGMG()
See https://github.com/opencv/opencv_contrib/blob/4.x/modules/bgsegm/tutorials/bgsegm_bg_subtraction/bgsegm_bg_subtraction.markdown. The same approach is valid for all cv::Algorithm
derivatives, as they usually used in C++ code as cv::Ptr<>
, but not as plain object.
I can't seem to get any background subtractors to successfully run on my Mac. They all throw a segfault when the .apply() method is called. It doesn't seem to matter which of the cv2.bgsegm Subtractors I use - they all segfault on apply(). cv2.BackgroundSubtractorMOG2 and cv2.BackgroundSubtractorKNN also segfault when .apply() is called.
This is on Mac OS Sonoma 14.0, x86_64
Steps to reproduce
Yields: