recently, i need call the KCF tracker in my graduation project. the KCF tracker is fast and best performance now. see http://home.isr.uc.pt/~henriques/circulant/, however, this only matlab version of KCF code in the author's homepage. i need to implement KCF in c++ version, however, i find it is hard to do it, because this is no opencv version of fhog which is used in the matlab version. and the correlation of complex number is hard too. So in the last , i build Windows Standalone Application. and it is easy to improve in matlab.

so let do it now.

build matlab Windows Standalone Application

first let make a file runKCFexe.m

function runKCFexe( base_path ,video)
%./data/Benchmark/ Boy
interp_factor = 0.02;
kernel.sigma = 0.5;
kernel.type = 'gaussian';
kernel.poly_a = 1;
kernel.poly_b = 9;
feature_type = 'hog';
features.hog = true;
features.gray = false;
features.hog_orientations = 9;
cell_size = 4; padding = 1.5; %extra area surrounding the target
lambda = 1e-4; %regularization
output_sigma_factor = 0.1; %spatial bandwidth (proportional to target) [img_files, pos, target_sz, ground_truth, video_path] = load_video_info(base_path, video);
[positions, time] = tracker(video_path, img_files, pos, target_sz, ...
padding, kernel, lambda, output_sigma_factor, interp_factor, ...
cell_size, features, 0); fileID = fopen('centerPointResult.txt','w');
fprintf(fileID,'%d %d\n',positions');
fclose(fileID);
%fprintf('kcf finished %s\n','done');
end

and edit the tracker.m to the follow:

the box2[1] is the frame number and box2[2:5] is the rect box

add the reference files like follows

and then build

and we will get the KCFexe.exe

test run the KCFexe.exe

Yehh, it works

Qt C++ programming

let's build a q widget application

the OpenDir Button is used to select the dir path like

the Qlabe is used to show the image.

the project dir structure

the dirpath and video is the Parameters for KCFexe.exe

frameNo is used for read NO.image from capture , procOutput is used to get the frame num and rect box from KCFexe.exe output and store in the s_data,capturePath is used for VideoCapture.open function , program is the KCFexe.exe path,on_pushButton_clicked() is to select the dir,readyReadStandardOutput() is to read the KCFexe.exe output,processRect() is used to show image in Qlabel.RectReady() is signal for processRect.

init and connect

select dir

run the KCFexe.exe

read the output of KCFexe.exe

show image in Qlabel

Note ,because the speed of KCFexe.exe output is not the same with readyReadStandardOutput so the code is need in the processRect()

finnally ,it run like this

最新文章

  1. 代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
  2. haproxy安装
  3. 【原】iOS下KVO使用过程中的陷阱
  4. Weblogic11g下调WebService出现的一系列问题
  5. Js笔试题之parseInt()和.map()
  6. Flex之DataGrid和Tree控件的数据源XML格式
  7. Eclipse下如何导入jar包
  8. C#_deepCopy
  9. Java线程详解----借鉴
  10. 条件随机场CRF(二) 前向后向算法评估标记序列概率
  11. 自制vbs消息轰炸机
  12. [LeetCode] Random Flip Matrix 随机翻转矩阵
  13. C# 一些不注意知识点:命名空间,等级,class等等
  14. js——prototype、__proto__、constructor
  15. matlab中syms与sym有什么区别
  16. MATLAB中产生随机数的那些函数
  17. Java的Start和Runnable方法的区别
  18. [python,2018-01-15] 冒泡法排序
  19. 微信小程序开发——苹果手机领取卡券出现参数错误(安卓正常)
  20. 第三百七十三节,Django+Xadmin打造上线标准的在线教育平台—创建用户app,在models.py文件生成3张表,用户表、验证码表、轮播图表

热门文章

  1. wordpress可视化编辑器的开启/关闭
  2. PHP如何提取img标签属性
  3. [iOS]集成环信SDK然后运行时候crash了-[NSBundle initWithURL:]: nil URL argument'
  4. iOS:UIView的block函数实现转场动画---单视图
  5. Java基础复习之二:运算符,键盘录入,流程控制语句,if语句,三元运算
  6. dojo 十 ajax dojo/_base/xhr
  7. ubuntu 搭建Erlang开发环境
  8. hdu4427Math Magic
  9. HDu 3449 (有依赖的01背包) Consumer
  10. 51nod1201 整数划分