medfilt2-in the 2x2 neighborhood

2 views (last 30 days)
Srivardhini on 1 Apr 2012
I understand that in the default 3 x 3 neighborhood, median filtering replaces every pixel with the median of its neighboring pixels. This is easy to visualize. But I don't quite understand how a matrix or an image is filtered 2x2 neighborhood. What exactly are the neighbors of a pixel in the 2x2 neighborhood? Take for instance a matrix [1 2;3 4] How does the filtering result in matrix [2.5 1;1.5 0]?
I've tried using medfilt2() with random matrices but I can't quite figure how it works

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!