Equation for median filter. Figure 2: Window operation for image