University project. This notebook demonstrates how to use Independent Component Analysis (ICA) to separate an image into independent components.
Before running the notebook, make sure you have the following dependencies installed:
- Python 3.x
- NumPy
- Matplotlib
- scikit-learn
You can install the required packages by running the following command: pip install -r requirements.txt
-
Clone or download the repository to your local machine.
-
Ensure that the
mixed.jpg
file is in the same directory as the notebook. -
Run the notebook using a Jupyter Notebook environment or an integrated development environment (IDE) that supports Jupyter notebooks.
-
The notebook will load the
mixed.jpg
image, apply ICA to separate the image into foreground and background components, and display the results.
This notebook can also be tried in Google Colab here. Note that you need to upload your own mixed.jpg
file.
Feel free to modify and use the code according to your needs.
This notebook was inspired by Laurent de Vito's project, which can be found here: https://github.com/ldv1/ICA_for_demixing_images. The implementation utilizes the scikit-learn library for ICA and other data preprocessing tasks. Please note that the image may be subject to copyright.
This method of image decomposition might not always produce good results.