I'm not exactly sure how 'median filter' works on a coloured image.
I can understand how the median filter work on a black and white image. Because instead of the image being m by n by 3, the image is m by n by 1. So there is only 1 number contained in each pixel. With a 3 by 3 median block, you can easily sort those 9 numbers and take the median number.
However, if it is a colored image, there will be 3 numbers (R, G, B) representing each pixel. In a 3 by 3 block, how to get the median? Do I have to apply the median filter on each channel separately?
Would that also have the risk of generating some artificial pixel values? I mean for instance, the median of R channel is 5, G channel is 20, B channel is 180. Does that mean the median of this block will be [5, 20, 180]. If I'm using [5, 20 180], is it likely that [5, 20, 180] does not belong to any of the 9 pixels in the 3 by 3 block?