|
MagickCore
6.7.5
|
00001 /* 00002 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization 00003 dedicated to making software imaging solutions freely available. 00004 00005 You may not use this file except in compliance with the License. 00006 obtain a copy of the License at 00007 00008 http://www.imagemagick.org/script/license.php 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 00016 MagickCore morphology methods. 00017 */ 00018 #ifndef _MAGICKCORE_MORPHOLOGY_H 00019 #define _MAGICKCORE_MORPHOLOGY_H 00020 00021 #if defined(__cplusplus) || defined(c_plusplus) 00022 extern "C" { 00023 #endif 00024 00025 #include <MagickCore/geometry.h> 00026 00027 typedef enum 00028 { 00029 UndefinedKernel, /* equivalent to UnityKernel */ 00030 UnityKernel, /* The no-op or 'original image' kernel */ 00031 GaussianKernel, /* Convolution Kernels, Gaussian Based */ 00032 DoGKernel, 00033 LoGKernel, 00034 BlurKernel, 00035 CometKernel, 00036 LaplacianKernel, /* Convolution Kernels, by Name */ 00037 SobelKernel, 00038 FreiChenKernel, 00039 RobertsKernel, 00040 PrewittKernel, 00041 CompassKernel, 00042 KirschKernel, 00043 DiamondKernel, /* Shape Kernels */ 00044 SquareKernel, 00045 RectangleKernel, 00046 OctagonKernel, 00047 DiskKernel, 00048 PlusKernel, 00049 CrossKernel, 00050 RingKernel, 00051 PeaksKernel, /* Hit And Miss Kernels */ 00052 EdgesKernel, 00053 CornersKernel, 00054 DiagonalsKernel, 00055 LineEndsKernel, 00056 LineJunctionsKernel, 00057 RidgesKernel, 00058 ConvexHullKernel, 00059 ThinSEKernel, 00060 SkeletonKernel, 00061 ChebyshevKernel, /* Distance Measuring Kernels */ 00062 ManhattanKernel, 00063 OctagonalKernel, 00064 EuclideanKernel, 00065 UserDefinedKernel /* User Specified Kernel Array */ 00066 } KernelInfoType; 00067 00068 typedef enum 00069 { 00070 UndefinedMorphology, 00071 /* Convolve / Correlate weighted sums */ 00072 ConvolveMorphology, /* Weighted Sum with reflected kernel */ 00073 CorrelateMorphology, /* Weighted Sum using a sliding window */ 00074 /* Low-level Morphology methods */ 00075 ErodeMorphology, /* Minimum Value in Neighbourhood */ 00076 DilateMorphology, /* Maximum Value in Neighbourhood */ 00077 ErodeIntensityMorphology, /* Pixel Pick using GreyScale Erode */ 00078 DilateIntensityMorphology, /* Pixel Pick using GreyScale Dialate */ 00079 DistanceMorphology, /* Add Kernel Value, take Minimum */ 00080 /* Second-level Morphology methods */ 00081 OpenMorphology, /* Dilate then Erode */ 00082 CloseMorphology, /* Erode then Dilate */ 00083 OpenIntensityMorphology, /* Pixel Pick using GreyScale Open */ 00084 CloseIntensityMorphology, /* Pixel Pick using GreyScale Close */ 00085 SmoothMorphology, /* Open then Close */ 00086 /* Difference Morphology methods */ 00087 EdgeInMorphology, /* Dilate difference from Original */ 00088 EdgeOutMorphology, /* Erode difference from Original */ 00089 EdgeMorphology, /* Dilate difference with Erode */ 00090 TopHatMorphology, /* Close difference from Original */ 00091 BottomHatMorphology, /* Open difference from Original */ 00092 /* Recursive Morphology methods */ 00093 HitAndMissMorphology, /* Foreground/Background pattern matching */ 00094 ThinningMorphology, /* Remove matching pixels from image */ 00095 ThickenMorphology, /* Add matching pixels from image */ 00096 /* Experimental Morphology methods */ 00097 VoronoiMorphology 00098 } MorphologyMethod; 00099 00100 typedef struct _KernelInfo 00101 { 00102 KernelInfoType 00103 type; 00104 00105 size_t 00106 width, 00107 height; 00108 00109 ssize_t 00110 x, 00111 y; 00112 00113 MagickRealType 00114 *values; 00115 00116 double 00117 minimum, 00118 maximum, 00119 negative_range, 00120 positive_range, 00121 angle, 00122 bias; 00123 00124 struct _KernelInfo 00125 *next; 00126 00127 size_t 00128 signature; 00129 } KernelInfo; 00130 00131 extern MagickExport KernelInfo 00132 *AcquireKernelInfo(const char *), 00133 *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *), 00134 *CloneKernelInfo(const KernelInfo *), 00135 *DestroyKernelInfo(KernelInfo *); 00136 00137 extern MagickExport Image 00138 *MorphologyImage(const Image *,const MorphologyMethod,const ssize_t, 00139 const KernelInfo *,ExceptionInfo *); 00140 00141 extern MagickExport void 00142 ScaleGeometryKernelInfo(KernelInfo *,const char *), 00143 ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags), 00144 UnityAddKernelInfo(KernelInfo *,const double); 00145 00146 #if defined(__cplusplus) || defined(c_plusplus) 00147 } 00148 #endif 00149 00150 #endif