欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

【目标追踪】基于matlab KCF目标跟踪【含matlab源码 784期】

最编程 2023-12-31 08:52:54
...
%
% High-Speed Tracking with Kernelized Correlation Filters
%
% Joao F. Henriques, 2014
% http://www.isr.uc.pt/~henriques/
%
% Main interface for Kernelized/Dual Correlation Filters (KCF/DCF).
% This function takes care of setting up parameters, loading video
% information and computing precisions. For the actual tracking code,
% check out the TRACKER function.
% RUN_TRACKER
% Without any parameters, will ask you to choose a video, track using
% the Gaussian KCF on HOG, and show the results in an interactive
% figure. Press 'Esc' to stop the tracker early. You can navigate the
% video using the scrollbar at the bottom.
% RUN_TRACKER VIDEO
% Allows you to select a VIDEO by its name. 'all' will run all videos
% and show average statistics. 'choose' will select one interactively.
%
% RUN_TRACKER VIDEO KERNEL
% Choose a KERNEL. 'gaussian'/'polynomial' to run KCF, 'linear' for DCF.
%
% RUN_TRACKER VIDEO KERNEL FEATURE
% Choose a FEATURE type, either 'hog' or 'gray' (raw pixels).
%
% RUN_TRACKER(VIDEO, KERNEL, FEATURE, SHOW_VISUALIZATION, SHOW_PLOTS)
% Decide whether to show the scrollable figure, and the precision plot.
%
% Useful combinations:
% >> run_tracker choose gaussian hog %Kernelized Correlation Filter (KCF)
% >> run_tracker choose linear hog %Dual Correlation Filter (DCF)
% >> run_tracker choose gaussian gray %Single-channel KCF (ECCV'12 paper)
% >> run_tracker choose linear gray %MOSSE filter (single channel)


function [precision, fps] = run_tracker(video, kernel_type, feature_type, show_visualization, show_plots)

%path to the videos (you'll be able to choose one with the GUI).
base_path = './data/Benchmark/';

%default settings
if nargin < 1, video = 'choose'; end%choose和otherwise是不一样的,otherwise没有显示追踪界面
if nargin < 2, kernel_type = 'gaussian'; end
if nargin < 3, feature_type = 'hog'; end
if nargin < 4, show_visualization = ~strcmp(video, ''); end
if nargin < 5, show_plots = ~strcmp(video, ''); end

%parameters according to the paper. at this point we can override
%parameters based on the chosen kernel or feature type
kernel.type = kernel_type;

features.gray = false;
features.hog = false;
features.Fisher = false;

% padding = 1.5; %extra area surrounding

上一篇: 深入探索Jackson的使用方法:如何在路径中提取JsonNode字段

下一篇: java kcf