资源简介
根据物体移动的速度和大小检测物体的异常行为 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个文件信息
- 上一篇:电子类毕业设计来电显示记录器
- 下一篇:不良数据辨识
相关资源
- 基于OpenCV的数字识别468815
- 使用opencv去掉二值化图像中黑色面积
- opencv环境配置
- win10 64位下编译的opencv4.5.5库,opencv
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- opencv_contrib-3.4.0.zip
- opencv2.4.9源码分析——SIFT
- 用两个摄像头实现,双目标定,双目
- opencv_traincascade训练分类器,手势识别
- opencv3.0交叉编译用parallel.cpp
- 基于opencv的图像识别识别图像中的色
- 基于openCV的识别特定颜色区域
- 基于OpenCV的分水岭算法实现
- QT+opencv+OCR 身份证号码,银行卡号识别
- opencv视频特定颜色区域识别
- 把RGB转换为HSV和HSI然后根据黄色和蓝
- opencv视觉测距
- 基于Qt和opencv的身份证号码识别系统
- opencv_ffmpeg249.dll
- SfM稀疏三维点云重建--完整工程文件
- 基于opencv的数人头程序源代码
- 利用OpenCV中的Stitcher类实现全景图像拼
- opencv实现的sift算法源码,包含了图像
- openCV 上的小波变换
- 基于OPENCV的车牌识别系统设计
- 617张国内车牌60-17bmp图片用于OpenCV正样
- hog特征提取,c版本代码
- 基于Qt5.8+OpenCV3.2的Basler多相机触发开
- 基于Opencv实现的图像纠偏
- ImageWatch2019.vsix
评论
共有 条评论