KCF作者主页http://www.robots.ox.ac.uk/~joao/circulant/
代码谨是对runtracker.cpp进行了修改,以便支持对视频和摄像头的跟踪,源代码是对图像序列的跟踪。
贴出修改后的runkcftracker.cpp
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "kcftracker.hpp"
using namespace std;
using namespace cv;
bool drawing_box = false;
bool gotBB = false;
Rect box;
//画矩形框
void drawBox(Mat& image, CvRect box, Scalar color, int thick){
rectangle(image, cvPoint(box.x, box.y), cvPoint(box.x + box.width, box.y + box.height), color, thick);
}
//鼠标追踪函数
void mouseHandler(int event, int x, int y, int flags, void *param){
switch (