首页 > 编程知识 正文

meanshift跟踪算法,ccot检测报告

时间:2023-05-04 08:51:56 阅读:266283 作者:229

C-COT算法作者其实已经给出了在几个数据集中测试的原始结果,其中也包括了OTB数据集。但是如果我们想要自己测试需要怎么写接口函数呢?

run_CCOT.m

function results=run_CCOT(seq, res_path, bSaveImage)close all%% Add the neccesary paths[pathstr, name, ext] = fileparts(mfilename('fullpath'));% Tracker implementationaddpath([pathstr '/implementation/']);% Runfilesaddpath([pathstr '/runfiles/']);% Utilitiesaddpath([pathstr '/utils/']);% The feature extractionaddpath(genpath([pathstr '/feature_extraction/']));% Matconvnetaddpath([pathstr '/external_libs/matconvnet/matlab/mex/']);addpath([pathstr '/external_libs/matconvnet/matlab']);addpath([pathstr '/external_libs/matconvnet/matlab/simplenn']);% PDollar toolboxaddpath(genpath([pathstr '/external_libs/pdollar_toolbox/channels']));% Mtimesxaddpath([pathstr '/external_libs/mtimesx/']);%%% Feature specific parametershog_params.cell_size = 4;grayscale_params.colorspace='gray';grayscale_params.cell_size = 1;cn_params.tablename = 'CNnorm';cn_params.useForGray = false;cn_params.cell_size = 4;ic_params.tablename = 'intensityChannelNorm6';ic_params.useForColor = false;ic_params.cell_size = 4;cnn_params.nn_name = 'imagenet-vgg-m-2048.mat'; % Name of the networkcnn_params.output_layer = [0 3 14]; % Which layers to usecnn_params.downsample_factor = [4 2 1]; % How much to downsample each output layercnn_params.input_size_mode = 'adaptive'; % How to choose the sample sizecnn_params.input_size_scale = 1; % Extra scale factor of the input samples to the network (1 is no scaling)% Which features to includeparams.t_features = { struct('getFeature',@get_cnn_layers, 'fparams',cnn_params),... ...struct('getFeature',@get_colorspace, 'fparams',grayscale_params),... ...struct('getFeature',@get_fhog,'fparams',hog_params),... ...struct('getFeature',@get_table_feature, 'fparams',cn_params),... ...struct('getFeature',@get_table_feature, 'fparams',ic_params),...};% Global feature parametersparams.t_global.normalize_power = 2; % Lp normalization with this pparams.t_global.normalize_size = true; % Also normalize with respect to the spatial size of the featureparams.t_global.normalize_dim = true; % Also normalize with respect to the dimensionality of the feature% Image sample parametersparams.search_area_shape = 'square'; % The shape of the samplesparams.search_area_scale = 5.0; % The scaling of the target size to get the search areaparams.min_image_sample_size = 200^2; % Minimum area of image samplesparams.max_image_sample_size = 300^2; % Maximum area of image samples% Detection parametersparams.refinement_iterations = 1; % Number of iterations used to refine the resulting position in a frameparams.newton_iterations = 5; % The number of Newton iterations used for optimizing the detection score% Learning parametersparams.output_sigma_factor = 1/12;% Label function sigmaparams.learning_rate = 0.0075;% Learning rateparams.nSamples = 400; % Maximum number of stored training samplesparams.sample_replace_strategy = 'lowest_prior'; % Which sample to replace when the memory is fullparams.lt_size = 0; % The size of the long-term memory (where all samples have equal weight)% Conjugate Gradient parametersparams.max_CG_iter = 5; % The number of Conjugate Gradient iterationsparams.init_max_CG_iter = 100; % The number of Conjugate Gradient iterations used in the first frameparams.CG_tol = 1e-3; % The tolerence of CG does not have any effectparams.CG_forgetting_rate = 10; % Forgetting rate of the last conjugate directionparams.precond_data_param = 0.5; % Weight of the data term in the preconditionerparams.precond_reg_param = 0.01; % Weight of the regularization term in the preconditioner% Regularization window parametersparams.use_reg_window = true; % Use spatial regularization or notparams.reg_window_min = 1e-4;% The minimum value of the regularization windowparams.reg_window_edge = 10e-3; % The impact of the spatial regularizationparams.reg_window_power = 2; % The degree of the polynomial to use (e.g. 2 is a quadratic window)params.reg_sparsity_threshold = 0.05; % A relative threshold of which DFT coefficients that should be set to zero% Interpolation parametersparams.interpolation_method = 'bicubic'; % The kind of interpolation kernelparams.interpolation_bicubic_a = -0.75; % The parameter for the bicubic interpolation kernelparams.interpolation_centering = true; % Center the kernel at the feature sampleparams.interpolation_windowing = false; % Do additional windowing on the Fourier coefficients of the kernel% Scale parametersparams.number_of_scales = 5; % Number of scales to run the detectorparams.scale_step = 1.02; % The scale factor% Other parametersparams.visualization = 0; % Don't visualiza tracking and detection scoresparams.debug = 0; % Do full debug visualizations_frames = seq.s_frames;% Initializeparams.wsize = [seq.init_rect(1,4), seq.init_rect(1,3)];params.init_pos = [seq.init_rect(1,2), seq.init_rect(1,1)曾经的小熊猫 floor(params.wsize/2);params.s_frames = s_frames;% Run trackerresults = tracker(params); if bSaveImage imwrite(frame2im(getframe(gcf)),[res_path num2str(frame) '.jpg']); end end

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。