function [featureVector] = makeImageFeatureTexture(img, type) % 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/ persistent L3 E3 S3 L5 L7 gMask % the Laws' masks global columnWidth nGridCol nGridRow rowWidth global scale2Factor global nDim nLaw nHarris if nargin < 2 type = 'texture'; end nGCol = nGridCol; nGRow = nGridRow; % Assume that the image is correctly oriented. imheight = size(img, 1); imwidth = size(img, 2); % Step sizes in x and y H2 = calculateFilterBanks(img, type); %imagefeatures = zeros(2*nLaw*3*nHarris); imagefeatures = zeros(nLaw,1); if nLaw %add spatial masks here imagefeatures(1:nLaw) = sum(sum(H2(:, :, 1:nLaw), 2), 1); %imagefeatures(nLaw+(1:nLaw)) = sum(sum(H4(:, :, 1:nLaw), 2), 1); end if nHarris % Do Harris here if need to end %featureVectorTmp = zeros( nGRow, nGCol, 2*nLaw+3*nHarris); featureVectorTmp = zeros( nGRow, nGCol, nDim); %numfeatures = 2*nLaw+3*nHarris for f=1:nDim featureVectorTmp(:, :, f) = imagefeatures(f); end featureVector = featureVectorTmp; %permute( featureVectorTmp, [3 1 2]); %featureVector = reshape( featureVector3, [size(featureVector2,1)*size(featureVector3,2) nGridCol] ); % if displayFlag % figure, % subplot(2,2,1), imshow(img); % subplot(2,2,2), imagesc(ycbcr_img(:,:,1)); % subplot(2,2,4), imagesc(ycbcr_img(:,:,2)); % subplot(2,2,3); plot( squeeze(featureVector(frame,:,:)) ); % axis tight; % end return;