• 大小: 7.65MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-25
  • 语言: 其他
  • 标签: opencv  

资源简介

根据An abandoned object detection system based on dual background segmentation论文,自己写的代码。 我的博客地址:http://blog.csdn.net/jinshengtao

资源截图

代码片段和文件信息

// abandon_left.cpp : 定义控制台应用程序的入口点。
//

#include “stdafx.h“
#include “Model.h“

int _tmain(int argc _TCHAR* argv[])
{
CvCapture *capture=cvCreateFileCapture(“test.avi“);
IplImage *current_back*buff_back*abandon*frame*current_img*fore;
int countintern;

frame = cvQueryframe(capture);
fore = cvCreateImage(cvSize(frame->widthframe->height)IPL_DEPTH_8U1);
current_back = cvCreateImage(cvSize(frame->widthframe->height)IPL_DEPTH_8U1);
current_img = cvCreateImage(cvSize(frame->widthframe->height)IPL_DEPTH_8U1);
buff_back = cvCreateImage(cvSize(frame->widthframe->height)IPL_DEPTH_8U1);
abandon = cvCreateImage(cvSize(frame->widthframe->height)IPL_DEPTH_8U1);

count=0;
intern = count + 20;

while (1)
{
cvCvtColor(framecurrent_imgCV_RGB2GRAY);

if (count == 0)
{
//初始化背景模版
cvCopy(current_imgcurrent_back);
cvCopy(current_imgbuff_back);
}

if (count > 0)
{
//计算前景掩膜
calc_fore(current_backbuff_backforeabandon);

//更新跟踪背景
update_currentback(current_imgcurrent_back);

if (count == intern)
{
update_bufferedback(current_backbuff_backabandon);
intern = count + 20;
}
cvShowImage(“current“current_img);
cvShowImage(“current_back“current_back);
cvShowImage(“buff_back“buff_back);
cvShowImage(“abandon detection“fore);
}

count++;
frame =cvQueryframe(capture);

if (cvWaitKey(23)>=0)
{
break;
}
}
cvNamedWindow(“current“0);
cvNamedWindow(“buff_back“0);
cvNamedWindow(“current_back“0);
cvNamedWindow(“abandon detection“0);
cvReleaseCapture(&capture);
return 0;
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-06 10:36  abandon_left\
     目录           0  2014-04-06 10:35  abandon_left\abandon_left\
     文件         902  2014-04-05 15:42  abandon_left\abandon_left.sln
     文件       11776  2014-04-06 10:35  abandon_left\abandon_left.suo
     文件        1694  2014-04-06 10:32  abandon_left\abandon_left\abandon_left.cpp
     文件        5206  2014-04-05 16:15  abandon_left\abandon_left\abandon_left.vcproj
     文件        1409  2014-04-06 10:35  abandon_left\abandon_left\abandon_left.vcproj.jst-PC.jst.user
     目录           0  2014-04-06 10:35  abandon_left\abandon_left\Debug\
     文件         663  2014-04-05 16:15  abandon_left\abandon_left\Debug\abandon_left.exe.embed.manifest
     文件         728  2014-04-05 16:15  abandon_left\abandon_left\Debug\abandon_left.exe.embed.manifest.res
     文件         621  2014-04-06 10:35  abandon_left\abandon_left\Debug\abandon_left.exe.intermediate.manifest
     文件      119891  2014-04-06 10:32  abandon_left\abandon_left\Debug\abandon_left.obj
     文件     3211264  2014-04-05 16:15  abandon_left\abandon_left\Debug\abandon_left.pch
     文件        7518  2014-04-06 10:35  abandon_left\abandon_left\Debug\BuildLog.htm
     文件       97200  2014-04-06 10:35  abandon_left\abandon_left\Debug\Model.obj
     文件          65  2014-04-06 10:35  abandon_left\abandon_left\Debug\mt.dep
     文件       12157  2014-04-05 16:15  abandon_left\abandon_left\Debug\stdafx.obj
     文件      625664  2014-04-06 10:35  abandon_left\abandon_left\Debug\vc90.idb
     文件      987136  2014-04-06 10:35  abandon_left\abandon_left\Debug\vc90.pdb
     文件        2624  2014-04-06 10:35  abandon_left\abandon_left\Model.cpp
     文件         308  2014-04-05 15:57  abandon_left\abandon_left\Model.h
     文件        1213  2014-04-05 15:41  abandon_left\abandon_left\ReadMe.txt
     文件         217  2014-04-05 15:41  abandon_left\abandon_left\stdafx.cpp
     文件         233  2014-04-05 15:41  abandon_left\abandon_left\stdafx.h
     文件         498  2014-04-05 15:41  abandon_left\abandon_left\targetver.h
     文件     6713200  2014-04-04 16:34  abandon_left\abandon_left\test.avi
     目录           0  2014-04-05 16:15  abandon_left\Debug\
     文件       33280  2014-04-06 10:35  abandon_left\Debug\abandon_left.exe
     文件      469460  2014-04-06 10:35  abandon_left\Debug\abandon_left.ilk
     文件     1395712  2014-04-06 10:35  abandon_left\Debug\abandon_left.pdb

评论

共有 条评论