function y = averImg(f, fltSize)

flter = (1/(fltSize^2))*ones(fltSize,fltSize);

temp1 = conv2(f(:,:,1),flter,'same');
temp2 = conv2(f(:,:,2),flter,'same');

temp1(:,:,2) = temp2;
y = temp1;
