
%% Load Class Pics: 
% 
%% Given a set of jpg-images in the directory PictureDir, load them

% Close all previous figures
	close all

% Edit PictureDir so that it contains the full location of the pictures 
	%PictureDir = '~/Google Drive/Teaching/MA211/pics/';
	%PictureDir = '~/Teaching/MA211/TestPics/';
	PictureDir = '~/Downloads/pics/';

% Search for all (JPEG) files ending with a .jpg
	Pics = dir([PictureDir,'*.jpg']);

% Resize all pictures to a common size
	% Remove the division parameter to make larger
	r = 600; % Number of rows in new resized picture
	c = 450; % Number of cols in new resized picture

	
%% Loop through each picture, load it into memory and view it
	for n=1:length(Pics)
			% Load and resize the image one by one
			Im = imresize(imread([PictureDir,Pics(n).name]),[r,c]);
			% Vectorize the image
			PicVex(:,n) = double(reshape(Im,r*c*3,1));
			% Display the vector as an image
			imshow(reshape(uint8(PicVex(:,n)),r,c,3))
			% Label the image
			xlabel(['Person ',num2str(n),],'FontSize',15);
			%pause
	end

