This desktop program demonstrates the relative importance of magnitude and phase components in a signal by manipulating Fourier transforms of grayscale images. Users can view and manipulate four grayscale images simultaneously, observe their Fourier transform components, and mix them to create new images.
- Open and view up to four grayscale images.
- Automatic conversion to grayscale for colored images.
- Unified sizes for opened images.
- View Fourier transform (FT) components: Magnitude, Phase, Real, and Imaginary.
- Change images by double-clicking on viewer.
- Choose between Mag and phase or Real and Imaginary modes.
- View mixer result in one of two output viewports.
- Control which viewport displays the mixer result.
- Adjust brightness/contrast of images via mouse dragging.
- Apply adjustments to any of the four components.
- Mixer result is the inverse Fourier transform (ifft) of a weighted average of input images' FTs.
- Customize weights of each image's FT via sliders.
- Intuitive interface for customizing weights for two components.
- Select regions (inner or outer) for each FT component.
- Choose regions using drawn rectangles with customizable sizes.
- Highlight selected regions for visual representation.
- Display progress bar during lengthy ifft operations.
- Cancel previous operation when new request is made.
- Clone this repository to your local machine.
- Install the required dependencies by running
pip install -r requirements.txt
in your terminal or command prompt. - Navigate to the project directory containing
main.py
.
- Run the program by executing
python main.py
in your terminal or command prompt. - The application window will open, displaying the main user interface.
- Double Click on the Image viewport to load up to four grayscale images.
- If you load a colored image, the program will automatically convert it to grayscale.
- Images will be displayed in separate viewports within the application window.
- Drag the mouse up or down to adjust the brightness of an image.
- Drag the mouse left or right to adjust the contrast of an image.
- You can adjust the brightness/contrast for each image individually.
- Select an image viewport.
- Choose the Fourier transform component you want to view (Magnitude, Phase, Real, or Imaginary) from the drop-down menu.
- The selected Fourier transform component will be displayed in the corresponding viewport.
- Choose the mixing mode (Mag and phase or Real and Imaginary) from the mode selection buttons.
- Use the sliders to customize the weights for each image's Fourier transform components.
- Adjust the weights to create the desired mixer result.
- Click and drag to draw rectangles on the Fourier transform components.
- Choose whether to include the inner or outer region of each rectangle for mixing.
- Adjust the size of the region rectangles using the slider or resize handles.
- Choose one of the two output viewports to display the mixer result.
- The mixer result will be displayed in real-time as you adjust the mixing settings.
- During lengthy mixer operations, a progress bar will be displayed to indicate the progress of the operation.
- You can cancel the ongoing operation and start a new one by making new requests.
By following these instructions, you can effectively use the Fourier-Image-Mixer application to manipulate Fourier transforms of grayscale images and observe the effects of different mixing settings on the resulting images.
- Python
- PyQt5 for GUI
- NumPy for mathematical operations
- OpenCV for image processing