Perform various spatial domain filtering techniques on a given image. Apply filter operations with different kernel sizes: 3x3, 7x7, 11x11, 15x15, and 21x21.
- Low-Pass Filtering
- High-Pass Filtering
- Weighted Average Filtering (Gaussian Filter)
This project demonstrates the effects of spatial domain filtering on a grayscale image. By applying low-pass, high-pass, and weighted average filtering, the project visualizes how different kernel sizes influence image restoration and enhancement.
- Low-Pass Filtering: Smooths the image by averaging pixel values over a defined neighborhood.
- High-Pass Filtering: Enhances edges by emphasizing high-frequency components and subtracting low-pass results.
- Weighted Average Filtering: Smooths the image using a Gaussian filter, where pixel weights decrease with distance.
project-directory/
├── cameraman.jpg # Input grayscale image
├── lab06_spatial_filtering.m # MATLAB script file
├── low_pass_filters.png # Output for low-pass filtering
├── high_pass_filters.png # Output for high-pass filtering
├── weighted_avg_filters.png # Output for weighted average filtering
├── README.md # Project documentation
- MATLAB installed on your system.
cameraman.jpg
image in the project directory.- Basic knowledge of MATLAB image processing commands.
- Clone or download this repository.
- Place the
cameraman.jpg
file in the project directory. - Open
lab06_spatial_filtering.m
in MATLAB. - Run the script.
- Check the generated
.png
files for results.
- Low-Pass Filters:
- High-Pass Filters:
- Increasing kernel size for low-pass filters results in greater smoothing but blurs details.
- High-pass filters highlight edges more distinctly with smaller kernel sizes.
- Gaussian filters provide smooth transitions and are less sensitive to noise.
Rahul Patel
Roll No: UI22EC58