LOAD_VIDEO_INFO_BOBOTRESULTS.m is automatically generates the relevant information for the video in the given path LOAD_VIDEO_INFO_BOBOTRESULTS loads all the relevant information for the sequence depth and video data in the given path for the BOBOT-D RGB-D dataset [1]. This function have been created extending load_video_info of the KCF matlab library presented by Joao F. Henriques, in http://www.isr.uc.pt/~henriques/. A similar function need to be implemented if another dataset that uses another naming convention is processed. See for example LOAD_VIDEO_INFO_DEPTHFROMMAT for the Princeton RGB-D dataset [2] INPUT: -base_path name of the top folder where sequences are stored -video name of the sequence that will be processed OUTPUT -img_files the list of Color data files (images in the folder are supposed to be *.png) -depth_files the list of Depth data files (images in the folder are supposed to be 16 bit *.png) -pos initial DS-KCF tracker position pos=[y x] where x is the column index and y is the row index of the image -target_sz initial target size target_sz=[height,width] -ground_truth ground truth information -video_path absolute path of color data -depth_path absolute path of depth data See also LOAD_VIDEO_INFO_DEPTHFROMMAT [1]Germán Martín García, Dominik A. Klein, Jörg Stückler, Simone Frintrop, and Armin B. Cremers DAGM/OAGM Conference, August 28-31, 2012, Graz, Austria [2] S. Song and J. Xiao. Tracking revisited using RGBD camera: Unified benchmark and baselines. In Computer Vision (ICCV), 2013 IEEE International Conference on, pages 233–240, 2013. University of Bristol Massimo Camplani and Sion Hannuna massimo.camplani@bristol.ac.uk hannuna@compsci.bristol.ac.uk
0001 function [img_files, depth_files, pos, target_sz, ground_truth, video_path, depth_path] = load_video_info_BobotResults(base_path, video) 0002 % LOAD_VIDEO_INFO_BOBOTRESULTS.m is automatically generates the relevant information for the video in the given path 0003 % 0004 % LOAD_VIDEO_INFO_BOBOTRESULTS loads all the relevant information for the 0005 % sequence depth and video data in the given path for the BOBOT-D RGB-D 0006 % dataset [1]. This function have been created extending 0007 % load_video_info of the KCF matlab library presented by Joao F. 0008 % Henriques, in http://www.isr.uc.pt/~henriques/. A similar function need 0009 % to be implemented if another dataset that uses another naming 0010 % convention is processed. See for example LOAD_VIDEO_INFO_DEPTHFROMMAT 0011 % for the Princeton RGB-D dataset [2] 0012 % 0013 % INPUT: 0014 % -base_path name of the top folder where sequences are stored 0015 % -video name of the sequence that will be processed 0016 % 0017 % OUTPUT 0018 % -img_files the list of Color data files (images in the folder are 0019 % supposed to be *.png) 0020 % -depth_files the list of Depth data files (images in the folder are 0021 % supposed to be 16 bit *.png) 0022 % -pos initial DS-KCF tracker position pos=[y x] where x is the column 0023 % index and y is the row index of the image 0024 % -target_sz initial target size target_sz=[height,width] 0025 % -ground_truth ground truth information 0026 % -video_path absolute path of color data 0027 % -depth_path absolute path of depth data 0028 % 0029 % See also LOAD_VIDEO_INFO_DEPTHFROMMAT 0030 % 0031 % [1]Germán Martín García, Dominik A. Klein, Jörg Stückler, Simone 0032 % Frintrop, and Armin B. Cremers DAGM/OAGM Conference, August 28-31, 2012, 0033 % Graz, Austria 0034 % 0035 % [2] S. Song and J. Xiao. Tracking revisited using RGBD camera: Unified 0036 % benchmark and baselines. In Computer Vision (ICCV), 2013 IEEE 0037 % International Conference on, pages 233–240, 2013. 0038 % 0039 % 0040 % University of Bristol 0041 % Massimo Camplani and Sion Hannuna 0042 % 0043 % massimo.camplani@bristol.ac.uk 0044 % hannuna@compsci.bristol.ac.uk 0045 0046 %full path to the video's files 0047 if base_path(end) ~= '/' && base_path(end) ~= '\', 0048 base_path(end+1) = '/'; 0049 end 0050 video_path = [base_path video '/']; 0051 0052 filename = [video_path 'init.txt']; 0053 f = fopen(filename); 0054 assert(f ~= -1, ['No initial position or ground truth to load ("' filename '").']) 0055 0056 %the format is [x, y, width, height] 0057 try 0058 ground_truth = textscan(f, '%f,%f,%f,%f', 'ReturnOnError',false); 0059 catch %#ok, try different format (no commas) 0060 frewind(f); 0061 ground_truth = textscan(f, '%f %f %f %f'); 0062 end 0063 ground_truth = cat(2, ground_truth{:}); 0064 fclose(f); 0065 0066 0067 ground_truth=floor(ground_truth); 0068 %set initial position and size 0069 target_sz = [ground_truth(1,4), ground_truth(1,3)]; 0070 pos = [ground_truth(1,2), ground_truth(1,1)] + floor(target_sz/2); 0071 0072 if size(ground_truth,1) == 1, 0073 %we have ground truth for the first frame only (initial position) 0074 ground_truth = []; 0075 else 0076 %store positions instead of boxes 0077 ground_truth = ground_truth(:,[2,1]) + ground_truth(:,[4,3]) / 2; 0078 end 0079 0080 filenameGTlist = [video_path video '.txt']; 0081 tmpGT=load(filenameGTlist); 0082 numOfFrames = size(tmpGT,1); 0083 0084 %from now on, work in the subfolder where all the images are 0085 0086 0087 depth_path = [video_path 'depth/']; 0088 video_path = [video_path 'rgb/']; 0089 0090 %general case, just list all images 0091 img_files_ = dir([video_path '*.png']); 0092 assert(~isempty(img_files_), 'No image files to load.') 0093 0094 depth_files_ = dir([depth_path '*.png']); 0095 assert(~isempty(depth_files_), 'No depth files to load.') 0096 0097 0098 0099 0100 0101 for i = 0:numOfFrames-1 0102 img_files{i+1} = sprintf('%d_color.png',i); 0103 depth_files{i+1} = sprintf('%d_depth.png',i); 0104 0105 end 0106 0107 0108 end 0109