diff options
author | jaseg <git@jaseg.de> | 2021-06-05 21:22:01 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2021-06-05 21:22:01 +0200 |
commit | 6685b7587a2d8c147715d89e27b0f3b40883b9f1 (patch) | |
tree | d73f82073aecaa4d6c87f279d30fc29f8a977d62 /svg-flatten/src/nopencv.hpp | |
parent | 3ef3f0223e9662f6c3cc6d213afcd74944399f6b (diff) | |
download | gerbolyze-6685b7587a2d8c147715d89e27b0f3b40883b9f1.tar.gz gerbolyze-6685b7587a2d8c147715d89e27b0f3b40883b9f1.tar.bz2 gerbolyze-6685b7587a2d8c147715d89e27b0f3b40883b9f1.zip |
Fix binary contours vectorizer
Replace teh-chin with ramer-douglas-peucker
Diffstat (limited to 'svg-flatten/src/nopencv.hpp')
-rw-r--r-- | svg-flatten/src/nopencv.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/svg-flatten/src/nopencv.hpp b/svg-flatten/src/nopencv.hpp index 8f399b9..5dd399d 100644 --- a/svg-flatten/src/nopencv.hpp +++ b/svg-flatten/src/nopencv.hpp @@ -60,7 +60,7 @@ namespace gerbolyze { bool load(const char *filename); bool load_memory(const void *buf, size_t len); - void binarize(); + void binarize(T threshold); T &at(int x, int y) { assert(x >= 0 && y >= 0 && x < m_cols && y < m_rows); @@ -116,6 +116,7 @@ namespace gerbolyze { void find_contours(Image32 &img, ContourCallback cb); ContourCallback simplify_contours_teh_chin(ContourCallback cb); + ContourCallback simplify_contours_douglas_peucker(ContourCallback cb); double polygon_area(Polygon_i &poly); } |