MATLAB: Sliding window operation in image

image processingImage Processing Toolboxkernel

I have an image of size 256*256, i want to use 3*3 window which slides over image and change the value of central pixel as sum of neighbouring 8 pixels. Please Help.

Best Answer

Try conv2(), imfilter(), nlfilter(), or, if you want to move in "jumps" instead of by one pixel, blockproc().