Opencv 稀疏光流法跟踪详细教程

本文深入探讨了使用Opencv进行稀疏光流法跟踪的技术细节,包括关键步骤、算法原理和实际应用案例,为图像处理领域的研究人员和开发者提供了宝贵的实践指导。
摘要由CSDN通过智能技术生成

Opencv 稀疏光流法跟踪详细教程

#include <iostream>  
#include <opencv2/core/core.hpp>  
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <math.h>
#include <stdio.h>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <chrono>
#include <fstream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>

#include "opencv2/calib3d/calib3d.hpp"
#include <cctype>
#include <string.h>
#include <time.h>

#include <windows.h>
#include <cstdio>
#include<windows.h>
#include"glew.h"
#include<GL/GL.h>
#include<GL/GLU.h>

//#include <sl/Camera.hpp>

using namespace std;
using namespace cv;

Mat frame,gray;
Mat pre_frame, pre_gray;
//通过容器将角点特征数据保存起来
vector<Point2f>features;

//定义两个容器将特征点保存起来
//初始化特征数据
vector<Point2f>inPoints;
//保存两帧的特征点,一个是前一帧,一个是当前帧
vector<Point2f>fpts[2];
//calcOpticalFlowPyrLK这个函数里面的一个追踪成功标志位和追踪区域误差
vector<uchar>status;
vector<float>errors;

//特征点检测---角点检测
void detectFeatures(Mat &inframe, Mat &ingray);
//将角点检测的结果绘制出来
void drawFeature(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值