This function sets each pixel in the destination image as the median value of all the input pixel values taken in the neighborhood of the processed pixel. The neighborhood is determined by the fixed square mask of the 3x3 size with the anchor cell as the center cell of the mask. The parameter
specifies the weight of the processed pixel, that is how many times its value is included into calculations. The value of this parameter should be odd. If it is even, the function changes its value to the nearest less odd number and returns the warning message.