struck(结构化SVM用于视觉跟踪)--源代码详解--main.cpp

STRUCK是一种基于结构化SVM的视觉跟踪算法,在深度学习普及前,它在视觉跟踪领域表现出色。尽管深度学习后来成为主流,但STRUCK仍因其能使用任意特征(包括卷积神经网络特征)的优势受到青睐。STRUCK的C++源代码清晰、结构化,与理论相符,使得其跟踪结果可信。主要关注点在于`tracker`类的`Initialize`、`Debug`和`Track`等关键函数。
摘要由CSDN通过智能技术生成

struck 利用结构化SVM来实现视觉跟踪,在深度学习流行起来之前,struck是视觉跟踪领域效果最好的方法。深度学习流行之后,利用泛化的卷积特征能够得到很好的效果。struck的优点在于,它可以使用任意的特征来实现跟踪,因此它可以利用卷积神经网络提取的特征,然后结合结构化SVM来实现视觉跟踪,这样的效果说不定更好。

struck的源码是C++实现的,作者写的很好,思路清晰,代码结构清晰,而且与论文中的相符,没有那么多小trick,结果比较可靠。

下面从它的主函数开始,分析这份源码是如何实现的:

main.cpp

/* 
 * Struck: Structured Output Tracking with Kernels
 * 
 * Code to accompany the paper:
 *   Struck: Structured Output Tracking with Kernels
 *   Sam Hare, Amir Saffari, Philip H. S. Torr
 *   International Conference on Computer Vision (ICCV), 2011
 * 
 * Copyright (C) 2011 Sam Hare, Oxford Brookes University, Oxford, UK
 * 
 * This file is part of Struck.
 * 
 * Struck is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Struck is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Struck.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
 
#include "Tracker.h"
#include "Config.h"

#include <iostream>
#include <fstream>

#include <opencv/cv.h>
#include <opencv/highgui.h>

using namespace std;
using namespace cv;

static const int kLiveBoxWidth = 80;
static const int kLiveBoxHeight = 80;

void rectangle(Mat& rMat, const FloatRect& rRect, const Scalar& rColour)
{
	IntRect r(rRect);
	rectangle(rMat, Point(r.XMin(), r.YMin()), Point(r.XMax(), r.YMax()), rColour);
}

int main(int argc, char* argv[])
{

//这几句话没啥作用,我给注释掉
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值