aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/src/test/nopencv_test.cpp
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-06-05 21:22:01 +0200
committerjaseg <git@jaseg.de>2021-06-05 21:22:01 +0200
commit6685b7587a2d8c147715d89e27b0f3b40883b9f1 (patch)
treed73f82073aecaa4d6c87f279d30fc29f8a977d62 /svg-flatten/src/test/nopencv_test.cpp
parent3ef3f0223e9662f6c3cc6d213afcd74944399f6b (diff)
downloadgerbolyze-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/test/nopencv_test.cpp')
-rw-r--r--svg-flatten/src/test/nopencv_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/svg-flatten/src/test/nopencv_test.cpp b/svg-flatten/src/test/nopencv_test.cpp
index b32d22c..e4cc078 100644
--- a/svg-flatten/src/test/nopencv_test.cpp
+++ b/svg-flatten/src/test/nopencv_test.cpp
@@ -181,7 +181,7 @@ int render_svg(const char *in_svg, const char *out_png) {
static void testdata_roundtrip(const char *fn) {
Image32 ref_img;
mu_assert(ref_img.load(fn), "Input image failed to load");
- ref_img.binarize();
+ ref_img.binarize(128);
Image32 ref_img_copy(ref_img);
TempfileHack tmp_svg(".svg");
@@ -195,7 +195,7 @@ static void testdata_roundtrip(const char *fn) {
Image32 out_img;
mu_assert(out_img.load(tmp_png.c_str()), "Output image failed to load");
- out_img.binarize();
+ out_img.binarize(128);
mu_assert_int_eq(ref_img.cols(), out_img.cols());
mu_assert_int_eq(ref_img.rows(), out_img.rows());
@@ -231,7 +231,7 @@ static void test_polygon_area(const char *fn) {
//cerr << endl << "poly area test " << fn << endl;
Image32 ref_img;
mu_assert(ref_img.load(fn), "Input image failed to load");
- ref_img.binarize();
+ ref_img.binarize(128);
int white_px_count = 0;
int black_px_count = 0;
@@ -283,7 +283,7 @@ static void chain_approx_test(const char *fn) {
//cout << endl << "Testing \"" << fn << "\"" << endl;
Image32 ref_img;
mu_assert(ref_img.load(fn), "Input image failed to load");
- ref_img.binarize();
+ ref_img.binarize(128);
Image32 ref_img_copy(ref_img);
TempfileHack tmp_svg(".svg");