引用了KCF作者的源代码,github开源地址https://github.com/joaofaro/KCFcpp
自己新建一个vs2015控制台程序,在win10系统下跑通,实现了框选区域跟踪,而且特征可以选择,避免了编译opencv的痛苦。下一步,增加行人检测代码,实现实时行人检测跟踪。
不多废话,直接源代码:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "kcftracker.hpp"
//#include <dirent.h>
using namespace std;
using namespace cv;
int main(int argc, char* argv[]) {
if (argc > 5) return -1;
bool HOG = true;
bool FIXEDWINDOW = false;
bool MULTISCALE = true;
bool SILENT = true;
bool LAB = false;<