GeodesicClosing[image,ker]
gives the geodesic closing of image with respect to the structuring element ker.
GeodesicClosing[image,r]
gives the geodesic closing with respect to a range r square.
GeodesicClosing[data,…]
applies geodesic closing to an array of data.
GeodesicClosing
GeodesicClosing[image,ker]
gives the geodesic closing of image with respect to the structuring element ker.
GeodesicClosing[image,r]
gives the geodesic closing with respect to a range r square.
GeodesicClosing[data,…]
applies geodesic closing to an array of data.
Details
- GeodesicClosing works with binary, grayscale, and other images.
- GeodesicClosing works with 3D as well as 2D images, and also with data arrays of any rank.
- The structuring element ker is a matrix containing 0s and 1s.
- GeodesicClosing automatically pads structuring elements to have odd dimensions.
- GeodesicClosing[image,r] is equivalent to GeodesicClosing[image,BoxMatrix[r]].
- If multiple image channels are present, GeodesicClosing operates on each of them separately.
Examples
open all close allBasic Examples (2)
Scope (5)
Data (3)
GeodesicClosing of a 1D binary array:
GeodesicClosing[{1, 1, 1, 0, 1, 0, 0, 0, 1, 1}, 1]GeodesicClosing of a 2D binary array:
GeodesicClosing[(| | | | | |
| - | - | - | - | - |
| 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |), 1]//MatrixFormRemove small, dark features by geodesic closing:
GeodesicClosing[[image], 3]Parameters (2)
GeodesicClosing of a 2D binary array using a 2x2 kernel:
GeodesicClosing[(| | | | | |
| - | - | - | - | - |
| 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |), (| | |
| - | - |
| 1 | 1 |
| 1 | 1 |)]//MatrixFormUse a 3x3 kernel to remove pepper noise:
GeodesicClosing[[image], 1]Applications (5)
Reconstruction by top-hat transform:
img = [image];
ImageSubtract[GeodesicClosing[img, 4], img]GeodesicClosing[GeodesicOpening[[image], 1], 1]GeodesicOpening[GeodesicClosing[[image], 1], 1]Remove salt-and-pepper noise from a 3D image:
i = [image];GeodesicOpening[GeodesicClosing[i, 1], 1]Extract characters with long vertical strokes in a text image:
GeodesicClosing[[image], ConstantArray[1, {25, 1}]]Related Guides
History
Text
Wolfram Research (2012), GeodesicClosing, Wolfram Language function, https://reference.wolfram.com/language/ref/GeodesicClosing.html.
CMS
Wolfram Language. 2012. "GeodesicClosing." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GeodesicClosing.html.
APA
Wolfram Language. (2012). GeodesicClosing. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeodesicClosing.html
BibTeX
@misc{reference.wolfram_2026_geodesicclosing, author="Wolfram Research", title="{GeodesicClosing}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/GeodesicClosing.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_geodesicclosing, organization={Wolfram Research}, title={GeodesicClosing}, year={2012}, url={https://reference.wolfram.com/language/ref/GeodesicClosing.html}, note=[Accessed: 12-June-2026]}