%Travail 1, code Matlab pour débuter
close all;
addpath('images');

% nom du fichier d'image
imname = '00128u.tif';
%imname = '00757v.jpg';

% lire l'image
fullim = imread(imname);

% convert to double matrix (might want to do this later on to same memory)
fullim = im2double(fullim);

% compute the height of each part (just 1/3 of total)
height = floor(size(fullim,1)/3);
% separate color channels
B = fullim(1:height,:);
G = fullim(height+1:height*2,:);
R = fullim(height*2+1:height*3,:);

% Align the images
% Functions that might be useful to you for aligning the images include: 
% "circshift", "sum", and "imresize" (for multiscale)


% create a color image (3D array)
% ... use the "cat" command


% show the resulting image
% ... use the "imshow" command
%figure;imshow(aRGB);

% save result image
%imwrite(aRGB,['result-' imname]);