https://github.com/shourya1997/k-means-color-clustering
The program partitions and clusters the pixel intentsities of a RGB image.
https://github.com/shourya1997/k-means-color-clustering
kmeans-clustering-algorithm opencv-python python
Last synced: about 1 month ago
JSON representation
The program partitions and clusters the pixel intentsities of a RGB image.
- Host: GitHub
- URL: https://github.com/shourya1997/k-means-color-clustering
- Owner: shourya1997
- Created: 2018-01-10T14:26:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-10T14:30:16.000Z (almost 8 years ago)
- Last Synced: 2025-02-27T10:59:04.257Z (10 months ago)
- Topics: kmeans-clustering-algorithm, opencv-python, python
- Language: Jupyter Notebook
- Size: 7.55 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# K-Means Clustering
----------
## Overview
The program partitions and clusters the pixel intentsities of a RGB image. Given any image size of *LxB* pixels and each having there components Red, Green and Blue.
Here we define the number of clusters of colors we want.
We will use *scikit-learn implementation of K-Means*, *matplotlib* to display out images and most dominant colors, we will use *argparse* to parse the line arguments, and finallt *cv2* to load images and do operations.
----------
## Setup
This project has the following dependencies:
- Python 3.5 or more
- IPython Notebook
- Scikit-learn
- Numpy
- OpenCV
- Matplotlib
- Argparse
----------
## Run a K-Means Clustering of an Image
```
$ python color_kmeans.py --image example.jpg --clusters 10
```
## Run Jupyter Notebook
```
$ jupyter notebook color_kmeans.ipynb
```