An open API service indexing awesome lists of open source software.

https://github.com/piyushsuthar/k-means-algo

Implementation of Image segmentation using K-Means algorithm in rust.
https://github.com/piyushsuthar/k-means-algo

image-processing kmeans-algorithm kmeans-clustering

Last synced: about 2 months ago
JSON representation

Implementation of Image segmentation using K-Means algorithm in rust.

Awesome Lists containing this project

README

        

# K-Means Algorithm

Implementation of Image segmentation using K-Means algorithm in rust.

> Code mostly taken from [here](https://applied-math-coding.medium.com/data-science-implementing-k-means-in-rust-457e4af55ece)

## Usage

```bash
cargo run --release --
```

saves the output image as `_segmented.jpg` in the current directory.

## Example

```bash
cargo run --release -- images/lena.png 5
```

_Input_ and _Output_ images for different values of `k`:

| Input | K = 2 | K = 5 | K = 10 |
| ------------------------ | ------------------------ | ------------------------ | ------------------------- |
| ![Me](examples/real.jpg) | ![K_2](examples/k_2.png) | ![K_5](examples/k_5.jpg) | ![K_7](examples/k_10.jpg) |