0

I have for example, an input grayscale image (say 65 X 65 pixels). I am trying to applying a self defined, 3X3 mask, for e.g:

M = [1 2 3; 4 5 6; 7 8 9]

and I want it to trace the mask throughout the entire image, except for at the boundaries (where it is outside the range of the array).

Is there an elegant way to do that in matlab (without having to expand the image boundaries to accommodate for the mask?

CraigTeegarden
  • 8,173
  • 8
  • 38
  • 43
John Tan
  • 1,331
  • 1
  • 19
  • 35

1 Answers1

1

If I get you correctly you mean you want to:

ans=conv2(image,M,'same');
bla
  • 25,846
  • 10
  • 70
  • 101