function image = gaussian(images, camX, camY, disp, apature)
%Use gaussian to combine multiple images for final rendered image


rows = size(images, 1);
cols = size(images, 2);

image = images{1,1};
image(:,:,:) = 0;

%for all cameras
for i=1:rows
    for j=1:cols
        
        %shift them over
        image_curr = images{i,j};
        disp_x = disp*(j - camX); 
        disp_y = disp*(i - camY); 
        image_curr = shiftImage(image_curr, disp_x, disp_y);
        
        %sum up the images, weighting based on value from gaussian
        image = image + ... 
            normpdf(i, camY, apature)*normpdf(j, camX, apature)*image_curr*max(1,apature/3);
    end
end



end

