Basic Theory
Median filter also reduces the noise in image like low pass filter, but it is better than low pass filter in the sense that it preserves the edges and other details. The process of calculating the intensity of central pixel is same as that of low pass filtering except instead of averaging all the neighbours, we sort the window and replace the central pixel with median from the sorted window. For example, lets we have a window like this
Now we sort the given window and get the sorted array as [1 1 2 2 3 3 5 6 7]. The median of this array is 4th element i.e 3. Now we replace the central element 7 with 4. That's it.
Source Code
Read more »
Median filter also reduces the noise in image like low pass filter, but it is better than low pass filter in the sense that it preserves the edges and other details. The process of calculating the intensity of central pixel is same as that of low pass filtering except instead of averaging all the neighbours, we sort the window and replace the central pixel with median from the sorted window. For example, lets we have a window like this
Now we sort the given window and get the sorted array as [1 1 2 2 3 3 5 6 7]. The median of this array is 4th element i.e 3. Now we replace the central element 7 with 4. That's it.
Source Code
تعليقات: 0
إرسال تعليق