TLD(Tracking-Learning-Detection)学习与源码理解之(四)
下面是自己在看论文和这些大牛的分析过程中,对进行了一些理解,但是由于自己接触图像处理和机器视觉没多久,另外由于自己能力比较弱,所以分析过程可能会有不少的错误,希望各位不吝指正。而且,因为很多地方不懂,所以注释得非常乱,还海涵。
run_tld.cpp
- #include <opencv2/opencv.hpp>
- #include <tld_utils.h>
- #include <iostream>
- #include <sstream> //c++中的sstream类,提供了和string对象之间的I/O,可以通过ostringstream
- //和instringstream两个类来声明对象,分别对应输出流和输入流
- #include <TLD.h>
- #include <stdio.h>
- using namespace cv;
- using namespace std;
- // 全局变量
- Rect box;
- bool drawing_box = false;
- bool gotBB = false;
- bool tl = true;
- bool rep = false;
- bool fromfile=false;
- string video;
- //读取记录bounding box的文件,获得bounding box的四个参数:左上角坐标x,y和宽高
- /*如在\datasets\06_car\init.txt中:记录了初始目标的bounding box,内容如下
- 142,125,232,164
- */
- void readBB(char* file){
- ifstream bb_file (file); //以输入方式打开文件
- string line;
- //istream& getline ( istream& , string& );
- //将输入流is中读到的字符存入str中,终结符默认为 '\n'(换行符)
- getline(bb_file, line);
- istringstream linestream(line);