Explore the realm of image processing with our project on pixel segmentation using k-means clustering. This tool is designed to demonstrate how k-means clustering can transform images into segmented visuals and compile the process into a GIF.
- Image Segmentation: Utilize k-means to segment images by pixel color.
- Dynamic Visualization: Generate GIFs to visualize the segmentation process across different k-values.
- Customizable: Suitable for any image to experiment with segmentation levels.
- Python 3.6+
- Libraries: numpy, OpenCV-python, Pillow
- Clone the repository:
git clone https://github.com/NisargBhavsar25/pixel-segmentation-using-kmeans.git
- Navigate to the project directory:
cd pixel-segmentation-using-kmeans
- Install the required packages:
pip install -r requirements.txt
Run the main script with an optional path to your image:
python main.py --path /path/to/your/image.jpg
- Default image path:
images/input-image.jpg
- Output GIF:
images/output.gif
- Segmented images:
images/segmented-images/
Shows the segmentation process at varying levels of k-values.