From 613da9efa91306840aeefa18ce27464007fa866d Mon Sep 17 00:00:00 2001 From: alejandro-colomar Date: Thu, 3 Oct 2019 23:43:28 +0200 Subject: Update libalx --- Makefile | 1 + src/label.c | 16 +++++++--------- src/parse.c | 7 ++++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f6368b3..80ba236 100755 --- a/Makefile +++ b/Makefile @@ -126,6 +126,7 @@ CFLAGS_W += -Wstrict-prototypes CFLAGS_W += -Werror CFLAGS_PKG = `pkg-config --cflags opencv` +CFLAGS_PKG += `pkg-config --cflags opencv4` CFLAGS_PKG += `pkg-config --cflags libalx-cv` CFLAGS_PKG += `pkg-config --cflags libalx-ocr` CFLAGS_PKG += `pkg-config --cflags libalx-zbar` diff --git a/src/label.c b/src/label.c index a824807..9d2f2ec 100755 --- a/src/label.c +++ b/src/label.c @@ -14,9 +14,9 @@ #include #include -#include #include +#define ALX_NO_PREFIX #include #include #include @@ -222,7 +222,7 @@ int find_label (const img_s *restrict img, alx_cv_invert(img_tmp); if (alx_cv_smooth(img_tmp, ALX_CV_SMOOTH_MEAN, 21)) goto err; - if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY_INV, 2)) + if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY_INV, 2)) goto err; if (alx_cv_dilate_erode(img_tmp, 100)) goto err; @@ -290,7 +290,7 @@ int find_cerdo (const img_s *restrict img, if (alx_cv_init_rect(rect, lbl_x, lbl_y, lbl_w, lbl_h)) goto err; alx_cv_roi_set(img_tmp, rect); - if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, ALX_CV_THR_OTSU)) + if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, ALX_CV_THR_OTSU)) goto err; if (alx_cv_erode(img_tmp, 1)) goto err; @@ -383,11 +383,11 @@ int read_price (const img_s *restrict img, alx_cv_roi_set(img_tmp, rect); if (alx_cv_smooth(img_tmp, ALX_CV_SMOOTH_MEAN, 3)) goto err; - if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, ALX_CV_THR_OTSU)) + if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, ALX_CV_THR_OTSU)) goto err; if (alx_cv_dilate_erode(img_tmp, 1)) goto err; - if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, 1)) + if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, 1)) goto err; alx_cv_extract_imgdata(img_tmp, &imgdata, NULL, NULL, &imgdata_w, &imgdata_h, @@ -424,13 +424,11 @@ int chk_bcode_price (const char bcode[static restrict BUFSIZ], char bcode_price[BUFSIZ]; if (bcode[8] != '0') { - if (alx_sbprintf(bcode_price, NULL, "%c%c.%c%c", - bcode[8], bcode[9], + if (sbprintf(bcode_price, NULL, "%c%c.%c%c", bcode[8], bcode[9], bcode[10], bcode[11])) return -1; } else { - if (alx_sbprintf(bcode_price, NULL, "%c.%c%c", - bcode[9], + if (sbprintf(bcode_price, NULL, "%c.%c%c", bcode[9], bcode[10], bcode[11])) return -1; } diff --git a/src/parse.c b/src/parse.c index 4f69a06..4ee46c4 100755 --- a/src/parse.c +++ b/src/parse.c @@ -17,6 +17,7 @@ #include #include +#define ALX_NO_PREFIX #include #include @@ -123,9 +124,9 @@ void parse_file (char fname[static restrict FILENAME_MAX], char *arg) struct stat sb; if (stat(arg, &sb) || !S_ISREG(sb.st_mode)) - alx_error(EXIT_FAILURE, arg); - if (alx_snprintfs(fname, NULL, FILENAME_MAX, "%s", arg)) - alx_error(EXIT_FAILURE, arg); + errorx(EXIT_FAILURE, arg); + if (snprintfs(fname, NULL, FILENAME_MAX, "%s", arg)) + errorx(EXIT_FAILURE, arg); return; } -- cgit v1.2.3