From 6e0b3bcf62017e48472ee5721a7bcc4b10546b12 Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 19 Oct 2014 17:51:42 +0000 Subject: [PATCH] --- MagickCore/MagickCore.h | 1 + MagickCore/Makefile.am | 3 + MagickCore/version.h | 4 +- MagickCore/vision.c | 199 +++++++++++++++++++++++++++++++ MagickCore/vision.h | 32 +++++ MagickWand/convert.c | 11 ++ MagickWand/mogrify.c | 18 +++ MagickWand/operation.c | 8 ++ Makefile.in | 18 ++- PerlMagick/Magick.xs | 14 +++ PerlMagick/quantum/quantum.xs.in | 14 +++ configure | 2 +- utilities/convert.1.in | 2 + utilities/mogrify.1.in | 2 + 14 files changed, 324 insertions(+), 4 deletions(-) create mode 100644 MagickCore/vision.c create mode 100644 MagickCore/vision.h diff --git a/MagickCore/MagickCore.h b/MagickCore/MagickCore.h index ce6b94ecf..e430cc338 100644 --- a/MagickCore/MagickCore.h +++ b/MagickCore/MagickCore.h @@ -154,6 +154,7 @@ extern "C" { #include "MagickCore/type.h" #include "MagickCore/utility.h" #include "MagickCore/version.h" +#include "MagickCore/vision.h" #include "MagickCore/xml-tree.h" #include "MagickCore/xwindow.h" diff --git a/MagickCore/Makefile.am b/MagickCore/Makefile.am index 65c3fead1..96f9be6e3 100644 --- a/MagickCore/Makefile.am +++ b/MagickCore/Makefile.am @@ -286,6 +286,8 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/version.c \ MagickCore/version.h \ MagickCore/version-private.h \ + MagickCore/vision.c \ + MagickCore/vision.h \ MagickCore/vms.h \ MagickCore/widget.c \ MagickCore/widget.h \ @@ -407,6 +409,7 @@ MAGICKCORE_INCLUDE_HDRS = \ MagickCore/type.h \ MagickCore/utility.h \ MagickCore/version.h \ + MagickCore/vision.h \ MagickCore/widget.h \ MagickCore/xml-tree.h \ MagickCore/xwindow.h diff --git a/MagickCore/version.h b/MagickCore/version.h index dbfe9ef61..6e4621761 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -27,7 +27,7 @@ extern "C" { */ #define MagickPackageName "ImageMagick" #define MagickCopyright "Copyright (C) 1999-2014 ImageMagick Studio LLC" -#define MagickSVNRevision "16730:16732M" +#define MagickSVNRevision "16730:16750M" #define MagickLibVersion 0x700 #define MagickLibVersionText "7.0.0" #define MagickLibVersionNumber 1,0,0 @@ -48,7 +48,7 @@ extern "C" { #define MagickppLibAddendum "-0" #define MagickppLibInterface 1 #define MagickppLibMinInterface 1 -#define MagickReleaseDate "2014-10-18" +#define MagickReleaseDate "2014-10-19" #define MagickChangeDate "20120427" #define MagickAuthoritativeURL "http://www.imagemagick.org" #define MagickFeatures "DPC HDRI OpenMP" diff --git a/MagickCore/vision.c b/MagickCore/vision.c new file mode 100644 index 000000000..c32dc9f2f --- /dev/null +++ b/MagickCore/vision.c @@ -0,0 +1,199 @@ +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% V V IIIII SSSSS IIIII OOO N N % +% V V I SS I O O NN N % +% V V I SSS I O O N N N % +% V V I SS I O O N NN % +% V IIIII SSSSS IIIII OOO N N % +% % +% % +% MagickCore Computer Vision Methods % +% % +% Software Design % +% Cristy % +% September 2014 % +% % +% % +% Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization % +% dedicated to making software imaging solutions freely available. % +% % +% You may not use this file except in compliance with the License. You may % +% obtain a copy of the License at % +% % +% http://www.imagemagick.org/script/license.php % +% % +% Unless required by applicable law or agreed to in writing, software % +% distributed under the License is distributed on an "AS IS" BASIS, % +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % +% See the License for the specific language governing permissions and % +% limitations under the License. % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% +*/ + +#include "MagickCore/studio.h" +#include "MagickCore/accelerate.h" +#include "MagickCore/blob.h" +#include "MagickCore/cache-view.h" +#include "MagickCore/color.h" +#include "MagickCore/color-private.h" +#include "MagickCore/colorspace.h" +#include "MagickCore/constitute.h" +#include "MagickCore/decorate.h" +#include "MagickCore/distort.h" +#include "MagickCore/draw.h" +#include "MagickCore/enhance.h" +#include "MagickCore/exception.h" +#include "MagickCore/exception-private.h" +#include "MagickCore/effect.h" +#include "MagickCore/gem.h" +#include "MagickCore/geometry.h" +#include "MagickCore/image-private.h" +#include "MagickCore/list.h" +#include "MagickCore/log.h" +#include "MagickCore/matrix.h" +#include "MagickCore/memory_.h" +#include "MagickCore/memory-private.h" +#include "MagickCore/monitor.h" +#include "MagickCore/monitor-private.h" +#include "MagickCore/montage.h" +#include "MagickCore/morphology.h" +#include "MagickCore/morphology-private.h" +#include "MagickCore/opencl-private.h" +#include "MagickCore/paint.h" +#include "MagickCore/pixel-accessor.h" +#include "MagickCore/pixel-private.h" +#include "MagickCore/property.h" +#include "MagickCore/quantum.h" +#include "MagickCore/resource_.h" +#include "MagickCore/signature-private.h" +#include "MagickCore/string_.h" +#include "MagickCore/thread-private.h" +#include "MagickCore/vision.h" + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% C o n n e c t e d C o m p o n e n t s I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ConnectedComponentsImage() returns the connected-components of the image +% uniquely labeled. Choose from 4 or 8-way connectivity. +% +% The format of the ConnectedComponentsImage method is: +% +% Image *ConnectedComponentsImage(const Image *image, +% const size_t connectivity,ExceptionInfo *exception) +% +% A description of each parameter follows: +% +% o image: the image. +% +% o connectivity: how many neighbors to visit. +% +% o exception: return any errors or warnings in this structure. +% +*/ +MagickExport Image *ConnectedComponentsImage(const Image *image, + const size_t connectivity,ExceptionInfo *exception) +{ +#define ConnectedComponentsImageTag "ConnectedComponents/Image" + + CacheView + *image_view, + *component_view; + + Image + *component_image; + + MagickBooleanType + status; + + MagickOffsetType + progress; + + ssize_t + y; + + /* + Initialize connected components image attributes. + */ + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + assert(exception != (ExceptionInfo *) NULL); + assert(exception->signature == MagickSignature); + component_image=CloneImage(image,image->columns,image->rows,MagickTrue, + exception); + if (component_image == (Image *) NULL) + return((Image *) NULL); + if (SetImageStorageClass(component_image,DirectClass,exception) == MagickFalse) + { + component_image=DestroyImage(component_image); + return((Image *) NULL); + } + /* + ConnectedComponents image. + */ + status=MagickTrue; + progress=0; + image_view=AcquireVirtualCacheView(image,exception); + component_view=AcquireAuthenticCacheView(component_image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static,4) shared(progress,status) \ + magick_threads(image,component_image,component_image->rows,1) +#endif + for (y=0; y < (ssize_t) component_image->rows; y++) + { + register Quantum + *restrict q; + + register ssize_t + x; + + if (status == MagickFalse) + continue; + q=QueueCacheViewAuthenticPixels(component_view,0,y,component_image->columns, + 1,exception); + if (q == (Quantum *) NULL) + { + status=MagickFalse; + continue; + } + for (x=0; x < (ssize_t) component_image->columns; x++) + { + q++; + } + if (SyncCacheViewAuthenticPixels(component_view,exception) == MagickFalse) + status=MagickFalse; + if (image->progress_monitor != (MagickProgressMonitor) NULL) + { + MagickBooleanType + proceed; + +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp critical (MagickCore_ConnectedComponentsImage) +#endif + proceed=SetImageProgress(image,ConnectedComponentsImageTag,progress++, + image->rows); + if (proceed == MagickFalse) + status=MagickFalse; + } + } + component_view=DestroyCacheView(component_view); + image_view=DestroyCacheView(image_view); + if (status == MagickFalse) + component_image=DestroyImage(component_image); + return(component_image); +} diff --git a/MagickCore/vision.h b/MagickCore/vision.h new file mode 100644 index 000000000..88bc1a418 --- /dev/null +++ b/MagickCore/vision.h @@ -0,0 +1,32 @@ +/* + Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization + dedicated to making software imaging solutions freely available. + + You may not use this file except in compliance with the License. + obtain a copy of the License at + + http://www.imagemagick.org/script/license.php + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + MagickCore computer vision methods. +*/ +#ifndef _MAGICKCORE_VISION_H +#define _MAGICKCORE_VISION_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +extern MagickExport Image + *ConnectedComponentsImage(const Image *,const size_t,ExceptionInfo *); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif diff --git a/MagickWand/convert.c b/MagickWand/convert.c index 5614d9f22..d7e7c613c 100644 --- a/MagickWand/convert.c +++ b/MagickWand/convert.c @@ -181,6 +181,8 @@ static MagickBooleanType ConvertUsage(void) "-brightness-contrast geometry", " improve brightness / contrast of the image", "-canny geometry detect edges in the image", + "-connected-components connectivity", + " connected-components uniquely labeled", "-cdl filename color correct with a color decision list", "-charcoal radius simulate a charcoal drawing", "-chop geometry remove pixels from the image interior", @@ -1126,6 +1128,15 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, } if (LocaleCompare("concurrent",option+1) == 0) break; + if (LocaleCompare("connected-component",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowConvertException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowConvertInvalidArgumentException(option,argv[i]); + break; + } if (LocaleCompare("contrast",option+1) == 0) break; if (LocaleCompare("contrast-stretch",option+1) == 0) diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index eeeace833..7ab39cd9f 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -1194,6 +1194,13 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, MagickFalse,argv[i+1]); break; } + if (LocaleCompare("connected-component",option+1) == 0) + { + (void) SyncImageSettings(mogrify_info,*image,exception); + mogrify_image=ConnectedComponentsImage(*image, + StringToInteger(argv[i+1]),exception); + break; + } if (LocaleCompare("contrast",option+1) == 0) { (void) SyncImageSettings(mogrify_info,*image,exception); @@ -3354,6 +3361,8 @@ static MagickBooleanType MogrifyUsage(void) "-brightness-contrast geometry", " improve brightness / contrast of the image", "-canny geometry detect edges in the image", + "-connected-components connectivity", + " connected-components uniquely labeled", "-cdl filename color correct with a color decision list", "-charcoal geometry simulate a charcoal drawing", "-chop geometry remove pixels from the image interior", @@ -4285,6 +4294,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, } if (LocaleCompare("concurrent",option+1) == 0) break; + if (LocaleCompare("connected-components",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowMogrifyException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowMogrifyInvalidArgumentException(option,argv[i]); + break; + } if (LocaleCompare("contrast",option+1) == 0) break; if (LocaleCompare("contrast-stretch",option+1) == 0) diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 655178301..e728a52bd 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -2096,6 +2096,14 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, _exception); break; } + if (LocaleCompare("connected-components",option+1) == 0) + { + if (IfMagickFalse(IsGeometry(arg1))) + CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); + new_image=ConnectedComponentsImage(_image,StringToInteger(arg1), + _exception); + break; + } if (LocaleCompare("contrast",option+1) == 0) { CLIWandWarnReplaced(IfNormalOp?"-level":"+level"); diff --git a/Makefile.in b/Makefile.in index 55c2cb87b..8066feea4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -533,7 +533,8 @@ am__MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURC MagickCore/utility.c MagickCore/utility.h \ MagickCore/utility-private.h MagickCore/version.c \ MagickCore/version.h MagickCore/version-private.h \ - MagickCore/vms.h MagickCore/widget.c MagickCore/widget.h \ + MagickCore/vision.c MagickCore/vision.h MagickCore/vms.h \ + MagickCore/widget.c MagickCore/widget.h \ MagickCore/widget-private.h MagickCore/xml-tree.c \ MagickCore/xml-tree.h MagickCore/xml-tree-private.h \ MagickCore/xwindow.c MagickCore/xwindow.h \ @@ -658,6 +659,7 @@ am__objects_1 = MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGI MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-type.lo \ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-utility.lo \ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-version.lo \ + MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo \ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.lo \ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-xml-tree.lo \ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-xwindow.lo @@ -4387,6 +4389,8 @@ MAGICKCORE_BASE_SRCS = \ MagickCore/version.c \ MagickCore/version.h \ MagickCore/version-private.h \ + MagickCore/vision.c \ + MagickCore/vision.h \ MagickCore/vms.h \ MagickCore/widget.c \ MagickCore/widget.h \ @@ -4503,6 +4507,7 @@ MAGICKCORE_INCLUDE_HDRS = \ MagickCore/type.h \ MagickCore/utility.h \ MagickCore/version.h \ + MagickCore/vision.h \ MagickCore/widget.h \ MagickCore/xml-tree.h \ MagickCore/xwindow.h @@ -5778,6 +5783,9 @@ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_l MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-version.lo: \ MagickCore/$(am__dirstamp) \ MagickCore/$(DEPDIR)/$(am__dirstamp) +MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo: \ + MagickCore/$(am__dirstamp) \ + MagickCore/$(DEPDIR)/$(am__dirstamp) MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.lo: \ MagickCore/$(am__dirstamp) \ MagickCore/$(DEPDIR)/$(am__dirstamp) @@ -7271,6 +7279,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-type.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-utility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-xml-tree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-xwindow.Plo@am__quote@ @@ -8206,6 +8215,13 @@ MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_l @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-version.lo `test -f 'MagickCore/version.c' || echo '$(srcdir)/'`MagickCore/version.c +MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo: MagickCore/vision.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo -MD -MP -MF MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.Tpo -c -o MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo `test -f 'MagickCore/vision.c' || echo '$(srcdir)/'`MagickCore/vision.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.Tpo MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MagickCore/vision.c' object='MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-vision.lo `test -f 'MagickCore/vision.c' || echo '$(srcdir)/'`MagickCore/vision.c + MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.lo: MagickCore/widget.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.lo -MD -MP -MF MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.Tpo -c -o MagickCore/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.lo `test -f 'MagickCore/widget.c' || echo '$(srcdir)/'`MagickCore/widget.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.Tpo MagickCore/$(DEPDIR)/MagickCore_libMagickCore_@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la-widget.Plo diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index b67088c17..0af05e64e 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -555,6 +555,7 @@ static struct {"distance", RealReference} } }, { "Kuwahara", { {"geometry", StringReference}, {"radius", RealReference}, {"sigma", RealReference}, {"channel", MagickChannelOptions} } }, + { "ConnectedComponents", { {"connectivity", IntegerReference} } }, }; static SplayTreeInfo @@ -7547,6 +7548,8 @@ Mogrify(ref,...) MeanShiftImage = 283 Kuwahara = 284 KuwaharaImage = 285 + ConnectedComponent = 286 + ConnectedComponentImage = 287 MogrifyRegion = 666 PPCODE: { @@ -11217,6 +11220,17 @@ Mogrify(ref,...) (void) SetImageChannelMask(image,channel_mask); break; } + case 142: /* ConnectedComponent */ + { + size_t + connectivity; + + connectivity=4; + if (attribute_flag[0] != 0) + connectivity=argument_list[0].integer_reference; + image=ConnectedComponentsImage(image,connectivity,exception); + break; + } } if (next != (Image *) NULL) (void) CatchImageException(next); diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in index c667b05c1..c5b6da670 100644 --- a/PerlMagick/quantum/quantum.xs.in +++ b/PerlMagick/quantum/quantum.xs.in @@ -555,6 +555,7 @@ static struct {"double", RealReference} } }, { "Kuwahara", { {"geometry", StringReference}, {"radius", RealReference}, {"sigma", RealReference}, {"channel", MagickChannelOptions} } }, + { "ConnectedComponents", { {"connectivity", IntegerReference} } }, }; static SplayTreeInfo @@ -7547,6 +7548,8 @@ Mogrify(ref,...) MeanShiftImage = 283 Kuwahara = 284 KuwaharaImage = 285 + ConnectedComponent = 286 + ConnectedComponentImage = 287 MogrifyRegion = 666 PPCODE: { @@ -11215,6 +11218,17 @@ Mogrify(ref,...) (void) SetImageChannelMask(image,channel_mask); break; } + case 142: /* ConnectedComponent */ + { + size_t + connectivity; + + connectivity=4; + if (attribute_flag[0] != 0) + connectivity=argument_list[0].integer_reference; + image=ConnectedComponentsImage(image,connectivity,exception); + break; + } } if (next != (Image *) NULL) (void) CatchImageException(next); diff --git a/configure b/configure index 756fc6575..1c6326ce6 100755 --- a/configure +++ b/configure @@ -3698,7 +3698,7 @@ MAGICK_PATCHLEVEL_VERSION=0 MAGICK_VERSION=7.0.0-0 -MAGICK_SVN_REVISION=16730:16732M +MAGICK_SVN_REVISION=16730:16750M # Substitute library versioning diff --git a/utilities/convert.1.in b/utilities/convert.1.in index 347df6798..04a30851e 100644 --- a/utilities/convert.1.in +++ b/utilities/convert.1.in @@ -144,6 +144,8 @@ Image Operators: \-clip-path id clip along a named path from the 8BIM profile \-colorize value colorize the image with the fill color \-color-matrix matrix apply color correction to the image + \-connected-component connectivity + connected-components uniquely labeled \-contrast enhance or reduce the image contrast \-contrast-stretch geometry improve contrast by `stretching' the intensity range diff --git a/utilities/mogrify.1.in b/utilities/mogrify.1.in index 23acc6d55..3f63480b4 100644 --- a/utilities/mogrify.1.in +++ b/utilities/mogrify.1.in @@ -142,6 +142,8 @@ Image Operators: \-clip-path id clip along a named path from the 8BIM profile \-colorize value colorize the image with the fill color \-color-matrix matrix apply color correction to the image + \-connected-component connectivity + connected-components uniquely labeled \-contrast enhance or reduce the image contrast \-contrast-stretch geometry improve contrast by `stretching' the intensity range -- 2.40.0