Adding Gaussian Noise and Salt-and-Pepper Noise to Grayscale Images with Filtering Implementation
- Login to Download
- 1 Credits
Resource Overview
This experiment demonstrates adding Gaussian noise and salt-and-pepper noise to grayscale images, followed by median filtering and mean filtering processing with code implementation details
Detailed Documentation
In this experiment, our objective is to add Gaussian noise and salt-and-pepper noise to an image, then process it using median filtering and mean filtering techniques. The primary goal is to evaluate the effectiveness of these filters and determine optimal image processing methods.
For noise addition: Gaussian noise can be implemented using numpy's random.normal function with specified mean and standard deviation parameters, while salt-and-pepper noise involves randomly selecting pixels and setting them to either minimum or maximum intensity values.
After introducing noise, we apply median filtering which effectively reduces image noise by replacing each pixel's value with the median of neighboring pixels. This approach is particularly effective for preserving edges while removing impulse noise. The implementation typically uses a sliding window (e.g., 3×3 or 5×5 kernel) and computes the median value for each pixel neighborhood.
Alternatively, mean filtering processes the image by averaging pixel values within a defined neighborhood. This method reduces noise while maintaining image details, though it may cause some blurring. The implementation involves convolving the image with a normalized kernel where all elements have equal weights.
Through comparative analysis of both filters' performance metrics (such as PSNR and SSIM), we will determine the optimal processing method to achieve the best results for subsequent image processing tasks. The experiment includes visual comparisons of filtered images and quantitative evaluation of noise reduction effectiveness.
- Login to Download
- 1 Credits