0001 function image=GetImage(imageno)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 load Calib_Results.mat type_numbering calib_name N_slots format_image;
0020
0021 if ~type_numbering,
0022 number_ext = num2str(imageno);
0023 else
0024 number_ext = sprintf(['%.' num2str(N_slots) 'd'],imageno);
0025 end;
0026
0027 ima_name = [calib_name number_ext '.' format_image];
0028
0029 if exist(ima_name,'file')
0030 if strcmp(format_image,'pgm')
0031 image = im2double(loadpgm(ima_name));
0032 elseif strcmp(format_image,'ppm')
0033 image = im2double(loadppm(ima_name));
0034 elseif strcmp(format_image,'ras')
0035 image = readras(ima_name);
0036 else
0037 image = im2double(imread(ima_name));
0038 end
0039 else
0040 image=[];
0041 end