Zero-dependency, public domain header-only library that implements Stroke Width Transform
See:
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"
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
Original image | Detected text (Highlighted in Gray) |
---|---|
The tests are written using µnit find them at tests/
.\build.bat TEST
.\swt_test.exe