码迷,mamicode.com
首页 > 其他好文 > 详细

OpencV2.4.13前景提取示例代码

时间:2016-08-14 14:39:16      阅读:445      评论:0      收藏:0      [点我收藏+]

标签:

OpenCV2编译  基于高斯混合模型

技术分享

#include<fstream>
#include<iostream>
#include<iostream> 
#include<highgui.h>
#include<opencv2/opencv.hpp>
#include<opencv2\core\core.hpp>
#include<opencv2/core/core.hpp> 
#include<opencv2\highgui\highgui.hpp>
#include<opencv2/highgui/highgui.hpp>  
#include<opencv2/imgproc/imgproc.hpp> 
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/objdetect/objdetect.hpp>
using namespace std;
using namespace cv;
int main()
{
    VideoCapture video(0);
    Mat frame, mask, thresholdImage, output;
    BackgroundSubtractorMOG2 bgSubtractor(20, 16, true);
    namedWindow("background");
    while (true){
        video >> frame;
        bgSubtractor(frame, mask, 0.001);
        imshow("background", mask);
        char c = (char)waitKey(20);
        if (c == 27)
            break;
    }
    return 0;
}

 

OpencV2.4.13前景提取示例代码

标签:

原文地址:http://www.cnblogs.com/dzzy/p/5770158.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!