Iam trying to create low pass filter in matlab
I've a matrix with size 12x6
56 147 56 52 147 52;
50 146 46 56 141 53;
59 142 145 147 147 46;
60 147 147 145 145 47;
52 145 35 47 146 52;
54 142 46 50 145 45;
56 52 56 52 56 52;
54 142 146 147 145 45;
59 142 53 45 147 46;
60 147 53 45 145 47;
52 145 124 145 142 52;
35 146 50 51 53 141;
with mask 1/25 (those matrix values are one) 
first i checked the matrix to image
M = [
56 147 56 52 147 52;
50 146 46 56 141 53;
59 142 145 147 147 46;
60 147 147 145 145 47;
52 145 35 47 146 52;
54 142 46 50 145 45;
56 52 56 52 56 52;
54 142 146 147 145 45;
59 142 53 45 147 46;
60 147 53 45 145 47;
52 145 124 145 142 52;
35 146 50 51 53 141;
];
f=uint8(M);
figure;imshow(f);title('Image from matrix');
image looks very small cause matrix size also small.
then I did this iteration with this following code :
a=f;
b = size(M); % check size my matrix
n=5;
n1=ceil(n/2);
lpf=(1/n^2)*ones(n) % multiply with ones values of matrix;
c=0;
h=0;
for i=n1:b(1)-n1
for j=n1:b(2)-n1
p=1;
for k=1:n
for l=1:n
c=c+a(i-n1+k,j-n1+l)*lpf(l,l);
end
end
d(i,j)=c;
c=0;
end
end
e=uint8(d);
figure;imshow(e);title('low pass image');
the result stored in e variable , when i check it my matrix become more small than before, the size become 9x3 :
0 0 0
0 0 0
0 0 105
0 0 105
0 0 97
0 0 97
0 0 89
0 0 90
0 0 97
Am i missing something ?