全选load_video_info.m
代码,直接替换为下面代码即可
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47function [img_files, pos, target_sz, ground_truth, video_path] = load_video_info(video_path) % [img_files, pos, target_sz, ground_truth, video_path] = load_video_info(video_path) % text_files = dir([video_path '*_frames.txt']); % f = fopen([video_path text_files(1).name]); % frames = textscan(f, '%f,%f'); % fclose(f); text_files = dir([video_path 'groundtruth_rect.txt']); assert(~isempty(text_files), 'No initial position and ground truth (*_gt.txt) to load.') f = fopen([video_path text_files(1).name]); ground_truth = textscan(f, '%f,%f,%f,%f'); %[x, y, width, height] ground_truth = cat(2, ground_truth{:}); fclose(f); frames{1} = 1; frames{2} = size(ground_truth,1); %set initial position and size target_sz = [ground_truth(1,4), ground_truth(1,3)]; pos = [ground_truth(1,2), ground_truth(1,1)]; ground_truth = [ground_truth(:,[2,1]) + (ground_truth(:,[4,3]) - 1) / 2 , ground_truth(:,[4,3])]; %see if they are in the 'imgs' subfolder or not if exist([video_path num2str(frames{1}, 'img/%04i.png')], 'file'), video_path = [video_path 'img/']; img_files = num2str((frames{1} : frames{2})', '%04i.png'); elseif exist([video_path num2str(frames{1}, 'img/%04i.jpg')], 'file'), video_path = [video_path 'img/']; img_files = num2str((frames{1} : frames{2})', '%04i.jpg'); elseif exist([video_path num2str(frames{1}, 'img/%04i.bmp')], 'file'), video_path = [video_path 'img/']; img_files = num2str((frames{1} : frames{2})', '%04i.bmp'); else error('No image files to load.') end %list the files img_files = cellstr(img_files); end
最后
以上就是老迟到柜子最近收集整理的关于DSST算法MATLAB代码中,load_video_info.m文件修改,使其适合数据集的全部内容,更多相关DSST算法MATLAB代码中,load_video_info内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复