Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunsided/stroke-width-transform-rs
A Rust implementation of the Stroke Width Transform.
https://github.com/sunsided/stroke-width-transform-rs
image-processing ocr rust stroke-width stroke-width-transform
Last synced: 3 months ago
JSON representation
A Rust implementation of the Stroke Width Transform.
- Host: GitHub
- URL: https://github.com/sunsided/stroke-width-transform-rs
- Owner: sunsided
- License: mit
- Created: 2021-07-07T21:39:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-26T16:44:49.000Z (8 months ago)
- Last Synced: 2024-10-11T02:29:56.051Z (3 months ago)
- Topics: image-processing, ocr, rust, stroke-width, stroke-width-transform
- Language: Rust
- Homepage: https://crates.io/crates/stroke-width-transform
- Size: 104 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Stroke Width Transform
[![Crates.io](https://img.shields.io/crates/v/stroke-width-transform)](https://crates.io/crates/stroke-width-transform)
[![Crates.io](https://img.shields.io/crates/l/stroke-width-transform)](https://crates.io/crates/stroke-width-transform)
[![codecov](https://codecov.io/gh/sunsided/stroke-width-transform-rs/graph/badge.svg?token=2M1H8XLWVG)](https://codecov.io/gh/sunsided/stroke-width-transform-rs)This is a Rust re-implementation of the [sunsided/stroke-width-transform] repo.
It provides a test implementation of the Stroke Width Transform algorithm described
in the paper [Detecting Text in Natural Scenes with Stroke Width Transform] (PDF [here]):> We present a novel image operator that seeks to find the value of stroke width for each image pixel, and demonstrate its use on the task of text detection in natural images. The suggested operator is local and data dependent, which makes it fast and robust enough to eliminate the need for multi-scale computation or scanning windows. Extensive testing shows that the suggested scheme outperforms the latest published algorithms. Its simplicity allows the algorithm to detect texts in many fonts and languages.
## Example
To apply SWT to an example image and show the result, run:
```console
$ cargo run --release --example swt -- --show images/train-station.jpg
```The immediate SWT output is a map in which each pixel value corresponds to the
length of the stroke the pixel is on.| Example Input | Example Output (SWT) |
|---------------------|--------------------------|
| ![](images/ocr.png) | ![](.readme/ocr-swt.jpg) |## Original publication
```bibtex
@InProceedings{epshtein2010detecting,
author = {Epshtein, Boris and Ofek, Eyal and Wexler, Yonatan},
title = {Detecting Text in Natural Scenes with Stroke Width Transform},
year = {2010},
month = {June},
abstract = {We present a novel image operator that seeks to find the value of stroke width for each image pixel, and demonstrate its use on the task of text detection in natural images. The suggested operator is local and data dependent, which makes it fast and robust enough to eliminate the need for multi-scale computation or scanning windows. Extensive testing shows that the suggested scheme outperforms the latest published algorithms. Its simplicity allows the algorithm to detect texts in many fonts and languages.},
publisher = {IEEE - Institute of Electrical and Electronics Engineers},
url = {https://www.microsoft.com/en-us/research/publication/detecting-text-in-natural-scenes-with-stroke-width-transform/},
}
```## License
The code in this repository is available under the MIT license (see [LICENSE.md]).
[sunsided/stroke-width-transform]: https://github.com/sunsided/stroke-width-transform
[Detecting Text in Natural Scenes with Stroke Width Transform]: https://www.microsoft.com/en-us/research/publication/detecting-text-in-natural-scenes-with-stroke-width-transform/
[here]: https://github.com/sunsided/stroke-width-transform/blob/master/paper/201020CVPR20TextDetection.pdf
[LICENSE.md]: LICENSE.md