Mathematical morphology
View on WikipediaThis article includes a list of general references, but it lacks sufficient corresponding inline citations. (June 2024) |

Mathematical morphology (MM) is a theory and technique for the analysis and processing of geometrical structures, based on set theory, lattice theory, topology, and random functions. MM is most commonly applied to digital images, but it can be employed as well on graphs, surface meshes, solids, and many other spatial structures.
Topological and geometrical continuous-space concepts such as size, shape, convexity, connectivity, and geodesic distance, were introduced by MM on both continuous and discrete spaces. MM is also the foundation of morphological image processing, which consists of a set of operators that transform images according to the above characterizations.
The basic morphological operators are erosion, dilation, opening and closing.
MM was originally developed for binary images, and was later extended to grayscale functions and images. The subsequent generalization to complete lattices is widely accepted today as MM's theoretical foundation.
History
[edit]Mathematical Morphology was developed in 1964 by the collaborative work of Georges Matheron and Jean Serra, at the École des Mines de Paris, France. Matheron supervised the PhD thesis of Serra, devoted to the quantification of mineral characteristics from thin cross sections, and this work resulted in a novel practical approach, as well as theoretical advancements in integral geometry and topology.
In 1968, the Centre de Morphologie Mathématique was founded by the École des Mines de Paris in Fontainebleau, France, led by Matheron and Serra.
During the rest of the 1960s and most of the 1970s, MM dealt essentially with binary images, treated as sets, and generated a large number of binary operators and techniques: Hit-or-miss transform, dilation, erosion, opening, closing, granulometry, thinning, skeletonization, ultimate erosion, conditional bisector, and others. A random approach was also developed, based on novel image models. Most of the work in that period was developed in Fontainebleau.
From the mid-1970s to mid-1980s, MM was generalized to grayscale functions and images as well. Besides extending the main concepts (such as dilation, erosion, etc.) to functions, this generalization yielded new operators, such as morphological gradients, top-hat transform and the Watershed (MM's main segmentation approach).
In the 1980s and 1990s, MM gained a wider recognition, as research centers in several countries began to adopt and investigate the method. MM started to be applied to a large number of imaging problems and applications, especially in the field of non-linear filtering of noisy images.
In 1986, Serra further generalized MM, this time to a theoretical framework based on complete lattices. This generalization brought flexibility to the theory, enabling its application to a much larger number of structures, including color images, video, graphs, meshes, etc. At the same time, Matheron and Serra also formulated a theory for morphological filtering, based on the new lattice framework.
The 1990s and 2000s also saw further theoretical advancements, including the concepts of connections and levelings.
In 1993, the first International Symposium on Mathematical Morphology (ISMM) took place in Barcelona, Spain. Since then, ISMMs are organized every 2–3 years: Fontainebleau, France (1994); Atlanta, USA (1996); Amsterdam, Netherlands (1998); Palo Alto, CA, USA (2000); Sydney, Australia (2002); Paris, France (2005); Rio de Janeiro, Brazil (2007); Groningen, Netherlands (2009); Intra (Verbania), Italy (2011); Uppsala, Sweden (2013); Reykjavík, Iceland (2015); Fontainebleau, France (2017); and Saarbrücken, Germany (2019).[1]
References
[edit]- "Introduction" by Pierre Soille, in (Serra et al. (Eds.) 1994), pgs. 1-4.
- "Appendix A: The 'Centre de Morphologie Mathématique', an overview" by Jean Serra, in (Serra et al. (Eds.) 1994), pgs. 369-374.
- "Foreword" in (Ronse et al. (Eds.) 2005)
Binary morphology
[edit]In binary morphology, an image is viewed as a subset of a Euclidean space or the integer grid , for some dimension d.
Structuring element
[edit]The basic idea in binary morphology is to probe an image with a simple, pre-defined shape, drawing conclusions on how this shape fits or misses the shapes in the image. This simple "probe" is called the structuring element, and is itself a binary image (i.e., a subset of the space or grid).
Here are some examples of widely used structuring elements (denoted by B):
- Let ; B is an open disk of radius r, centered at the origin.
- Let ; B is a 3 × 3 square, that is, B = {(−1, −1), (−1, 0), (−1, 1), (0, −1), (0, 0), (0, 1), (1, −1), (1, 0), (1, 1)}.
- Let ; B is the "cross" given by B = {(−1, 0), (0, −1), (0, 0), (0, 1), (1, 0)}.
Basic operators
[edit]The basic operations are shift-invariant (translation invariant) operators strongly related to Minkowski addition.
Let E be a Euclidean space or an integer grid, and A a binary image in E.
Erosion
[edit]
The erosion of the binary image A by the structuring element B is defined by
where Bz is the translation of B by the vector z, i.e., , .
When the structuring element B has a center (e.g., B is a disk or a square), and this center is located on the origin of E, then the erosion of A by B can be understood as the locus of points reached by the center of B when B moves inside A. For example, the erosion of a square of side 10, centered at the origin, by a disc of radius 2, also centered at the origin, is a square of side 6 centered at the origin.
The erosion of A by B is also given by the expression .
Example application: Assume we have received a fax of a dark photocopy. Everything looks like it was written with a pen that is bleeding. Erosion process will allow thicker lines to get skinny and detect the hole inside the letter "o".
Dilation
[edit]
The dilation of A by the structuring element B is defined by
The dilation is commutative, also given by .
If B has a center on the origin, as before, then the dilation of A by B can be understood as the locus of the points covered by B when the center of B moves inside A. In the above example, the dilation of the square of side 10 by the disk of radius 2 is a square of side 14, with rounded corners, centered at the origin. The radius of the rounded corners is 2.
The dilation can also be obtained by , where Bs denotes the symmetric of B, that is, .
Example application: dilation is the dual operation of the erosion. Figures that are very lightly drawn get thick when "dilated". Easiest way to describe it is to imagine the same fax/text is written with a thicker pen.
Opening
[edit]
The opening of A by B is obtained by the erosion of A by B, followed by dilation of the resulting image by B:
The opening is also given by , which means that it is the locus of translations of the structuring element B inside the image A. In the case of the square of side 10, and a disc of radius 2 as the structuring element, the opening is a square of side 10 with rounded corners, where the corner radius is 2.
Example application: Let's assume someone has written a note on a non-soaking paper and that the writing looks as if it is growing tiny hairy roots all over. Opening essentially removes the outer tiny "hairline" leaks and restores the text. The side effect is that it rounds off things. The sharp edges start to disappear.
Closing
[edit]
The closing of A by B is obtained by the dilation of A by B, followed by erosion of the resulting structure by B:
The closing can also be obtained by , where Xc denotes the complement of X relative to E (that is, ). The above means that the closing is the complement of the locus of translations of the symmetric of the structuring element outside the image A.
Properties of the basic operators
[edit]Here are some properties of the basic binary morphological operators (dilation, erosion, opening and closing):
- They are translation invariant.
- They are increasing, that is, if , then , and , etc.
- The dilation is commutative: .
- If the origin of E belongs to the structuring element B, then .
- The dilation is associative, i.e., . Moreover, the erosion satisfies .
- Erosion and dilation satisfy the duality .
- Opening and closing satisfy the duality .
- The dilation is distributive over set union
- The erosion is distributive over set intersection
- The dilation is a pseudo-inverse of the erosion, and vice versa, in the following sense: if and only if .
- Opening and closing are idempotent.
- Opening is anti-extensive, i.e., , whereas the closing is extensive, i.e., .
Other operators and tools
[edit]Grayscale morphology
[edit]
In grayscale morphology, images are functions mapping a Euclidean space or grid E into , where is the set of reals, is an element larger than any real number, and is an element smaller than any real number.
Grayscale structuring elements are also functions of the same format, called "structuring functions".
Denoting an image by f(x), the structuring function by b(x) and the support of b by B, the grayscale dilation of f by b is given by
where "sup" denotes the supremum.
Similarly, the erosion of f by b is given by
where "inf" denotes the infimum.
Just like in binary morphology, the opening and closing are given respectively by
Flat structuring functions
[edit]It is common to use flat structuring elements in morphological applications. Flat structuring functions are functions b(x) in the form
where .
In this case, the dilation and erosion are greatly simplified, and given respectively by
In the bounded, discrete case (E is a grid and B is bounded), the supremum and infimum operators can be replaced by the maximum and minimum. Thus, dilation and erosion are particular cases of order statistics filters, with dilation returning the maximum value within a moving window (the symmetric of the structuring function support B), and the erosion returning the minimum value within the moving window B.
In the case of flat structuring element, the morphological operators depend only on the relative ordering of pixel values, regardless their numerical values, and therefore are especially suited to the processing of binary images and grayscale images whose light transfer function is not known.
Other operators and tools
[edit]By combining these operators one can obtain algorithms for many image processing tasks, such as feature detection, image segmentation, image sharpening, image filtering, and classification. Along this line one should also look into Continuous Morphology[2]
Mathematical morphology on complete lattices
[edit]Complete lattices are partially ordered sets, where every subset has an infimum and a supremum. In particular, it contains a least element and a greatest element (also denoted "universe").
Adjunctions (dilation and erosion)
[edit]Let be a complete lattice, with infimum and supremum symbolized by and , respectively. Its universe and least element are symbolized by U and , respectively. Moreover, let be a collection of elements from L.
A dilation is any operator that distributes over the supremum, and preserves the least element. I.e.:
- ,
- .
An erosion is any operator that distributes over the infimum, and preserves the universe. I.e.:
- ,
- .
Dilations and erosions form Galois connections. That is, for every dilation there is one and only one erosion that satisfies
for all .
Similarly, for every erosion there is one and only one dilation satisfying the above connection.
Furthermore, if two operators satisfy the connection, then must be a dilation, and an erosion.
Pairs of erosions and dilations satisfying the above connection are called "adjunctions", and the erosion is said to be the adjoint erosion of the dilation, and vice versa.
Opening and closing
[edit]For every adjunction , the morphological opening and morphological closing are defined as follows:
The morphological opening and closing are particular cases of algebraic opening (or simply opening) and algebraic closing (or simply closing). Algebraic openings are operators in L that are idempotent, increasing, and anti-extensive. Algebraic closings are operators in L that are idempotent, increasing, and extensive.
Particular cases
[edit]Binary morphology is a particular case of lattice morphology, where L is the power set of E (Euclidean space or grid), that is, L is the set of all subsets of E, and is the set inclusion. In this case, the infimum is set intersection, and the supremum is set union.
Similarly, grayscale morphology is another particular case, where L is the set of functions mapping E into , and , , and , are the point-wise order, supremum, and infimum, respectively. That is, is f and g are functions in L, then if and only if ; the infimum is given by ; and the supremum is given by .
See also
[edit]Notes
[edit]- ^ "International Symposium on Mathematical Morphology and Its Applications to Signal and Image Processing". link.springer.com. Retrieved 2024-05-17.
- ^ G. Sapiro, R. Kimmel, D. Shaked, B. Kimia, and A. M. Bruckstein. Implementing continuous-scale morphology via curve evolution. Pattern Recognition, 26(9):1363–1372, 1993.
References
[edit]- Image Analysis and Mathematical Morphology by Jean Serra, ISBN 0-12-637240-3 (1982)
- Image Analysis and Mathematical Morphology, Volume 2: Theoretical Advances by Jean Serra, ISBN 0-12-637241-1 (1988)
- An Introduction to Morphological Image Processing by Edward R. Dougherty, ISBN 0-8194-0845-X (1992)
- Morphological Image Analysis; Principles and Applications by Pierre Soille, ISBN 3-540-65671-5 (1999), 2nd edition (2003)
- Mathematical Morphology and its Application to Signal Processing, J. Serra and Ph. Salembier (Eds.), proceedings of the 1st International workshop on mathematical morphology and its applications to signal processing (ISMM'93), ISBN 84-7653-271-7 (1993)
- Mathematical Morphology and Its Applications to Image Processing, J. Serra and P. Soille (Eds.), proceedings of the 2nd international symposium on mathematical morphology (ISMM'94), ISBN 0-7923-3093-5 (1994)
- Mathematical Morphology and its Applications to Image and Signal Processing, Henk J.A.M. Heijmans and Jos B.T.M. Roerdink (Eds.), proceedings of the 4th international symposium on mathematical morphology (ISMM'98), ISBN 0-7923-5133-9 (1998)
- Mathematical Morphology: 40 Years On, Christian Ronse, Laurent Najman, and Etienne Decencière (Eds.), ISBN 1-4020-3442-3 (2005)
- Mathematical Morphology and its Applications to Signal and Image Processing, Gerald J.F. Banon, Junior Barrera, Ulisses M. Braga-Neto (Eds.), proceedings of the 8th international symposium on mathematical morphology (ISMM'07), ISBN 978-85-17-00032-4 (2007)
- Mathematical morphology: from theory to applications, Laurent Najman and Hugues Talbot (Eds). ISTE-Wiley. ISBN 978-1-84821-215-2. (520 pp.) June 2010
External links
[edit]- Online course on mathematical morphology, by Jean Serra (in English, French, and Spanish)
- Center of Mathematical Morphology, Paris School of Mines
- History of Mathematical Morphology, by Georges Matheron and Jean Serra
- Morphology Digest, a newsletter on mathematical morphology, by Pierre Soille
- Lectures on Image Processing: A collection of 18 lectures in pdf format from Vanderbilt University. Lectures 16-18 are on Mathematical Morphology, by Alan Peters
- Mathematical Morphology; from Computer Vision lectures, by Robyn Owens
- SMIL - A Simple (but efficient) Morphological Image Library (from Ecole des Mines de Paris)
- Free SIMD Optimized Image processing library
- Java applet demonstration
- FILTERS : a free open source image processing library
- Fast morphological erosions, dilations, openings, and closings
- Morphological analysis of neurons using Matlab
Mathematical morphology
View on GrokipediaOverview
Definition and Core Principles
Mathematical morphology is a framework for analyzing shapes and structures within discrete or continuous spatial domains by probing an object with a structuring element, typically through nonlinear transformations that preserve geometric properties.[1] Developed from foundational work in set theory and integral geometry, it treats images or signals as collections of points and applies operations to reveal topological and geometrical features without relying on pixel intensity averaging.[6] The core principles of mathematical morphology include translation invariance, which ensures that operations yield the same result regardless of the object's position in space; extensivity, where certain transformations like closing produce sets that contain the original; and idempotence, meaning repeated application of operators such as opening or closing does not alter the outcome beyond the first application.[7] These properties arise inherently from the lattice structure underlying morphological operators, enabling consistent analysis of spatial patterns across translations and scales.[1] Unlike linear filtering methods such as convolution, which decompose signals into frequency components and use weighted sums to smooth or enhance features, mathematical morphology employs nonlinear set operations to directly target geometric attributes like edges, corners, and connectivity.[1] This focus on shape rather than spectral content makes it particularly effective for tasks involving irregular or discontinuous structures, where linear approaches may blur important boundaries. In its basic set-theoretic interpretation, images are represented as sets of points in a Euclidean or discrete space, with morphological operations defined as transformations via Minkowski addition or subtraction using a structuring element as the probe.[7] Dilation and erosion serve as the primitive operations, derived respectively from set unions and intersections reflected against the structuring element, forming the basis for more complex filters.[6] For illustration, consider a simple one-dimensional binary signal consisting of isolated pulses; applying dilation with a line segment structuring element expands each pulse while preserving their overall shape, followed by erosion to shrink them back, demonstrating how morphology maintains structural integrity without introducing artifacts from linear interpolation.[1]Key Applications
Mathematical morphology is widely applied in image processing for tasks such as segmentation, skeletonization, and boundary detection in computer vision. Segmentation employs dilation and erosion operations to separate foreground objects from backgrounds while preserving intrinsic shapes, as seen in the analysis of debris particles from polymer wear experiments for tribological studies. Skeletonization reduces complex shapes to their medial axis representations, enabling efficient feature extraction for subsequent analysis like connectivity assessment. Boundary detection utilizes the hit-miss transform to identify precise edges and corners, even in the presence of noise, by matching specific structuring elements to image patterns. These applications leverage grayscale extensions for intensity-based images, allowing processing of non-binary data without loss of detail.[8] In signal processing, mathematical morphology facilitates filtering of 1D signals to suppress noise and detect peaks, particularly in domains like power systems and mechanical diagnostics. For instance, multi-resolution morphological gradients extract transient features from power transmission line signals to identify faults, outperforming traditional methods in handling impulsive noise. In vibration analysis for gears and bearings, morphological opening and closing operations isolate envelope characteristics and pulse signals, aiding fault detection in rolling elements while preserving nonlinear signal traits. Texture analysis benefits from granulometric measures derived from successive openings, quantifying signal granularity for pattern discrimination. Opening and closing serve as nonlinear filters for noise removal, enhancing signal clarity without introducing artifacts common in linear methods.[9] Pattern recognition utilizes mathematical morphology for shape classification and granulometry, enabling robust object identification based on size and texture distributions. Granulometry, computed via iterative openings with scaled structuring elements, generates size histograms that characterize particle or object populations, as applied in classifying pneumoconiosis patterns in chest radiographs by discriminating textural densities. This approach links to perceptual models like texton theory, where attributes such as shape and size facilitate automated discrimination of complex patterns. A specific example is binary image thinning in optical character recognition (OCR), where morphological shrinking and normalization reduce character representations to skeletal forms, simplifying recognition while retaining semantic distinctions, as implemented in systems processing binarized text images.[10][11] Recent advances as of 2025 include hybrid approaches combining mathematical morphology with deep learning for improved segmentation in historical document analysis and parasite detection in microscopy images.[12][13] Beyond these core areas, mathematical morphology extends to diverse fields including medical imaging, materials science, and robotics. In medical imaging, rotational morphological processing enhances contrast in mammograms and radiographs, facilitating tumor boundary extraction with a contrast improvement ratio up to 12.1, far surpassing conventional techniques while maintaining homogeneous intensity. In materials science, it analyzes 3D particle shapes from range imagery to quantify angularity and simulate wear, optimizing aggregate production processes. For robotics, morphological operations in binary environments compute geodesic distances to plan optimal paths, minimizing direction changes around obstacles in 2D worlds. Overall, these applications highlight the method's advantages in robustness to noise—through shape-based filtering that avoids blurring—and preservation of topological properties, ensuring connectivity and Euler characteristics remain intact during transformations.[14][15][16]Fundamental Concepts
Structuring Element
In mathematical morphology, the structuring element serves as the fundamental kernel or probe that interacts with the input image to perform transformations, typically defined as a small, finite set or function centered at the origin. This element dictates the local neighborhood considered during operations, enabling the analysis of geometric features such as edges, corners, or textures by matching or comparing it against image points. Introduced in the foundational work on mathematical morphology, the structuring element encapsulates the shape and scale of the probe used to extract structural information from images.[17][18] Geometrically, a structuring element in two or three dimensions is represented as a collection of points relative to its origin, often visualized as simple binary shapes like a disk (ball), square, cross, or diamond. For instance, in binary images on a discrete grid, it might consist of a subset of pixels marked as foreground (value 1) with the origin at the center pixel. These shapes can extend to higher dimensions for volumetric data, maintaining the origin as the reference point for translations during processing. Common examples include the 3×3 square, which covers nine adjacent pixels in a grid, or a linear element along a specific direction to detect oriented features.[19][20] Key properties of structuring elements include reflectivity, defined as the 180-degree rotation or point reflection through the origin, denoted as the reflected set , which ensures consistency in operations like dilation and erosion. Structuring elements can also be decomposed into symmetric and asymmetric components; the symmetric part is invariant under reflection (), while the asymmetric part captures directional biases (). This decomposition aids in understanding how the element influences isotropic versus directional probing, with symmetric elements like disks promoting rotationally invariant results.[19][21] The role of the structuring element is to control the scale and directionality of morphological transformations, as it defines the extent and orientation of the neighborhood expansion or contraction applied to the image. By varying its size, larger elements detect broader features, while its shape imparts anisotropy, such as emphasizing horizontal lines with a flat rectangular probe. In practice, it briefly references how dilation expands object boundaries by the element's extent, while erosion shrinks them, but the element itself remains the core tool independent of specific computations.[22][17] A representative example is the 3×3 square structuring element applied to a binary pixel grid, where the element is a flat disk of radius 1, including the origin and its eight neighbors. Visualized in a discrete setting: 1 1 1
1 1 1
1 1 1
Here, the center '1' is the origin, and this element would probe a foreground pixel by checking if the entire square fits within the object during erosion or overlaps during dilation. Such an element is isotropic in the discrete sense, approximating a circular neighborhood for uniform feature detection.[19]
Selection of a structuring element depends on the targeted image features, with isotropic shapes like balls or disks suitable for rotationally invariant analysis (e.g., noise removal without directional bias), and anisotropic ones like lines or ellipses for detecting oriented structures such as edges or ridges. Criteria include matching the element's geometry to the expected scale of features—small for fine details, elongated for connectivity—and ensuring computational efficiency, often prioritizing decomposable or symmetric forms to simplify implementation.[20][23]
Dilation and Erosion
In mathematical morphology, dilation is a fundamental operation that expands a set by incorporating the shape defined by a structuring element. For finite sets and in a Euclidean space , the dilation is defined as the Minkowski sum: , which equivalently can be expressed as the union of all translates of by elements of : .[7] Geometrically, dilation represents the expansion of outward, filling gaps and thickening boundaries according to the shape of , as if "sweeping" with the structuring element .[7] Erosion, the dual primitive operation, contracts a set by removing parts that do not fully contain the structuring element. For sets and , the erosion is the Minkowski difference: , or equivalently, the intersection of all translates of by the negated elements of : .[7] Intuitively, erosion shrinks inward, eliminating thin protrusions and noise while preserving the core structure, akin to "etching" away regions where fails to fit entirely within .[7] These operations extend naturally to grayscale images, where functions and (with the structuring function) yield the grayscale dilation , previewing their role in intensity-based processing.[7] For illustration, consider a one-dimensional binary set as a line segment with gaps; dilating by a disk-like structuring element fills those gaps, effectively bridging discontinuities up to the diameter of . Conversely, eroding a binary shape like a rectangle with protrusions using the same removes those thin extensions narrower than 's width, smoothing the boundary.[7] Dilation and erosion form a dual pair under reflection of the structuring element: specifically, , where is the reflected , highlighting their adjoint relationship in the lattice framework.[7] Naively implementing dilation or erosion requires checking each point in the domain against all points in the structuring element, yielding a computational complexity of for finite sets, though optimized algorithms leveraging separability or decomposition can reduce this for specific .[7]Opening and Closing
In mathematical morphology, opening and closing are fundamental composite operators constructed from the basic dilation and erosion operations, serving as smoothing filters that preserve essential shape characteristics while eliminating noise or irregularities. The opening of a set by a structuring element , denoted , consists of first eroding with to remove small protrusions and then dilating the result back with ; this process effectively removes small objects and thin bridges that cannot fully contain , while preserving larger shapes that can accommodate it.[1] Similarly, the closing of by , denoted , involves dilating first to fill small holes and gaps, followed by erosion with to reconnect close components without expanding the overall boundary excessively.[1] Geometrically, opening acts to break thin connections or bridges between objects that are narrower than the structuring element, resulting in disconnected components where such features existed, whereas closing fuses nearby components separated by gaps smaller than , thereby maintaining the connectivity of the primary structure.[1] Both operators exhibit the idempotence property: applying opening repeatedly yields , and likewise for closing , ensuring that once the smoothing effect is achieved, further applications produce no change.[1] In practice, for a binary image containing noise such as isolated speckles, opening removes these small artifacts without altering prominent objects, while closing can seal cracks or holes within a shape, restoring its integrity; for instance, using a disk-shaped structuring element on a noisy binary representation of a particle effectively smooths its contour.[1] These operators also form the basis for more advanced techniques, such as the hit-or-miss transform, which combines elements of opening and closing to detect specific patterns in binary images.[24]Binary Morphology
Operations on Binary Images
Binary images in mathematical morphology are represented as sets of pixels where foreground objects are typically denoted by 1 (or black) and background by 0 (or white), equivalent to characteristic functions taking values in {0,1} or subsets of the digital grid .[1] This set-theoretic formulation allows operations to be expressed using unions and intersections, facilitating discrete implementations on pixel grids.[25] Dilation of a binary image by a structuring element (a small binary mask, such as a cross shape centered at the origin) is defined as the union of all translates of by elements of , i.e., , where .[25] This operation expands foreground regions, connects nearby components, and fills small holes. For example, consider a 5x5 pixel grid with a single foreground pixel at (2,2) and a cross structuring element ; the dilation yields a plus-shaped region covering the origin pixel and its four orthogonal neighbors.[1] Erosion, the dual operation, is the intersection of all translates of reflected through the origin by , given by , where .[25] It shrinks foreground objects, eliminates small noise, and separates weakly connected components. Applying erosion to a filled 3x3 square with a 3x3 disk structuring element (all nine positions) results in the single central pixel at (2,2), as the full disk is contained within only at that position; using a cross (five positions) also yields the single central pixel. Opening combines erosion followed by dilation: , which smooths contours, disconnects thin protrusions, and removes small isolated objects while preserving larger shapes.[25] Closing is the reverse: , filling small gaps and holes without altering overall topology.[25] In discrete implementations, these are often computed via raster-scan algorithms: for opening, scan the image row-by-row, marking pixels as foreground only if they survive erosion (i.e., all structuring element positions map to foreground in the input) and then dilate by setting neighbors to foreground if the center is marked; closing follows a similar dual process with initial dilation and subsequent erosion checks.[26] Boundary extraction in binary images uses the difference between the original set and its erosion: , yielding the object's edge with thickness determined by (e.g., a unit disk produces a one-pixel-thick boundary). For a solid rectangle, this isolates the perimeter pixels.[1] In digital grids, discrete considerations arise from neighborhood definitions: structuring elements can be 4-connected (orthogonal neighbors only, e.g., cross shape) or 8-connected (including diagonals, e.g., 3x3 square), affecting how translates probe adjacency and influencing operation outcomes like connectivity preservation during dilation or erosion.[25] For instance, a 4-connected element may fail to connect diagonally adjacent pixels, whereas 8-connected ensures fuller expansion.[1]Properties and Combinations
Morphological operators in binary mathematical morphology exhibit several key algebraic properties that ensure their consistency and utility in image analysis. Dilation and erosion are both monotonic, meaning that if set , then and for any structuring element .[27] Dilation is extensive, satisfying , while erosion is anti-extensive, with .[28] These operators also demonstrate duality via set complementation: , where denotes the complement and is the reflected structuring element.[27] Additionally, both dilation and erosion commute with translation, such that and for any vector .[28] Derived combinations of these basic operators enable more sophisticated processing tasks in binary settings. The morphological gradient, defined as , highlights edges by capturing the boundary regions where the object expands or contracts under dilation and erosion, respectively.[27] The white top-hat transform, given by where is the opening operator, isolates small bright spots or thin protrusions not removed by opening.[27] Granulometry provides a measure of size distribution by applying a family of openings with increasingly scaled structuring elements (e.g., disks of radius ) and computing the area of the result, yielding a curve , which quantifies the proportion of structures surviving at each scale; this concept was formalized by Georges Matheron.[27][1] An illustrative application of these combinations is binary skeletonization, which extracts the medial axis of a shape through iterative openings at multiple scales. The morphological skeleton is computed as the union , where denotes erosion, is the maximum scale until erosion yields the empty set, and is the opening; each term represents the residue after opening the successively eroded set, preserving the topology and centerline of the original binary object .[29]Grayscale Morphology
Extensions to Grayscale Functions
In mathematical morphology, grayscale images are represented as functions , where is the spatial domain, typically or a discrete grid, assigning a real-valued intensity to each point in the domain.[30] This formulation extends binary morphology, which treats images as indicator functions taking values in , to handle continuous intensity levels for applications like texture analysis and noise reduction.[30] The core operations of dilation and erosion are generalized to grayscale functions using a structuring function . Grayscale dilation at a point is defined asFlat Structuring Elements
In grayscale mathematical morphology, flat structuring elements represent a simplification where the structuring function is defined as for all within a finite support set , and otherwise. This construction effectively reduces the structuring element to a binary-like set , embedding set-theoretic operations into the grayscale domain while avoiding the complexities of varying heights in non-flat functions.[32][6] The operations simplify accordingly: the dilation of a grayscale function by a flat structuring element becomes the local maximum over the neighborhood defined by ,imdilate and imerode default to flat elements for grayscale inputs, enabling rapid prototyping without explicit height specifications.
Common applications include regional maxima detection, achieved via reconstruction by erosion with a flat element to isolate plateaus above surrounding neighborhoods, and morphological reconstruction, which iteratively applies conditional dilation or erosion to propagate markers while respecting masks.[32] For instance, in a grayscale terrain model representing elevation, dilation with a flat disk structuring element on the inverted elevation (treating depressions as peaks) can simulate flooding effects by computing the maximum depth in circular neighborhoods, effectively modeling water spread when combined with thresholding.
