资源简介
根据物体移动的速度和大小检测物体的异常行为 opencv
代码片段和文件信息
#include
#include
#include
#include “package_bgs/pt/PixelbasedAdaptiveSegmenter.h“
#include “package_tracking/BlobTracking.h“
#include “package_analysis/VehicleCouting.h“
int main(int argc char **argv)
{
CvCapture *capture = 0;
//capture = cvCaptureFromAVI(“./dataset/video.avi“);
//capture = cvCaptureFromFile(“E:/highway2.mp4“);
//capture=cvCaptureFromFile(“E:/Project/dataset/test44.mp4“);
capture = cvCreateCameraCapture(-1);
if (!capture){
std::cerr << “Cannot open video!“ << std::endl;
return 1;
}
char link[512];
int i = 100;
int resize_factor = 100; // 50% of original image
IplImage *frame_aux = cvQueryframe(capture);
IplImage *frame = cvCreateImage(cvSize((int)((frame_aux->width*resize_factor) / 100) (int)((frame_aux->height*resize_factor) / 100)) frame_aux->depth frame_aux->nChannels);
i++;
/* Background Subtraction Methods */
IBGS *bgs;
/*** PT Package (adapted from Hofmann) ***/
bgs = new PixelbasedAdaptiveSegmenter;
/* Blob Tracking */
cv::Mat img_blob;
BlobTracking* blobTracking;
blobTracking = new BlobTracking;
/* Vehicle Counting Algorithm */
VehicleCouting* vehicleCouting;
vehicleCouting = new VehicleCouting;
int key = 0;
while (key != ‘q‘)
{
frame_aux = cvQueryframe(capture);
if (!frame_aux) break;
cvResize(frame_aux frame);
cv::Mat img_input(frame);
cvNamedWindow(“input“ CV_WINDOW_NORMAL);
//cvNamedWindow(“PBAS“ CV_WINDOW_NORMAL);
//cvNamedWindow(“Blob Tracking“ CV_WINDOW_NORMAL);
//cvNamedWindow(“bla“ CV_WINDOW_NORMAL);
cv::imshow(“input“ img_input);
// bgs->process(...) method internally shows the foreground mask image
cv::Mat img_mask;
bgs->process(img_input img_mask);
if (!img_mask.empty())
{
// Perform blob tracking
blobTracking->process(img_input img_mask img_blob);
cv::imshow(“Abnormal Behavior“ img_blob);
// Perform vehicle counting
vehicleCouting->setInput(img_blob);
vehicleCouting->setTracks(blobTracking->getTracks());
vehicleCouting->process();
}
key = cvWaitKey(1);
}
delete vehicleCouting;
delete blobTracking;
delete bgs;
cvDestroyAllWindows();
cvReleaseCapture(&capture);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 378 2015-04-16 14:01 behavior identity\.gitattributes
文件 574 2015-04-16 14:01 behavior identity\.gitignore
文件 386 2015-04-16 14:01 behavior identity\config\.svn\all-wcprops
文件 719 2015-04-16 14:01 behavior identity\config\.svn\entries
文件 1599 2015-04-16 14:01 behavior identity\config\.svn\text-ba
文件 146 2015-04-16 14:01 behavior identity\config\.svn\text-ba
文件 305 2015-04-16 14:01 behavior identity\config\.svn\text-ba
文件 213 2015-04-16 14:01 behavior identity\config\BlobTracking.xm
文件 147 2015-04-16 14:01 behavior identity\config\fr
文件 1599 2015-04-16 14:01 behavior identity\config\fr
文件 437 2015-04-16 14:01 behavior identity\config\Pixelba
文件 146 2015-04-16 14:01 behavior identity\config\PreProcessor.xm
文件 296 2015-04-16 14:01 behavior identity\config\VehicleCouting.xm
文件 305 2015-04-16 14:01 behavior identity\config\VideoCapture.xm
文件 160 2015-04-16 14:01 behavior identity\dataset\.svn\all-wcprops
文件 383 2015-04-16 14:01 behavior identity\dataset\.svn\entries
文件 53 2015-04-16 14:01 behavior identity\dataset\.svn\prop-ba
文件 1049784 2015-04-16 14:01 behavior identity\dataset\.svn\text-ba
文件 1049784 2015-04-16 14:01 behavior identity\dataset\video.avi
文件 2219 2015-04-16 14:01 behavior identity\Demo.cpp
文件 39 2015-04-16 14:01 behavior identity\Direction.h
文件 288 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\App.xaml
文件 298 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\App.xaml.cs
文件 288 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\App.xaml
文件 298 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\App.xaml.cs
文件 695 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\ColorToBrushConverter.cs
文件 1263 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\HelpText.xaml
文件 1044 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\HelpTextWindow.xaml
文件 583 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\HelpTextWindow.xaml.cs
文件 4858 2015-04-16 14:01 behavior identity\DragMultipleSampleCode\Backup\MainWindow.xaml
............此处省略231个文件信息
- 上一篇:电子类毕业设计来电显示记录器
- 下一篇:不良数据辨识
相关资源
- qt+opencv视频图像采集与基于tcp协议的
- opencv2.4.3和4.0函数手册带目录可搜索
- 遗留物检测
- 笔记本OpenCV调用摄像头进行人脸捕捉
- VS+OPENCV手势识别
- opencv下haarclassifiercascade加上LBPHFaceRe
- 图片动漫风格化
- 基于SVM与ANN的车牌识别
- OpenCV实现同一窗口显示多幅图片
- haar特征的手势检测OpenCV
- 基于opencv的人脸表情识别的预处理
- opencv+qt+vs的摄像头视频显示和处理G
- OpenCV算法精解——源码和测试图片
- opencv结构光生成代码
- opencv 书籍
- 基于PCA的人脸识别系统
-
haartraining+ob
jectmarker,opencv,Adaboo - opencv提取光斑质心
- Ubuntu下Opencv显示中文
- 划痕缺陷检测
- 单USB双目摄像头拍摄程序
- RAAR相位恢复 opencv
- FTVd全变差去模糊opencv实现
- 全变差TV去噪(split bregman) opencv
- opencv开启本地摄像头并拍照
- 基于opencv的激光线中心提取源码
- opencv3.0 鱼眼标定校正 改进
- 简单的一维高斯滤波程序
- FreeType 结合opencv在图像上显示中文程
- Mastering OpenCV with Practical Computer Visio
评论
共有 条评论