1, the average filter averages the pixel values in the neighborhood around a given pixel as the value of the current pixel, which can effectively remove Gaussian noise and salt and pepper noise, but it will blur the image details.
2. The median filter sorts the pixel values in the neighborhood around a given pixel, and then takes the median as the value of the current pixel, which can deal with salt and pepper noise well, but the denoising effect on Gaussian noise is average.