You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
349 B
Matlab

function I=load_image_101(num)
data_dir='../Data/101_ObjectCategories/BACKGROUND_Google/';
filename=sprintf([data_dir,'image_0%03d.jpg'],num);
I=imread(filename);
[a,b,c]=size(I);
if c==3
I=rgb2gray(I);
end
I=im2double(I);
maxsz=107; %160; %320
[val,ind]=max([a,b]);
if val>maxsz
scale=[NaN,NaN];
scale(ind)=maxsz;
I=imresize(I,scale);
end