From: Cristy Date: Thu, 8 Dec 2016 12:33:51 +0000 (-0500) Subject: Respect connected-components:area-threshold define X-Git-Tag: 7.0.3-10~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a15ae563cc55d2001d5c23c99f773e8f598123d5;p=imagemagick Respect connected-components:area-threshold define --- diff --git a/ChangeLog b/ChangeLog index 6956a48b9..b51477ebe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2016-12-07 7.0.3-10 Cristy * Set colorspace to sRGB if -append has non-homogenous colorspaces (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29105). + * Respect connected-components:area-threshold define (reference + https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31006). 2016-12-05 7.0.3-9 Cristy * Release ImageMagick version 7.0.3-9, GIT revision 19139:6fed3f1:20161205. diff --git a/MagickCore/vision.c b/MagickCore/vision.c index da79681cb..1f843342b 100644 --- a/MagickCore/vision.c +++ b/MagickCore/vision.c @@ -469,7 +469,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, if (status == MagickFalse) continue; - if ((double) object[i].area >= area_threshold) + if ((double) object[i].area > area_threshold) continue; for (j=0; j < (ssize_t) component_image->colors; j++) object[j].census=0; @@ -688,7 +688,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image, if (status == MagickFalse) break; - if (object[i].area < MagickEpsilon) + if (object[i].area <= area_threshold) continue; GetColorTuple(&object[i].color,MagickFalse,mean_color); (void) fprintf(stdout,