Crates.io | imgthin |
lib.rs | imgthin |
version | 0.1.1 |
source | src |
created_at | 2020-08-03 13:20:57.491363 |
updated_at | 2020-08-04 21:41:40.13567 |
description | A fast parallel algorithm for thinning digital patterns |
homepage | https://github.com/FreeReacts/imgthin-rs |
repository | https://github.com/FreeReacts/imgthin-rs |
max_upload_size | |
id | 272526 |
size | 33,554 |
A rust image thinning library inspired by
A fast parallel algorithm for thinning digital patterns. (Improved/ Original)
A fast parallel thinning algorithm is proposed in this paper. It consists of two subiterations: one aimed at deleting the south-east boundary points and the north-west corner points while the other one is aimed at deleting the north-west boundary points and the south-east corner points. End points and pixel connectivity are preserved. Each pattern is thinned down to a "skeleton" of unitary thickness. Experimental results show that this method is very effective.
Add imgthin
as a dependency to the Cargo.toml
file.
To use the original algorithm from Zhang and Suen:-
# Cargo.toml
imgthin = "0.1.1"
To use the improved algorithm from Yung Sheng and Wen-Hsing:-
# Cargo.toml
imgthin = {version = "0.1.1", features=["improved_ysc_whh"]}
use imgthin::imgthin;
// _________ Vec<Vec<bool>>
// v
let thinned = imgthin(vec!(
vec!(false, false, true, true, false),
vec!(false, false, true, true, false),
vec!(false, false, true, true, false)
)).expect("Can not thin the image.");
Passed | Thinned |
---|---|
All PRs and issues are welcome. And stars are also welcome.