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 year 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-23T17:21:12.000Z (over 6 years ago)
- Last Synced: 2025-02-09T15:37:11.727Z (over 1 year 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
[](https://github.com/lempiy/slic0/actions)
[](https://github.com/lempiy/slic0/LICENSE)
[](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 Tasks
More 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


#### License
MIT © [lempiy](https://github.com/lempiy)