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