资源简介
轨迹提取,用于视频事件检测等,非常好用!
代码片段和文件信息
#include “DenseTrack.h“
#include “Descriptors.h“
#include “Initialize.h“
IplImageWrapper image prev_image grey prev_grey;
IplImagePyramid grey_pyramid prev_grey_pyramid eig_pyramid;
CvCapture* capture = 0;
float* fscales = 0; // float scale values
int show_track = 0; // set show_track = 1 if you want to visualize the trajectories
int main( int argc char** argv )
{
int frameNum = 0;
TrackerInfo tracker;
DescInfo hogInfo;
DescInfo hofInfo;
DescInfo mbhInfo;
char* video = argv[1];
arg_parse(argc argv);
// std::cerr << “start_frame: “ << start_frame << “ end_frame: “ << end_frame << “ track_length: “ << track_length << std::endl;
// std::cerr << “min_distance: “ << min_distance << “ patch_size: “ << patch_size << “ nxy_cell: “ << nxy_cell << “ nt_cell: “ << nt_cell << std::endl;
InitTrackerInfo(&tracker track_length init_gap);
InitDescInfo(&hogInfo 8 0 1 patch_size nxy_cell nt_cell);
InitDescInfo(&hofInfo 9 1 1 patch_size nxy_cell nt_cell);
InitDescInfo(&mbhInfo 8 0 1 patch_size nxy_cell nt_cell);
capture = cvCreateFileCapture(video);
if( !capture ) {
printf( “Could not initialize capturing..\n“ );
return -1;
}
if( show_track == 1 )
cvNamedWindow( “DenseTrack“ 0 );
std::vector > xyScaleTracks;
int init_counter = 0; // indicate when to detect new feature points
while( true ) {
IplImage* frame = 0;
int i j c;
// get a new frame
frame = cvQueryframe( capture );
if( !frame ) {
//printf(“break“);
break;
}
if( frameNum >= start_frame && frameNum <= end_frame ) {
if( !image ) {
// initailize all the buffers
image = IplImageWrapper( cvGetSize(frame) 8 3 );
image->origin = frame->origin;
prev_image= IplImageWrapper( cvGetSize(frame) 8 3 );
prev_image->origin = frame->origin;
grey = IplImageWrapper( cvGetSize(frame) 8 1 );
grey_pyramid = IplImagePyramid( cvGetSize(frame) 8 1 scale_stride );
prev_grey = IplImageWrapper( cvGetSize(frame) 8 1 );
prev_grey_pyramid = IplImagePyramid( cvGetSize(frame) 8 1 scale_stride );
eig_pyramid = IplImagePyramid( cvGetSize(frame) 32 1 scale_stride );
cvCopy( frame image 0 );
cvCvtColor( image grey CV_BGR2GRAY );
grey_pyramid.rebuild( grey );
// how many scale we can have
scale_num = std::min(scale_num grey_pyramid.numOfLevels());
fscales = (float*)cvAlloc(scale_num*sizeof(float));
xyScaleTracks.resize(scale_num);
for( int ixyScale = 0; ixyScale < scale_num; ++ixyScale ) {
std::list
- 上一篇:基于单片机的图书馆人流量统计器的设计
- 下一篇:物流配送路线规划系统
相关资源
- GPS数据提取轨迹重现系统
- GPS轨迹重现
- 铱星系统STK轨迹仿真场景平台
- 绘制根轨迹的各种规则与技巧
- Unity Vectrosity5.6 最新版
- cesium 卫星轨迹模拟 czml
- 用户浏览轨迹算法分析与应用
- 百度鹰眼API 轨迹追踪的实现
- 运动控制算法轨迹规划
- 百度无人驾驶数据.zip
- 实现咕咚地图路径颜色根据速度不同
- 计算机图形学课程设计--OpenGL--太阳、
- 2019超级轨迹赛任务块.cdr
- 百度地图:行走轨迹,轨迹回放
- 轨迹优化软件gpops5.2
- GPS数据转谷歌地图轨迹的工具NMEA2KM
- 计算飞机的飞行轨迹
- 深度学习方法预测车辆轨迹
- Trajectory Planning for Automatic Machines and
- 交通轨迹数据80万个点
- 出租车轨迹数据
- 基于百度地图的轨迹追踪服务.rar
- Trajectory Planning for Automatic Machines and
- GPS轨迹大数据集 Geolife Trajectories 1.3
- 百度地图轨迹回放安卓
- VCOpenCV视频前景物体提取标出运动轨迹
- ABB轨迹类_机械臂切割
- 气象轨迹模式HYSPLIT4单机版软件
- Google GPS轨迹记录软件 MyTracks源码整理
- 磁共振成像k空间采样轨迹的具体说明
评论
共有 条评论