日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

HCFT和HCFTstar在OTB数据集中测试的接口函数

發布時間:2024/1/1 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HCFT和HCFTstar在OTB数据集中测试的接口函数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

HCFT跟蹤算法(Hierarchical Convolutional Features for Visual Tracking)是2015年發表在ICCV上的一篇結合相關濾波和深度特征的跟蹤算法,作者Chao Ma、Jia-Bin Huang、Xiaokang Yang、
Ming-Hsuan Yang。
HCFTstar(Robust Visual Tracking via Hierarchical Convolutional Features)是原作者在HCFT基礎上的改進,改進了尺度估計和重檢測機制。
在OTB數據集上測試兩個算法時需要接口函數(前提是已經調試通了兩個算法),如下:
HCFT算法的接口函數 run_HCFT.m

function results = run_HCFT(seq, res_path, bSaveImage)addpath('utility','model','cf_scale','external/matconvnet/matlab');vl_setupnn();padding = struct('generic', 1.8, 'large', 1, 'height', 0.4);lambda = 1e-4; % Regularization parameter (see Eqn 3 in our paper)output_sigma_factor = 0.1; % Spatial bandwidth (proportional to the target size)interp_factor = 0.01; % Model learning rate (see Eqn 6a, 6b)cell_size = 4; % Spatial cell sizeshow_visualization = 0;global enableGPU;enableGPU = false;target_sz = seq.init_rect(1,[4,3]);pos = seq.init_rect(1,[2,1]) + floor(target_sz/2);img_files = seq.s_frames;video_path = [];% Call tracker function with all the relevant parameters[rects, time] = tracker_ensemble(video_path, img_files, pos, target_sz, ...padding, lambda, output_sigma_factor, interp_factor, ...cell_size, show_visualization);if bSaveImageimwrite(frame2im(getframe(gcf)),[res_path num2str(frame) '.jpg']); endfps = numel(img_files) / time;results.type = 'rect'; results.res = rects;%each row is a rectangle results.fps = fps; end

HCFTstar算法的接口函數 run_HCFTstar.m

function results = run_HCFTstar(seq, res_path, bSaveImage)addpath('utility','train');% Path to MatConvNet. Please run external/matconvnet/vl_compilenn.m to% set up the MatConvNetaddpath './matconvnet/matlab'vl_setupnn();% Where the 'imagenet-vgg-verydeep-19.mat' file isaddpath './vgg_model'addpath(genpath('edgesbox'));addpath(genpath('piotr_toolbox'));addpath(genpath('Diagnose'))% Extra area surrounding the targetpadding = struct('generic', 1.8, 'large', 1, 'height', 0.4);lambda = 1e-4; % Regularization parameter (see Eqn 3 in our paper)output_sigma_factor = 0.1; % Spatial bandwidth (proportional to the target size)interp_factor = 0.01; % Model learning rate (see Eqn 6a, 6b)cell_size = 4; % Spatial cell sizeconfig.kernel_sigma = 1;config.motion_thresh= 0.181; %0.25 for singer2 0.32;%0.15config.appearance_thresh=0.38; %0.38config.features.hog_orientations = 9;config.features.cell_size = 4; % size of hog grid cell config.features.window_size = 6; % size of local region for intensity historgram config.features.nbins=8; show_visualization = 0;global enableGPU;enableGPU = true;target_sz = seq.init_rect(1,[4,3]);pos = seq.init_rect(1,[2,1]) + floor(target_sz/2);img_files = seq.s_frames;video_path = [];[positions, time,rect_position] = tracker_HCFTstar(video_path, img_files, pos, target_sz, ...padding, lambda, output_sigma_factor, interp_factor, ...cell_size, show_visualization,config); %tracker_ensemble_RPnew1 if bSaveImageimwrite(frame2im(getframe(gcf)),[res_path num2str(frame) '.jpg']); endfps = numel(img_files) / time;results.type = 'rect'; results.res = rect_position;%each row is a rectangle results.fps = fps; end

寫接口函數需要注意的幾點:
一、 輸入參數(seq, res_path, bSaveImage),這3個參數是OTB數據集的工具包tracker_benchmark_v1.0中main_running.m文件使用的,其中指定了參數的具體指。
二、 先把具體算法中用到的準備工作寫出來,比如添加路徑、編譯操作、運行參數等。
三、 添加一句

show_visualization = 0;

因為是在數據集中測試,不需要實時觀看算法效果,就把這個可視化的標志位設為0。
四、 這幾句基本都會用上

target_sz = seq.init_rect(1,[4,3]);pos = seq.init_rect(1,[2,1]) + floor(target_sz/2);img_files = seq.s_frames;video_path = [];

這幾句使用工具包中 main_running.m 給定的參數來給出初始化的相關信息。
五、 調用算法主程序,比如上面

[positions, time,rect_position] = tracker_HCFTstar(video_path, img_files, pos, target_sz, ...padding, lambda, output_sigma_factor, interp_factor, ...cell_size, show_visualization,config); %tracker_ensemble_RPnew1

這里 tracker_HCFTstar( ) 函數用到的各個參數都要在上面的步驟中給定。
六、

if bSaveImageimwrite(frame2im(getframe(gcf)),[res_path num2str(frame) '.jpg']); end

這句都要用,用來保存數據。
七、 最后賦值的幾句:

fps = numel(img_files) / time;results.type = 'rect'; results.res = rect_position;%each row is a rectangle results.fps = fps;

就是把結果賦給results。主要是 results.res 要根據算法的主程序的輸出值來確定,要找到算法最終預測的目標框。

總結

以上是生活随笔為你收集整理的HCFT和HCFTstar在OTB数据集中测试的接口函数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。