📊 Image Processing & Noise Analysis in MATLAB This project provides a comprehensive walkthrough of essential image processing tasks using MATLAB. It covers color space analysis, grayscale conversion, noise generation, autocorrelation visualization, and performance evaluation of noise reduction filters using Signal-to-Noise Ratio (SNR) and Peak Signal-to-Noise Ratio (PSNR).
📁 Contents
- 📷 Image Loading and Preprocessing
- 🌈 RGB Histogram Visualization
- ⚫ Grayscale Conversion Methods
- 📉 Grayscale Histogram Analysis
- 🎲 Gaussian White Noise Generation
- 🌀 Autocorrelation of Noisy Image
- 🧹 Noise Reduction Using Filters
- 📈 SNR & PSNR Analysis
- 🧮 Filter Performance vs. Size
- ⚙️ Nonlinear Median Filtering
🔧 Requirements • MATLAB (R2021a or newer recommended) • Image Processing Toolbox
🧪 Features & Explanation
- Image Preprocessing • Loads the input image. • Resizes to 256×256 pixels for uniform analysis.
- Color Channel Histograms • Extracts R, G, and B channels. • Displays histograms for color intensity distribution.
- Grayscale Conversion Techniques • Arithmetic mean: (R + G + B) / 3 • Averaged RGB components: (R/3 + G/3 + B/3) • NTSC standard: 0.299R + 0.587G + 0.114*B
- Grayscale Histograms • Displays histograms for each grayscale variant. • Prints min, max, and data types.
- Gaussian Noise Generation • Adds Gaussian white noise to grayscale image. • Mean and standard deviation of the noise are computed and visualized.
- Autocorrelation Analysis • Explains and visualizes the autocorrelation of noise. • Includes a 3D surface plot for structure inspection.
- Filtering Techniques • Applies average filters (5×5, 15×15) to noisy images. • Measures improvement using: o SNR: Signal-to-Noise Ratio o PSNR: Peak Signal-to-Noise Ratio (in dB)
- Filter Size Impact • Analyzes how filter size affects noise reduction. • Plots SNR and PSNR against filter size (3x3 to 49x49).
- Nonlinear Filtering • Uses a median filter to remove impulse noise. • Recomputes and compares SNR and PSNR post-filtering.
📊 Sample Outputs • RGB and grayscale histograms • Noisy vs. filtered images • Autocorrelation visualization • SNR & PSNR plots • Median filter results
📚 Learnings This project demonstrates: • RGB to grayscale transformation techniques • Effects of Gaussian noise on images • Power of linear and nonlinear filters • Quantitative evaluation using SNR & PSNR • Insightful use of xcorr2 and histogram-based validation
🙌 Acknowledgements Developed as part of coursework in Image Processing. Inspired by classic filtering and statistical noise analysis techniques.