我在从视频帧中提取前景时遇到了一个问题。它还提取了几个背景对象。我从样本视频中拍摄了一张快照,用作背景image.Suggest我应该为背景图像拍摄一张单独的图像,而不是从视频中拍摄快照(假设快照的分辨率比图像低)或用于提取的其他更好的code.The代码是
//get height and width using OpenCV<
我运行以下代码:import numpy as np#mask=np.zeros(img.shape[:2],np.uint8)ret,thresh=cv2.threshold(imgray,200,200,200)
countours,hierarchy=cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHA
我一直在测试混合高斯(MOG)的两种不同实现,用于背景减去。一个是使用opncv2.1.0,cvCreateGaussianBGModel + cvUpdateBGStatModel,另一个是使用opencv 2.4.3,BackgroundSubtractorMOG2My best performance till now is using opencv 2.1.0 and which is around 30 FPS for 640 X 480 resolutionSo, currently I am preferring