The help is a good place to look for this information. If you type in median there, you'll see that you can use medfilt2() in the Image Processing Toolbox. I have a demo that uses medfilt2() to remove salt and pepper noise in RGB images, if you want to see it.
I would perform it on one of the channels depinding on which features afterwards you want to extract, or perform it on each channel.
or first transform to an other color space
Play games and win prizes!Learn more