Equivalent 2D mask of moving-average
Convolution in linear time-invariant system is asociative. So to get the equivalent mask you just need to convolve the kernel with itself twice. This will then then give you a 7x7 kernel:

octave:1&gt; a = [ 1 1 1 ; 1 1 1 ; 1 1 1 ]
a =

   1   1   1
   1   1   1
   1   1   1

octave:2&gt; conv2(a,conv2(a,a))
ans =

    1    3    6    7    6    3    1
    3    9   18   21   18    9    3
    6   18   36   42   36   18    6
    7   21   42   49   42   21    7
    6   18   36   42   36   18    6
    3    9   18   21   18    9    3
    1    3    6    7    6    3    1

octave:3&gt; 


Note that the original mask is not normalised - it has a gain of 9 at DC - so with three convolutions you get an overall gain of 9^3.

Depending on what you're trying to achieve though you might just be better off with a 7x7 Gaussian.