diff options
Diffstat (limited to 'src/coins.c')
-rwxr-xr-x[-rw-r--r--] | src/coins.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/coins.c b/src/coins.c index f532db8..9e85ee4 100644..100755 --- a/src/coins.c +++ b/src/coins.c @@ -231,7 +231,7 @@ int coins_positions (img_s *restrict img, ptrdiff_t nmemb, { conts_s *conts; rect_s *rect; - cont_s *cont; + const cont_s *cont; int status; ptrdiff_t x, y, w, h; @@ -245,14 +245,14 @@ int coins_positions (img_s *restrict img, ptrdiff_t nmemb, if (alx_cv_contours(img, conts)) goto out_free; - *ncoins = alx_cv_contours_size(conts); + alx_cv_extract_conts(conts, NULL, ncoins); if (*ncoins > nmemb) goto out_free; for (ptrdiff_t i = 0; i < *ncoins; i++) { - if (alx_cv_contours_contour((const cont_s **)&cont, conts, i)) + if (alx_cv_extract_conts_cont(&cont, conts, i)) goto out_free; alx_cv_bounding_rect(rect, cont); -alx_cv_draw_rect(img, rect); +//alx_cv_draw_rect(img, rect); alx_cv_extract_rect(rect, &x, &y, &w, &h); coins[i].x = x + w / 2; coins[i].y = y + h / 2; |