GET_FEATURES_DEPTH Extracts dense features from image GET_FEATURES_DEPTH.m is a function used for extracting dense features from depth and color image according to the feature used. For more information about the DS-KCF and KCF model update see [1,2]. Please note that this function was partially built extending the KCF tracker code presented by Joao F. Henriques, in http://www.isr.uc.pt/~henriques/. INPUT: -im color data -depth depth data -features struct containing feature info. -cell_size HOG parameter -cos_window cosine window to smooth data in the Fourier domain OUTPUT: -x features extracted -separateDepth features extracted for depth in case color and depth features are selected, in the other cases this matrix is empty See also FHOG, MAXRESPONSEDSKCF, MAXRESPONSEDEPTHWEIGHTDSKCF, MODELUPDATEDSKCF [1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. Burghardt, A.Paiement, L. Tao, DS-KCF: A ~real-time tracker for RGB-D data, Journal of Real-Time Image Processing University of Bristol Massimo Camplani and Sion Hannuna massimo.camplani@bristol.ac.uk hannuna@compsci.bristol.ac.uk
0001 function [x separateDepth] = get_features_depth(im, depth, features, cell_size, cos_window) 0002 %GET_FEATURES_DEPTH Extracts dense features from image 0003 % 0004 %GET_FEATURES_DEPTH.m is a function used for extracting dense features from 0005 %depth and color image according to the feature used. For more information 0006 %about the DS-KCF and KCF model update see [1,2]. Please note that this 0007 %function was partially built extending the KCF tracker code presented by 0008 %Joao F. Henriques, in http://www.isr.uc.pt/~henriques/. 0009 % 0010 % 0011 % INPUT: 0012 % -im color data 0013 % -depth depth data 0014 % -features struct containing feature info. 0015 % -cell_size HOG parameter 0016 % -cos_window cosine window to smooth data in the Fourier domain 0017 % 0018 % OUTPUT: 0019 % -x features extracted 0020 % -separateDepth features extracted for depth in case color and depth 0021 % features are selected, in the other cases this matrix is empty 0022 % 0023 % See also FHOG, MAXRESPONSEDSKCF, MAXRESPONSEDEPTHWEIGHTDSKCF, 0024 % MODELUPDATEDSKCF 0025 % 0026 %[1] S. Hannuna, M. Camplani, J. Hall, M. Mirmehdi, D. Damen, T. Burghardt, 0027 % A.Paiement, L. Tao, DS-KCF: A ~real-time tracker for RGB-D data, Journal 0028 % of Real-Time Image Processing 0029 % 0030 % 0031 % University of Bristol 0032 % Massimo Camplani and Sion Hannuna 0033 % 0034 % massimo.camplani@bristol.ac.uk 0035 % hannuna@compsci.bristol.ac.uk 0036 0037 separateDepth=[]; 0038 0039 if features.rawDepth, 0040 x = double(im) ;%x = double(im) / 255; 0041 0042 x = (x - mean(x(:)))/std(x(:)); 0043 0044 end 0045 0046 if features.rawColor, 0047 0048 x = double(im)/255 ;%x = double(im) / 255; 0049 x = x - mean(x(:)); 0050 0051 end 0052 0053 if features.rawConcatenate, 0054 0055 x = double(im) ; 0056 0057 x = (x - mean(x(:)))/std(x(:)); 0058 0059 xD = double(depth); 0060 0061 xD = (xD - mean(xD(:)))/std(xD(:)); 0062 0063 x = cat(3, x, xD); 0064 end 0065 0066 if features.rawLinear, 0067 0068 x = double(im) ; 0069 0070 x = (x - mean(x(:)))/std(x(:)); 0071 0072 separateDepth = double(depth);%separateDepth = double(depth) / 255; 0073 %separateDepth = separateDepth - mean(separateDepth(:)); 0074 separateDepth = (separateDepth - mean(separateDepth(:)))/std(separateDepth(:)); 0075 %x = cat(3, x, xD); 0076 end 0077 0078 0079 if features.hog_color, 0080 %HOG features, from Piotr's Toolbox 0081 x = double(fhog(single(im) / 255, cell_size, features.hog_orientations)); 0082 x(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0083 % fprintf('In Hog\n'); 0084 end 0085 0086 if features.hog_depth, 0087 %HOG features, from Piotr's Toolbox 0088 x = double(fhog(single(depth) / 255, cell_size, features.hog_orientations)); 0089 x(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0090 % fprintf('In Hog\n'); 0091 end 0092 0093 if features.hog_concatenate, 0094 %HOG features, from Piotr's Toolbox 0095 x = double(fhog(single(im) / 255, cell_size, features.hog_orientations)); 0096 x(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0097 % fprintf('In Hog\n'); 0098 xD = double(fhog(single(depth) / 255, cell_size, features.hog_orientations)); 0099 xD(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0100 x = cat(3, x, xD); 0101 end 0102 0103 if features.hog_linear, 0104 %HOG features, from Piotr's Toolbox 0105 x = double(fhog(single(im) / 255, cell_size, features.hog_orientations)); 0106 x(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0107 % fprintf('In Hog\n'); 0108 separateDepth = double(fhog(single(depth) / 255, cell_size, features.hog_orientations)); 0109 separateDepth(:,:,end) = []; %remove all-zeros channel ("truncation feature") 0110 end 0111 0112 0113 %process with cosine window if needed 0114 if ~isempty(cos_window), 0115 x = bsxfun(@times, x, cos_window); 0116 end 0117 0118 0119 0120 end