function featureVector = makeHybridFeatureVector(img, type, columnscale, ... numcolumns, wholescale, scales) % Version 0.1, Feb 2006. % This code is copyrighted by Ashutosh Saxena, Stanford University % It is available for non-commercial use only. For commericial use, please % contact the authors. % Any publication or report resulting from Use of this code, should cite: % Learning Depth from Single Monocular Images, Ashutosh Saxena, Sung H. Chung, Andrew Y. Ng, NIPS 2005. % 3-D Depth Reconstruction from a Single Still Image, Ashutosh Saxena, Sung H. Chung, Andrew Y. Ng, To appear in IJCV 2007. % For more info and dataset, visit: http://ai.stanford.edu/~asaxena/learningdepth/ % For a better version of the algorithm, also visit: % http://ai.stanford.edu/~asaxena/reconstruction3d/ global nDim global nGridCol nGridRow numscales = length(scales); % Fix the number of features to be a variable featureVector = zeros(nGridRow, nGridCol, numscales*nDim); for s=1:numscales scale = scales(s); dimensionIndex = ((s-1)*nDim + 1):(s*nDim); if scale == 1 featureVector(:, :, dimensionIndex) = ... makeScaledFeatureTexture(img, type, scale); elseif scale > 1 tmp = imresize(img, 1/(2*(scale-1)+1)); featureVector(:, :, dimensionIndex) = ... makeScaledFeatureTexture(tmp, type, scale); elseif scale == -1 tmp = imresize(tmp, 1/columnscale); featureVector(:, :, dimensionIndex) = ... makeColumnFeatureTexture(tmp, type, numcolumns); elseif scale == -2 tmp = imresize(tmp, 1/wholescale); featureVector(:, :, dimensionIndex) = ... makeImageFeatureTexture(tmp, type); end end return;