1) An Given an image,

and a structuring element,

find the image produced by a local average over all neighbours (you may assume that all elements outside the region shown are zero).
2) Given an image,

and a structuring element,

find the image produced by a local average over all neighbours (you may assume that all elements outside the region shown are zero).