Questions about median, medfilt1, medfilt2

Hello, I am seeing some results of medfilt1 computation by which I am confused. Please see the questions below, and point if I am missing something. 1] b=[ 3 5 -8 6 0]; out=medfilt1(b,3); I expected out to be [3 3 5 0 0] but it is showing out as [4 3 5 0 3] How come? What is wrong here?
2] How does medfilt2 work. Help says "Each output pixel contains the median value in the m-by-n neighborhood around the corresponding pixel in the input image". For m=3,n=3, So does it calculate a 3x3 matrix MAT for each of input pixels placed at its center and do median(median(MAT)) to compute its median value in the m-by-n neighbourhood?
Any pointers will help.
thank you. -AD

Antworten (1)

Andrew Newell
Andrew Newell am 22 Feb. 2011

0 Stimmen

Question 1: I get [3 3 5 0 0]. Maybe you have another medfilt1 on your path. What do you get if you type
which medfilt1 -all

Tags

Gefragt:

am 22 Feb. 2011

Community Treasure Hunt

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

Start Hunting!

Translated by