imgthin 0.1.1

A fast parallel algorithm for thinning digital patterns
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 33.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 400.68 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • FreeReacts/imgthin-rs
    6 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • whizsid

imgthin-rs

GitHub Actions crates.io MIT licensed Released API docs Master API docs

A rust image thinning library inspired by

A fast parallel algorithm for thinning digital patterns. (Improved/ Original)

Research Abstract

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.

Installation

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"]}

Usage

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.");

Showcase

Passed Thinned
imgthin-rs Passed Image imgthin-rs Thinned Image
imgthin-rs Passed Image imgthin-rs Thinned Image

Contributions

All PRs and issues are welcome. And stars are also welcome.