Relaxed median filter