Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 2088

What does the history of this function “createBackgroundSubtractorMOG2” means?

$
0
0
I only see this description in this [link](https://docs.opencv.org/master/de/de1/group__video__motion.html#ga2beb2dee7a073809ccec60f145b6b29c), it hasn't a very detailed explanation, so I'd like to know where can I find a more detailed explanation.The official web document says "Length of the history", what "Length of the history" is? ![image description](/upfiles/15156588079634633.jpg) **My code:** import os import time import cv2 def main(): img_src_dirpath = r'C:/Users/Shinelon/Desktop/SRC/' dir = r'D:/deal_pics/' + time.strftime('%Y-%m-%d') + '/' if not os.path.exists(dir): os.makedirs(dir) img_dst_dirpath = dir history = 60 varThreshold = 16 detectShadows = True mog2 = cv2.createBackgroundSubtractorMOG2( history, varThreshold, detectShadows ) for f in os.listdir( img_src_dirpath ): if f.endswith( '.jpg' ): img = cv2.imread( img_src_dirpath + f ) mog2.apply( img ) bg = mog2.getBackgroundImage() cv2.imwrite( img_dst_dirpath + f, bg ) cv2.destroyAllWindows() if __name__ == '__main__': main()

Viewing all articles
Browse latest Browse all 2088

Trending Articles