Giter Club home page Giter Club logo

dealingwithnoise's Introduction

Image Processing with Notch Filtering

This is a Python project that demonstrates the application of notch filtering in image processing. Notch filters are used to selectively remove specific frequency components from an image's Fourier spectrum. In this project, we apply a notch filter to a given image and visualize the different processing steps.

Prerequisites

  • Python 3.x
  • Required packages: PIL, numpy, scipy, matplotlib

You can install the required packages using the following command:

pip install pillow numpy scipy matplotlib

Usage

  1. Clone the repository or download the main.py file.

  2. Place the input image image24.tif in the same directory as the main.py file.

  3. Run the main.py script using the following command:

python main.py

Description

The main.py script performs the following steps:

  1. Imports necessary libraries and modules.
  2. Defines a custom notch filter function to remove specific frequency components from an image's Fourier spectrum.
  3. Loads the input image (image24.tif) and converts it to grayscale.
  4. Applies a median filter to the noisy image to reduce noise.
  5. Performs Fast Fourier Transform (FFT) on the original image and shifts zero frequency components to the center.
  6. Manually defines notch centers (replace with actual coordinates) and generates a notch filter.
  7. Applies the notch filter to the FFT image by element-wise multiplication.
  8. Performs inverse FFT to obtain the filtered image.
  9. Creates and saves various plots for visualization, including the original image, median-filtered image, notch-filtered image, Fourier spectrum, notch filter, and result of multiplication.

Output

The script generates a series of plots to visualize the image processing steps. The plots include:

  • Original noisy image
  • Median-filtered image
  • Notch-filtered image
  • Fourier spectrum of the original image
  • Notch filter used
  • Result of multiplication of FFT image and notch filter

Notes

  • Replace the notch_centers with actual coordinates that correspond to the frequencies you want to remove using the notch filter.
  • The notch_filter function can be further customized based on your specific requirements.

Contributing

Contributions to this project are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

Example

myplot


dealingwithnoise's People

Contributors

umutazazi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.