#NEWLINE# def __init__( self , imageBuff = None , thresh = 20 , method = BG_SUBTRACT_AMF , minArea = 400 , rectFilter = None , buffSize = 5 , soft_thresh = False , rect_type = BOUNDING_RECTS , rect_sigma = 2.0 , smooth = False ) : #NEWLINE# #INDENT# '\n        Constructor\n        @param imageBuff: a pv.ImageBuffer object to be used in the background subtraction\n            step of the motion detection. If None, then this object will create an empty\n            5-frame buffer, and until the buffer is full, the results of the motion detection\n            will be nothing.\n        @param thresh: Used by the background subtraction to eliminate noise.  \n        @param method: Select background subtraction method. See constants defined in\n          BackgroundSubtraction module\n        @param minArea: minimum foreground contour area required for detection\n        @param rectFilter: a function reference that takes a list of rectangles and\n          returns a list filtered in some way. This allows the user to arbitrarily\n          define rules to further limit motion detection results based on the geometry\n          of the bounding boxes.\n        @param buffSize: Only used if imageBuff==None. This controls the size of the\n          internal image buffer.\n        @param soft_thresh: Specify if the background subtraction method should\n          use a soft threshold, in which case the returned mask is no longer a binary\n          image, but represents weighted values. NOTE: NOT CURRENTLY IMPLEMENTED. \n          SOFT THRESHOLD WILL BE IGNORED, HARD THRESHOLD ONLY IN THIS VERSION.\n        @param smooth: applies smothing to the image before detection which can\n          reduce false detections.\n        @note: Until the image buffer is full, the result of the motion detection will be\n          nothing. See documentation on the detect(img) method of this class.\n        ' #NEWLINE# self . _fgMask = None #NEWLINE# self . _minArea = minArea #NEWLINE# self . _filter = rectFilter #NEWLINE# self . _threshold = 20 #NEWLINE# self . _softThreshold = False #NEWLINE# self . _smooth = smooth #NEWLINE# if ( rect_type == None ) : #NEWLINE# #INDENT# self . _imageBuff = pv . ImageBuffer ( N = buffSize ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _imageBuff = imageBuff #NEWLINE# #UNINDENT# self . _method = method #NEWLINE# self . _bgSubtract = None #NEWLINE# self . _contours = [ ] #NEWLINE# self . _annotateImg = None #NEWLINE# self . _rect_type = rect_type #NEWLINE# self . _rect_sigma = rect_sigma