GMM核心概念(OpenCV3演示实例)
发布时间
阅读量:
阅读量
opencv3展示实例
需要使用摄像头
#include"opencv2/opencv.hpp"
#include"opencv2/core/core.hpp"
#include"opencv2/highgui/highgui.hpp"
#include"opencv2/imgproc/imgproc.hpp"
#include"opencv2/video/background_segm.hpp"
#include<iostream>
using namespace cv;
using namespace std;
int main()
{
VideoCapture capture(0);
Ptr<BackgroundSubtractorMOG2> bg_model = createBackgroundSubtractorMOG2();
Mat image, fgimage, fgmask;
while (1)
{
capture >> image; //get new frame from camera
if (!image.data)
{
cerr << "pi
全部评论 (0)
还没有任何评论哟~
