diff options
author | Alejandro Colomar <colomar.6.4.3@gmail.com> | 2020-03-07 23:31:14 +0100 |
---|---|---|
committer | Alejandro Colomar <colomar.6.4.3@gmail.com> | 2020-03-07 23:31:14 +0100 |
commit | a42007cf763817488b5fb968be760d1cb1ed34b5 (patch) | |
tree | 1cfc8df160dcad697e02909df6bb4aeea8c60e8c | |
parent | b87858db00f1ab55d70ab9c690886c81ba878684 (diff) |
Update libalx
-rw-r--r-- | src/image/iface.cpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/image/iface.cpp b/src/image/iface.cpp index aa739e7..eb5f471 100644 --- a/src/image/iface.cpp +++ b/src/image/iface.cpp @@ -614,14 +614,16 @@ err: user_iface_log_write(1, "! Invalid input (Must be 1 channel)"); static void img_iface_white_mask (void) { - uint8_t tolerance; + uint8_t s_tolerance, l_tolerance; char txt[LOG_LINE_LEN]; - tolerance = user_iface_getint(0, 0, UINT8_MAX, "tolerance:", NULL); - if (alx::CV::white_mask(&image_copy_tmp, tolerance)) + s_tolerance = user_iface_getint(0, 0, UINT8_MAX, "S tolerance:", NULL); + l_tolerance = user_iface_getint(0, 0, UINT8_MAX, "L tolerance:", NULL); + if (alx::CV::white_mask(&image_copy_tmp, s_tolerance, l_tolerance)) goto err; - if (sbprintf(txt, NULL, "White mask: tol=%" PRIu8 "", tolerance) < 0) + if (sbprintf(txt, NULL, "White mask: S_tol=%" PRIu8 "; L_tol=%" PRIu8 "", + s_tolerance, l_tolerance) < 0) return; user_iface_log_write(1, txt); return; @@ -630,14 +632,16 @@ err: user_iface_log_write(1, "! Invalid input (Must be 1 channel)"); static void img_iface_black_mask (void) { - uint8_t tolerance; + uint8_t s_tolerance, l_tolerance; char txt[LOG_LINE_LEN]; - tolerance = user_iface_getint(0, 0, UINT8_MAX, "tolerance:", NULL); - if (alx::CV::black_mask(&image_copy_tmp, tolerance)) + s_tolerance = user_iface_getint(0, 0, UINT8_MAX, "S tolerance:", NULL); + l_tolerance = user_iface_getint(0, 0, UINT8_MAX, "L tolerance:", NULL); + if (alx::CV::black_mask(&image_copy_tmp, s_tolerance, l_tolerance)) goto err; - if (sbprintf(txt, NULL, "Black mask: tol=%" PRIu8 "", tolerance) < 0) + if (sbprintf(txt, NULL, "Black mask: S_tol=%" PRIu8 "; L_tol=%" PRIu8 "", + s_tolerance, l_tolerance) < 0) return; user_iface_log_write(1, txt); return; @@ -646,14 +650,16 @@ err: user_iface_log_write(1, "! Invalid input (Must be 1 channel)"); static void img_iface_gray_mask (void) { - uint8_t tolerance; + uint8_t s_tolerance, l_tolerance; char txt[LOG_LINE_LEN]; - tolerance = user_iface_getint(0, 0, UINT8_MAX, "tolerance:", NULL); - if (alx::CV::gray_mask(&image_copy_tmp, tolerance)) + s_tolerance = user_iface_getint(0, 0, UINT8_MAX, "S tolerance:", NULL); + l_tolerance = user_iface_getint(0, 0, UINT8_MAX, "L tolerance:", NULL); + if (alx::CV::gray_mask(&image_copy_tmp, s_tolerance, l_tolerance)) goto err; - if (sbprintf(txt, NULL, "Gray mask: tol=%" PRIu8 "", tolerance) < 0) + if (sbprintf(txt, NULL, "Gray mask: S_tol=%" PRIu8 "; L_tol=%" PRIu8 "", + s_tolerance, l_tolerance) < 0) return; user_iface_log_write(1, txt); return; @@ -917,14 +923,17 @@ err: static void img_iface_border (void) { ptrdiff_t size; + uint8_t val; char txt[LOG_LINE_LEN]; size = user_iface_getint(1, 1, INT16_MAX, "Size",NULL); + val = user_iface_getint(0, 0, UINT8_MAX, "Value",NULL); - if (alx::CV::border(&image_copy_tmp, size)) + if (alx::CV::border(&image_copy_tmp, size, val)) goto err; - if (sbprintf(txt, NULL, "Border size = %ti", size) < 0) + if (sbprintf(txt, NULL, "Border size = %ti; val = %" PRIu8 "", size, + val) < 0) return; user_iface_log_write(1, txt); return; |