没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
/**************************************************
* 背景建模,运动物体检测
*
**************************************************/
/***********************************************************************
* OpenCV example
* By Shiqi Yu 2006
***********************************************************************/
#include <stdio.h>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int main( int argc, char** argv )
{
//声明IplImage指针
IplImage* pFrame = NULL;
IplImage* pFrImg = NULL;
IplImage* pBkImg = NULL;
CvMat* pFrameMat = NULL;
CvMat* pFrMat = NULL;
CvMat* pBkMat = NULL;
CvCapture* pCapture = NULL;
CvVideoWriter * writer=0;
int nFrmNum = 0;
* 背景建模,运动物体检测
*
**************************************************/
/***********************************************************************
* OpenCV example
* By Shiqi Yu 2006
***********************************************************************/
#include <stdio.h>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int main( int argc, char** argv )
{
//声明IplImage指针
IplImage* pFrame = NULL;
IplImage* pFrImg = NULL;
IplImage* pBkImg = NULL;
CvMat* pFrameMat = NULL;
CvMat* pFrMat = NULL;
CvMat* pBkMat = NULL;
CvCapture* pCapture = NULL;
CvVideoWriter * writer=0;
int nFrmNum = 0;
int fps=50;
int framew=500;
int frameh=600;
int iscolor=1;
writer=cvCreateVideoWriter("h:\\out.avi",CV_FOURCC('P','I','M','1'),fps,cvSize(framew,frameh),iscolor);
//创建窗口
cvNamedWindow("video", 1);
cvNamedWindow("background",1);
cvNamedWindow("foreground",1);
//使窗口有序排列
cvMoveWindow("video", 30, 0);
cvMoveWindow("background", 360, 0);
cvMoveWindow("foreground", 690, 0);
if( argc > 2 )
{
fprintf(stderr, "Usage: bkgrd [video_file_name]\n");
return -1;
}
//打开摄像头
if (argc ==1)
if( !(pCapture = cvCaptureFromCAM(0)))
{
fprintf(stderr, "Can not open camera.\n");
return -2;
}
int framew=500;
int frameh=600;
int iscolor=1;
writer=cvCreateVideoWriter("h:\\out.avi",CV_FOURCC('P','I','M','1'),fps,cvSize(framew,frameh),iscolor);
//创建窗口
cvNamedWindow("video", 1);
cvNamedWindow("background",1);
cvNamedWindow("foreground",1);
//使窗口有序排列
cvMoveWindow("video", 30, 0);
cvMoveWindow("background", 360, 0);
cvMoveWindow("foreground", 690, 0);
if( argc > 2 )
{
fprintf(stderr, "Usage: bkgrd [video_file_name]\n");
return -1;
}
//打开摄像头
if (argc ==1)
if( !(pCapture = cvCaptureFromCAM(0)))
{
fprintf(stderr, "Can not open camera.\n");
return -2;
}
剩余5页未读,继续阅读
syningjoyo
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页