% Leslie Watkins
function output = mask(filter, indices)

global img_filename number_list image_type

location = 'Angelfire_road_seg\Images\';
x1 = double(imread([img_filename num2str(number_list(indices(1))), '.', image_type]));
x2 = double(imread([img_filename num2str(number_list(indices(2))), '.', image_type]));
x3 = double(imread([img_filename num2str(number_list(indices(3))), '.', image_type]));

diff1 = x2-x1;
diff1a = (abs(diff1)>50);


diff2 = x3-x1;
diff2a = (abs(diff2)>50);


difftot = uint8((diff1a.*diff2a).*255);



 x = open2(double(difftot), filter); 
%  x = double(difftot); 



% y = imresize(x, [980, 1597]);
% imshow(y); pause;
% imwrite(y, 'rmask.jpg');

save 'rmask' x
output = x; 