Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.92 KB

README.md

File metadata and controls

62 lines (39 loc) · 1.92 KB

Stroke Width Transform

Zero-dependency, public domain header-only library that implements Stroke Width Transform

See:

Quickstart

Grab a copy of swt.h and load it in your project as a stb-style lib

The documentation for functions is also contained within the header file

#define SWT_IMPLEMENTATION
#include "swt.h"

Examples

Here is how you would use this with stb

  /* ... */

    SWTImage image = { image_data, width, height, channels };
    SWTData *data = swt_allocate(width * height);

    swt_apply_stroke_width_transform(&image, data->components, data->results);
    
    // optionally visualize the points on the image
    swt_visualize_text_on_image(&image, data->results, 4);

    swt_free(data);

  /* ... */

this will produce the following output

Gallery

Original image Detected text (Highlighted in Gray)
original image detected text in gray
original image detected text in gray
original image detected text in gray

Tests

The tests are written using µnit find them at tests/

.\build.bat TEST
.\swt_test.exe