function imageSet = LoadImageSet(startDay, startMonth, startYear, startHour, startMin, endDay, endMonth, endYear, endHour, endMin, filePath) % imageSet = LoadImageSet(startDay, startMonth, startYear, startHour, startMin, endDay, endMonth, endYear, endHour, endMin, filePath). % This function loads the set of images in chronological order, and puts % them into a column vector. % Author : Sasakthi Abeysinghe, Timothy Simpson % Date : 04/05/2006 disp('Loading Images ... This might take a few mins...'); currentTimestamp = datenum(startYear, startMonth, startDay, startHour, startMin, 0); endTimestamp = datenum(endYear, endMonth, endDay, endHour, endMin, 0); timestep = 1.0/(24.0*60.0); initialized = 0; count = 0; while currentTimestamp < endTimestamp, currentTimestamp = currentTimestamp + timestep; filename = strcat(filePath, datestr(currentTimestamp, 'ddmmyy_HHMM'), '.jpg'); fid = fopen(filename); if(fid ~= -1) count = count + 1; fclose(fid); image = imresize(imread(filename), [240, 320], 'bilinear'); image = image(:); if(initialized) imageSet = [image, imageSet]; else, imageSet = image; initialized = 1; end if(count == 1000) break; end end end disp('Image Loading complete!'); clear initialized; clear filename; clear fid; clear image; clear currentTimestamp; clear endTimestamp; clear timestep;