def __init__(self, structuring_element=None):
        """Initializes the `BackgroundSubtractorGMG`.

        *Note:* Requires OpenCV to be built with `--contrib` as it uses the
        `bgsegm` package.

        Unless a custom `structuring_element` is specified, it uses:
            `cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))`

        Args:
            structuring_element: The structuring element.
        """
        if structuring_element is None:
            self.strel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))
        else:
            self.strel = structuring_element
        self.fgbg = cv2.bgsegm.createBackgroundSubtractorGMG()
def __init__ ( self , structuring_element = None ) : if structuring_element is None : self . strel = cv2 . getStructuringElement ( cv2 . MORPH_ELLIPSE , ( 3 , 3 ) ) else : self . strel = structuring_element self . fgbg = cv2 . bgsegm . createBackgroundSubtractorGMG ( )
Initializes the `BackgroundSubtractorGMG`.

        *Note:* Requires OpenCV to be built with `--contrib` as it uses the
        `bgsegm` package.

        Unless a custom `structuring_element` is specified, it uses:
            `cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (3, 3))`

        Args:
            structuring_element: The structuring element.