MagickCore  7.0.7
Convert, Edit, Or Compose Bitmap Images
morphology.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2018 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License.
6  obtain a copy of the License at
7 
8  https://www.imagemagick.org/script/license.php
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  MagickCore morphology methods.
17 */
18 #ifndef MAGICKCORE_MORPHOLOGY_H
19 #define MAGICKCORE_MORPHOLOGY_H
20 
21 #include "MagickCore/geometry.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 typedef enum
28 {
29  UndefinedKernel, /* equivalent to UnityKernel */
30  UnityKernel, /* The no-op or 'original image' kernel */
31  GaussianKernel, /* Convolution Kernels, Gaussian Based */
37  LaplacianKernel, /* Convolution Kernels, by Name */
44  DiamondKernel, /* Shape Kernels */
52  PeaksKernel, /* Hit And Miss Kernels */
62  ChebyshevKernel, /* Distance Measuring Kernels */
66  UserDefinedKernel /* User Specified Kernel Array */
68 
69 typedef enum
70 {
72 /* Convolve / Correlate weighted sums */
73  ConvolveMorphology, /* Weighted Sum with reflected kernel */
74  CorrelateMorphology, /* Weighted Sum using a sliding window */
75 /* Low-level Morphology methods */
76  ErodeMorphology, /* Minimum Value in Neighbourhood */
77  DilateMorphology, /* Maximum Value in Neighbourhood */
78  ErodeIntensityMorphology, /* Pixel Pick using GreyScale Erode */
79  DilateIntensityMorphology, /* Pixel Pick using GreyScale Dialate */
80  IterativeDistanceMorphology, /* Add Kernel Value, take Minimum */
81 /* Second-level Morphology methods */
82  OpenMorphology, /* Dilate then Erode */
83  CloseMorphology, /* Erode then Dilate */
84  OpenIntensityMorphology, /* Pixel Pick using GreyScale Open */
85  CloseIntensityMorphology, /* Pixel Pick using GreyScale Close */
86  SmoothMorphology, /* Open then Close */
87 /* Difference Morphology methods */
88  EdgeInMorphology, /* Dilate difference from Original */
89  EdgeOutMorphology, /* Erode difference from Original */
90  EdgeMorphology, /* Dilate difference with Erode */
91  TopHatMorphology, /* Close difference from Original */
92  BottomHatMorphology, /* Open difference from Original */
93 /* Recursive Morphology methods */
94  HitAndMissMorphology, /* Foreground/Background pattern matching */
95  ThinningMorphology, /* Remove matching pixels from image */
96  ThickenMorphology, /* Add matching pixels from image */
97 /* Directly Applied Morphology methods */
98  DistanceMorphology, /* Add Kernel Value, take Minimum */
99  VoronoiMorphology /* Distance matte channel copy nearest color */
101 
102 typedef struct _KernelInfo
103 {
104  KernelInfoType
106 
107  size_t
109  height;
110 
111  ssize_t
112  x,
113  y;
114 
117 
118  double
120  maximum,
123  angle;
124 
125  struct _KernelInfo
126  *next;
127 
128  size_t
130 } KernelInfo;
131 
133  *AcquireKernelInfo(const char *,ExceptionInfo *),
134  *AcquireKernelBuiltIn(const KernelInfoType,const GeometryInfo *,
135  ExceptionInfo *),
136  *CloneKernelInfo(const KernelInfo *),
138 
139 extern MagickExport Image
140  *MorphologyImage(const Image *,const MorphologyMethod,const ssize_t,
141  const KernelInfo *,ExceptionInfo *);
142 
143 extern MagickExport void
144  ScaleGeometryKernelInfo(KernelInfo *,const char *),
145  ScaleKernelInfo(KernelInfo *,const double,const GeometryFlags),
146  UnityAddKernelInfo(KernelInfo *,const double);
147 
148 #if defined(__cplusplus) || defined(c_plusplus)
149 }
150 #endif
151 
152 #endif
struct _KernelInfo * next
Definition: morphology.h:125
MagickDoubleType MagickRealType
Definition: magick-type.h:118
double positive_range
Definition: morphology.h:119
size_t height
Definition: morphology.h:108
MagickExport KernelInfo * AcquireKernelBuiltIn(const KernelInfoType, const GeometryInfo *, ExceptionInfo *)
double negative_range
Definition: morphology.h:119
ssize_t x
Definition: morphology.h:112
size_t signature
Definition: morphology.h:129
MorphologyMethod
Definition: morphology.h:69
KernelInfoType type
Definition: morphology.h:105
Definition: image.h:151
double maximum
Definition: morphology.h:119
MagickExport void UnityAddKernelInfo(KernelInfo *, const double)
Definition: morphology.c:4710
struct _KernelInfo KernelInfo
MagickExport void ScaleGeometryKernelInfo(KernelInfo *, const char *)
double minimum
Definition: morphology.h:119
size_t width
Definition: morphology.h:108
double angle
Definition: morphology.h:119
GeometryFlags
Definition: geometry.h:25
MagickExport KernelInfo * CloneKernelInfo(const KernelInfo *)
MagickExport Image * MorphologyImage(const Image *, const MorphologyMethod, const ssize_t, const KernelInfo *, ExceptionInfo *)
Definition: morphology.c:4108
MagickExport void ScaleKernelInfo(KernelInfo *, const double, const GeometryFlags)
MagickExport KernelInfo * DestroyKernelInfo(KernelInfo *)
Definition: morphology.c:2268
KernelInfoType
Definition: morphology.h:27
#define MagickExport
ssize_t y
Definition: morphology.h:112
MagickExport KernelInfo * AcquireKernelInfo(const char *, ExceptionInfo *)
MagickRealType * values
Definition: morphology.h:116