https://github.com/tahirzia-1/image-noise-analysis-and-filtering-toolkit
A Python-based image processing toolkit that demonstrates various noise models and filtering techniques with visual comparisons and performance metrics.
https://github.com/tahirzia-1/image-noise-analysis-and-filtering-toolkit
Last synced: 7 months ago
JSON representation
A Python-based image processing toolkit that demonstrates various noise models and filtering techniques with visual comparisons and performance metrics.
- Host: GitHub
- URL: https://github.com/tahirzia-1/image-noise-analysis-and-filtering-toolkit
- Owner: TahirZia-1
- Created: 2025-02-25T14:05:24.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-02-25T14:15:37.000Z (7 months ago)
- Last Synced: 2025-02-25T15:23:19.802Z (7 months ago)
- Language: Jupyter Notebook
- Size: 10.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NoisyVision: Image Noise Analysis & Filtering Toolkit



A comprehensive image processing toolkit for analyzing noise effects and applying various filtering techniques to digital images. This project demonstrates the application and comparison of different noise models and filtering algorithms with visual and quantitative analysis.
## Features
- RGB to grayscale image conversion
- Implementation of different noise models:
- Gaussian noise (with adjustable intensity)
- Salt & Pepper noise (with adjustable probability)
- Application of multiple filtering techniques:
- Mean filter (average filtering)
- Median filter
- Adaptive median filter
- Multiple kernel size options (3×3, 7×7, 15×15)
- Visual comparison of filtering results
- Quantitative analysis using PSNR (Peak Signal-to-Noise Ratio)## Usage
The main functionality is provided as a Jupyter Notebook:
```bash
jupyter notebook image_processing.ipynb
```Alternatively, you can run the Python script directly:
```bash
python image_processing.py
```### Sample Code
```python
# Read an image
img_rgb = read_image('path/to/your/image.jpg')# Convert to grayscale
img_gray = rgb_to_gray(img_rgb)# Add noise
img_gaussian = add_gaussian_noise(img_gray.copy())
img_salt_pepper = add_salt_pepper_noise(img_gray.copy())# Apply filters
filtered_image = apply_median_filter(img_gaussian, kernel_size=7)# Calculate PSNR
psnr_value = calculate_psnr(img_gray, filtered_image)
print(f"PSNR: {psnr_value:.2f} dB")
```## Results
### Noise Models
The project implements two noise models with adjustable parameters:
1. **Gaussian Noise**: Adds random values from a Gaussian distribution to each pixel
2. **Salt & Pepper Noise**: Randomly sets pixels to either black (0) or white (255)### Filter Comparison
Different filters perform optimally for different noise types:
| Noise Type | Best Filter | Optimal Kernel Size |
|-----------------|---------------------|---------------------|
| Gaussian | Adaptive Median | 7×7 |
| Salt & Pepper | Median | 3×3 / 7×7 |### Sample Outputs

## Key Findings
1. **Noise Type Dependency**: Different filters perform better for specific noise types
2. **Kernel Size Tradeoff**: Larger kernels remove more noise but also blur image details
3. **Adaptive Approaches**: Adaptive filters generally provide the best balance between noise reduction and detail preservation
4. **Quantitative Analysis**: PSNR metrics align with visual quality assessments