稠密特征的光流opencv3.2+VS

1.光流简单概述

Optical flow or optic flow is the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between an observer and a scene.
Sequences of ordered images allow the estimation of motion as either instantaneous image velocities or discrete image displacements.
图像序列允许使用图片(像素)速度离散图片位置来估计光流。


2.opencv3.2可用的三种计算稠密特征的算法

  • 2.0函数简介
    1. Lucas–Kanade算法在opencv3.2(calcOpticalFlowPyrLK)得到的就是离散的位置,也就是输出像素点。
    2. Gunnar Farneback(calcOpticalFlowFarneback)得到的是速度(个人认为),flow是像素点的差值。
    3. SimpleFlow(calcOpticalFlowSF)也得到的是速度
  • 2.1函数API介绍

    Lucas–Kanade, Gunnar Farneback属于 Object TrackingVideo Analysis模块docs.opencv
    SimpleFlow属于 Optical Flow Algorithms模块docs.opencv

  • 2.2运行时间

    SimpleFlow运行大概要10sec,处理475*402*3的图片。Lucas–Kanade,Gunnar Farneback,处理475*402*1,则不到1sec。

3.代码部分C++

参考博客参考这个博客的显示的方法,这个博客是将视频逐frame标出光流。
函数API见上文模块信息。

#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include "opencv2/optflow.hpp"
#include "opencv2/highgu
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值