程序说明
// 程序描述:来自OpenCV安装目录下Samples文件夹中的官方示例程序-点追踪技术演示
// 源码路径:opencv\sources\samples\cpp\lkdemo.cpp
// 操作系统: Windows 10 64bit
// 开发语言: C++
// IDE 版 本:Visual Studio 2019
// OpenCV版本:4.20
代码
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <ctype.h>
using namespace cv;
using namespace std;
static void help()
{
// print a welcome message, and the OpenCV version
cout << "\nThis is a demo of Lukas-Kanade optical flow lkdemo() -该Demo演示了 Lukas-Kanade基于光流的lkdemo,\n"
"Using OpenCV version " << CV_VERSION << endl;
cout << "\nIt uses camera by default, but you can provide a path to video as an argument -程序默认从摄像头读