资源简介

用于自己保存VOT数据集的结果,将生成的.txt文件拷贝到vot-toolkit中就可以进行实验分析。本代码以csr-dcf为例。使用参考博客:https://blog.csdn.net/qq_17783559/article/details/90485701

资源截图

代码片段和文件信息

clear;clc;
close all;
% set this to tracker directory
tracker_path = ‘./csr-dcf/‘;
% add paths
addpath(tracker_path);
addpath(fullfile(tracker_path ‘mex‘));
addpath(fullfile(tracker_path ‘utils‘));
addpath(fullfile(tracker_path ‘features‘));
addpath(‘./compute_polygon_overlap/‘);
% 数据集路径路径
base_path  = ‘D:/Datasets/vot2016/‘;
% 视频序列
videos = {‘bag‘‘ball1‘‘ball2‘‘basketball‘‘birds1‘‘birds2‘‘blanket‘‘bmx‘‘bolt1‘...
           ‘bolt2‘‘book‘‘butterfly‘‘car1‘‘car2‘‘crossing‘‘dinosaur‘‘fernando‘‘fish1‘...
           ‘fish2‘‘fish3‘‘fish4‘‘girl‘‘glove‘‘godfather‘‘graduate‘‘gymnastics1‘...
           ‘gymnastics2‘‘gymnastics3‘‘gymnastics4‘‘hand‘‘handball1‘‘handball2‘...
           ‘helicopter‘‘iceskater1‘‘iceskater2‘‘leaves‘‘marching‘‘matrix‘‘motocross1‘...
           ‘motocross2‘‘nature‘‘octopus‘‘pedestrian1‘‘pedestrian2‘‘rabbit‘‘racing‘...
           ‘road‘‘shaking‘‘sheep‘‘singer1‘‘singer2‘‘singer3‘‘soccer1‘‘soccer2‘...
           ‘soldier‘‘sphere‘‘tiger‘‘traffic‘‘tunnel‘‘wiper‘};
% videos = {‘rabbit‘};

% 跟踪器名字
trackerName=‘csr-dcftest‘;
% 保存路径
savePath=‘./results/‘;
% 生成跟踪器路径
mkdir([savePath trackerName]);
% 生成baseline路径
mkdir([savePath trackerName ‘/baseline‘]);
% 生成unsupervised路径
mkdir([savePath trackerName ‘/unsupervised‘]);

for vid = 1:numel(videos)
    close all;
    disp(videos{vid});
    % 视频路径总路径
    sequence_path = [base_pathvideos{vid}‘/‘]; 
    % 图片获取序列
    img_files = dir(fullfile(sequence_path ‘*.jpg‘));
    % 图片序列名字
    img_files = {img_files.name};
    % 获取groundtruth文件
    ground_truth=dlmread(fullfile(sequence_path ‘groundtruth.txt‘));   
    % 视频帧数
    num_frames=size(ground_truth1);
    % 初始化baseline时间(15次)
    timeb = zeros(num_frames 15);
    % 初始化unsupervised时间(1次)
    timeu = zeros(num_frames 1);
    
    %---------------------------------------------------------
    % baseline 实验
    %---------------------------------------------------------
    startframe=1;
    finishflag=0;
    % 预声明目标框
    rect_positionb = cell(num_frames1);
    rect_positionb{1}=1;
    while(1)
        % 初始化
        tic();
        % 读取第一帧
        image = imread([sequence_path ‘/‘ img_files{startframe}]);
        [wh~]=size(image);
        % 读取groundtruth
        region=ground_truth(startframe:);
        if numel(region) > 4
        % all xy points shifted by 1
            region = region + 1;
        else
            % shift xy by 1
            region(1:2) = region(1:2) + 1;
        end
        % 初始化
        [tracker ~] = create_csr_tracker(image region);
        % 记录初始化时间
        timeb(startframe1:3) = toc();
        % 从第二帧开始检测
        for frame=startframe+1:num_frames
            % 开始计时
            tic();
            % 跟踪代码,从第二帧开始
            image = imread([sequence_path ‘/‘ img_files{frame}]);
            [tracker region] = track_csr_tracker(tracker image);

            % matlab indexing

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-05-28 21:02  SaveVOTresults\
     目录           0  2019-05-29 16:45  SaveVOTresults\compute_polygon_overlap\
     文件         195  2019-05-29 16:40  SaveVOTresults\compute_polygon_overlap\computeArea.m
     文件         342  2018-03-21 19:55  SaveVOTresults\compute_polygon_overlap\computeIntersectionArea.m
     文件        1041  2019-05-29 16:43  SaveVOTresults\compute_polygon_overlap\compute_polygon_overlap.m
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\
     文件        1937  2018-06-14 13:40  SaveVOTresults\csr-dcf\compile.m
     文件        9641  2019-05-27 17:09  SaveVOTresults\csr-dcf\create_csr_tracker.m
     文件        2131  2019-03-02 14:36  SaveVOTresults\csr-dcf\csr_wrapper.m
     文件        2448  2019-03-11 14:27  SaveVOTresults\csr-dcf\demo_csr.m
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\features\
     文件        2966  2018-02-26 04:49  SaveVOTresults\csr-dcf\features\fhog.m
     文件        3427  2018-02-26 04:49  SaveVOTresults\csr-dcf\features\gradientHist.m
     文件        2340  2018-02-26 04:49  SaveVOTresults\csr-dcf\features\gradientMag.m
     文件        1201  2018-02-26 04:49  SaveVOTresults\csr-dcf\features\im2c.m
     文件     1142188  2018-02-26 04:49  SaveVOTresults\csr-dcf\features\w2crs.mat
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\mex\
     文件       37376  2018-06-14 13:41  SaveVOTresults\csr-dcf\mex\gradientMex.mexw64
     文件       44544  2018-06-14 13:41  SaveVOTresults\csr-dcf\mex\mex_extractbackground.mexw64
     文件       45568  2018-06-14 13:41  SaveVOTresults\csr-dcf\mex\mex_extractforeground.mexw64
     文件       86528  2018-06-14 13:41  SaveVOTresults\csr-dcf\mex\mex_segment.mexw64
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\mex_src\
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\mex_src\hog\
     文件       18892  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\hog\gradientMex.cpp
     文件       19248  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\hog\MxArray.cpp
     文件       34982  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\hog\MxArray.hpp
     文件        3125  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\hog\sse.hpp
     文件        1573  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\hog\wrappers.hpp
     目录           0  2019-05-27 16:45  SaveVOTresults\csr-dcf\mex_src\segmentation\
     文件        1898  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\segmentation\mex_extractbackground.cpp
     文件        1460  2018-02-26 04:49  SaveVOTresults\csr-dcf\mex_src\segmentation\mex_extractforeground.cpp
............此处省略508个文件信息

评论

共有 条评论