Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lempiy/slic0
Linear image segmentation :sunrise_over_mountains:
https://github.com/lempiy/slic0
computer-vision image image-processing image-segmentation rust slic slic0
Last synced: about 1 month ago
JSON representation
Linear image segmentation :sunrise_over_mountains:
- Host: GitHub
- URL: https://github.com/lempiy/slic0
- Owner: lempiy
- License: mit
- Created: 2019-09-05T20:03:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T17:21:12.000Z (almost 5 years ago)
- Last Synced: 2024-10-29T20:17:17.972Z (3 months ago)
- Topics: computer-vision, image, image-processing, image-segmentation, rust, slic, slic0
- Language: Rust
- Homepage:
- Size: 1.5 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust SLIC
[![Build & Test](https://github.com/lempiy/slic0/workflows/Rust/badge.svg)](https://github.com/lempiy/slic0/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lempiy/slic0/LICENSE)
[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://lempiy.github.io/slic0/doc/slic)Rust realization of [Simple Linear Image Segmentation](http://infoscience.epfl.ch/record/177415/files/Superpixel_PAMI2011-2.pdf)
algorithm with SLIC0 and lowest gradient seeding support.#### Purpose
Library can be used in all areas where image pre-processing is required.
* Content-based image retrieval
* Machine vision
* Object detection
* Recognition TasksMore info [here](https://en.wikipedia.org/wiki/Image_segmentation).
#### [Documentation](https://lempiy.github.io/slic0/doc/slic)
#### Example
```rust
use slic::get_slic;
use image::{open};
fn main() {
let mut image = open("./my_image.jpg").ok().expect("Cannot open image");
let img = image.as_rgb8().expect("Cannot get RGB from DynamicImage");
let mut slic = get_slic(img, 30, 10.0, true);
slic.compute();
// save segments net to file
slic.get_borders_image().save("./borders.png").expect("Cannot save image on disk");
// print segments as ASCII art to stdout
slic.labels.iter().enumerate().for_each(|(i, x)| {
print!("{}", ((32 + *x) as u8 as char).to_string());
if ((i + 1) % img.width() as usize) == 0 {
println!();
}
});
}
```#### Case
![test.jpg](./fixture/test.jpg)
![test.jpg](./fixture/test_borders.jpg)#### License
MIT © [lempiy](https://github.com/lempiy)