资源简介
光流法(包括LK光流,HS光流,论文,opencv,matlab程序汇总)
代码片段和文件信息
/* --Sparse Optical Flow Demo Program--
* Written by David Stavens (david.stavens@ai.stanford.edu)
*/
#include
#include
#include
#include
static const double pi = 3.14159265358979323846;
inline static double square(int a)
{
return a * a;
}
/* This is just an inline that allocates images. I did this to reduce clutter in the
* actual computer vision algorithmic code. Basically it allocates the requested image
* unless that image is already non-NULL. It always leaves a non-NULL image as-is even
* if that image‘s size depth and/or channels are different than the request.
*/
inline static void allocateOnDemand( IplImage **img CvSize size int depth int channels )
{
if ( *img != NULL ) return;
*img = cvCreateImage( size depth channels );
if ( *img == NULL )
{
fprintf(stderr “Error: Couldn‘t allocate image. Out of memory?\n“);
exit(-1);
}
}
int main(void)
{
/* Create an object that decodes the input video stream. */
CvCapture *input_video = cvCaptureFromFile(
“C:\\Documents and Settings\\David Stavens\\Desktop\\223B-Demo\\optical_flow_input.avi“
);
if (input_video == NULL)
{
/* Either the video didn‘t exist OR it uses a codec OpenCV
* doesn‘t support.
*/
fprintf(stderr “Error: Can‘t open video.\n“);
return -1;
}
/* Read the video‘s frame size out of the AVI. */
CvSize frame_size;
frame_size.height =
(int) cvGetCaptureProperty( input_video CV_CAP_PROP_frame_HEIGHT );
frame_size.width =
(int) cvGetCaptureProperty( input_video CV_CAP_PROP_frame_WIDTH );
/* Determine the number of frames in the AVI. */
long number_of_frames;
/* Go to the end of the AVI (ie: the fraction is “1“) */
cvSetCaptureProperty( input_video CV_CAP_PROP_POS_AVI_RATIO 1. );
/* Now that we‘re at the end read the AVI position in frames */
number_of_frames = (int) cvGetCaptureProperty( input_video CV_CAP_PROP_POS_frameS );
/* Return to the beginning */
cvSetCaptureProperty( input_video CV_CAP_PROP_POS_frameS 0. );
/* Create a windows called “Optical Flow“ for visualizing the output.
* Have the window automatically change its size to match the output.
*/
cvNamedWindow(“Optical Flow“ CV_WINDOW_AUTOSIZE);
long current_frame = 0;
while(true)
{
static IplImage *frame = NULL *frame1 = NULL *frame1_1C = NULL *frame2_1C = NULL *eig_image = NULL *temp_image = NULL *pyramid1 = NULL *pyramid2 = NULL;
/* Go to the frame we want. Important if multiple frames are queried in
* the loop which they of course are for optical flow. Note that the very
* first call to this is actually not needed. (Because the correct position
* is set outsite the for() loop.)
*/
cvSetCaptureProperty( input_video CV_CAP_PROP_POS_frameS current_frame );
/* Get the next frame of the video.
* IMPORTANT! cvQueryframe() always returns a pointer to the _same_
* memory location. So suc
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11981 2012-03-06 09:44 optical_flow_demo.cpp
文件 13714 2012-03-08 16:19 光流法目标检测程序光流场.rar
文件 2039265 2012-03-06 09:40 光流法运动估计OpticalFlow.rar
文件 8087036 2012-03-06 09:43 智能识别.rar
文件 744221 2012-03-08 16:23 demolk.rar
文件 75638 2012-03-08 16:22 LKPR-marzat.zip
文件 2139292 2012-03-06 09:44 lucas_kanade.pdf
文件 5647203 2012-02-15 16:43 opencv光流示例程序.rar
----------- --------- ---------- ----- ----
18758350 8
相关资源
- ar自回归模型,附详解
- 光流法检测运动目标
- HS经典光流法
- 运动目标检测光流法
- 基于Lucas–Kanade算法的光流估计MATLA
- 基于视频的matlab光流法
- LK光流法MATLAB代码
- 光流法——matlab
- 基于光流法的车辆检测
- Random Walk (随机游走) matlab
- L-K光流法matlab实现
- 随机路径生成函数matlab
- optiflow 光流法程序
- 基于simulnk的LKA建模仿真
- 利用matlab的光流法实现显示光流的方
- 前景检测程序(Foreground-detection-proc
- 使用光流法(HS)的人群异常行为识别
- LK光流法对目标的跟踪
- image-registration
- streakline_code_v01 采用了光流法实现了目
- Code LK光流法的实现算法
- MSR-Identity-Toolkit-v1.0 微软研究院的说话
- LKDL_Package 该程序包是新的算法(LKD
- LKpticalFlow LK光流算法
- LKmatlab 基于光流法的光流检测matlab算
- 基于Lucas-kanade目标跟踪算法
- Yule-Walker法进行谱估计
- 周期图法、Yule-walker方程进行功率谱估
评论
共有 条评论