Second-order differential invariants.
Abstract
The chapter introduces multiscale methods for image analysis and their applications to segmentation of microscopic images. Specifically, it presents mathematical morphology and linear scale-space theories as overarching signal processing frameworks without excessive mathematical formalization. The chapter introduces several differential invariants, which are computed from parametrized Gaussian kernels and their derivatives. The main application of this approach is to build a multidimensional multiscale feature space, which can be subsequently used to learn characteristic fingerprints of the objects of interests. More specialized applications, such as anisotropic diffusion and detection of blob-like and fiber-like structures, are introduced for two-dimensional images, and extensions to three-dimensional images are discussed. Presented approaches are generic and thus have broad applicability to time-varying signals and to two- and three-dimensional signals, such as microscopic images. The chapter is intended for biologists and computer scientists with a keen interest in the theoretical background of the employed techniques and is in part conceived as a tutorial.
Keywords
- Laplacian of Gaussian
- scale spaces
- mathematical morphology
- Fourier domain
1. Introduction
Neurophysiological data are very much variable, and while certain patterns are prominent and reproducible (e.g., action potentials, tissue textures, and cells) they by no means can be easily defined precisely in a quantitative way. Data are enriched with unwanted patterns having complicated temporal and spatial structure, which are misleadingly called “noise.” Unlike the noise, natural objects have features on a limited number of spatial or temporal scales. This observation is the starting point of all available multiscale methods of analysis. The main focus of the chapter are digital images; however the presented approaches can be applied in the more simple setting of time-varying one-dimensional signals, such as voltage electrophysiological recordings. In the subsequent presentation, the images will always be considered as two-dimensional signals sampled on a rectangular spatial grid. The reason is that all common microscopic approaches acquire images on a plane of illumination; thus three-, four-, and five-dimensional images are essentially sets of correlated planar signals. The third dimension can represent depth, time, or an acquisition channel. Obviously, in the case of four and five dimensions, the number of combinations increases. Therefore, one cannot assume isotropic resolution of the transfer function for more than two dimensions. This situation introduces anisotropy in microscopic images, compared to other imaging modalities, such as magnetic resonance imaging or computer tomography. In microscopy, in such way, the default case is a planar image.
All physical signals are bounded and of finite duration. Such signals are acquired as discrete samples from an underlying physical process which, as an idealization, can be considered as continuous. The physical signals are naturally related to the properties of the measurement apparatus. As another idealization, these properties are described by a linear transfer function so that the measurement process becomes a convolution (denoted further by
The chapter is organized as follows. Section 2 discusses the segmentation problem in general. Section 3 gives an overview of the mathematical morphology theory and provides examples. Section 4 gives an overview of the geometrical image features from the perspective of differential geometry. Section 5 introduces several types of scale spaces and their application in segmentation. Section 6 discussed implementation details. The chapter is intended for biologists and data scientists with keen interest in theoretical background of the employed techniques and is in part conceived as a tutorial. The references cited in the chapter are suitable for introductions on the mentioned topics.
2. Brief overview of image segmentation approaches
Extraction of an object’s boundaries from a digital image is called
The image segmentation is a nontrivial problem. For a successful image segmentation, it is important to have prior knowledge of the image composition, that is, the texture properties of the background and the objects of interest. Segmentation generates a mask consisting of a binary image delimiting the objects of interest present in the raw image. The challenge is to define an accurate segmentation methodology or at least an approach that enables segmentation of biologically relevant features. There are several classes of methods, which can be applied in different circumstances. These can be classified broadly into two classes: (i) intensity based, where the hypothesis is that only differences in the image intensity histogram can be sufficient for segmentation and (ii) geometry based, where the image is transformed so that the geometrical features of interest become enhanced.
Historically, the first and simplest segmentation methods are based on global thresholding of the histogram. Classical threshold-based methods consist of identifying a given pixel intensity level that allows for separating the object of interest from the background. There are about 40 different global thresholding algorithms [2]. Classically, an algorithm involving thresholding includes the following stages:
Preprocessing steps, which decrease the spatial variation of the image
Thresholding, which produces one or more binary masks
Masking or region of interest (ROI) selection
Post-processing steps, for example, including second thresholding or watershed
The watershed is based on a topographical interpretation of the grayscale image as terrain of mountains and valleys; the algorithm interpolates boundaries between objects based on the continuity in intensity peaks.
Various image filtering techniques can be introduced as preprocessing steps. These transformations are representations of mathematical operators. These operators have formal properties, which make them suitable for certain types of signals. For example, the convolution-based linear operators assume continuity of the sampled signal, while morphological operations do not. The notion of scale comes as the support of the sampled kernel, so multiscale analysis provides rules how the supports of different operators change with scale. It is also important to consider the sampling of the operators in the digital domain.
There are various geometry-based segmentation approaches, for example, using edges, distances, or texture statistics. In addition, there is a vast array of pre- and post-processing techniques, such as smoothing, mathematical morphology operations (i.e., watershed), partial differential equation methods, and shape methods. This manuscript will focus on the geometry-based methods with a particular emphasis on the edge detection techniques. Geometry-based approaches are invariant to changes of illumination, which is an issue in natural images and some microscopic techniques. In contrast, geometry-based approaches are susceptible to structural or texture “noise” so extra care must be taken to address such issues.
3. Mathematical morphology
The mathematical morphology (MM) theory is a way of analyzing objects’ shapes by way of interaction with shape primitives called structuring elements (SE) or
MM operators are useful for the analysis of both binary and grayscale images. Their common usages include edge detection, noise removal, image enhancement, and image segmentation. MM approaches employ topological transformations and hence do not depend, on the particular noise model. Therefore, they can be used also in situations, where the noise is non-Gaussian.
The main building blocks of MM are the

Figure 1.
Fundamental morphological operations. On the first row, an image of cell nuclei stained with DAPI (left) eroded (center) or dilated (right) with a disk of radius 10. On the second row, the same image is opened (left), closed (center), or granulometrically filtered. The inscribed numbers denote SE radii.
The closing with a SE is expressed as
The opening operation removes the objects, which are covered by
The multiscale aspects of the theory are due to the scaling of the structure elements. For example, the seed SE can be rescaled homothetically and then applied to the image. Such series of successive openings provides a measure of the prevalence of objects of a given size and is called granulometry (Figure 2). Granulometry can be used also to segment compact bright objects by means of a top-hat transform, where from the primitive image its opened version is subtracted:

Figure 2.
Granulometry of cell nuclei. An image of cell nuclei stained with DAPI is opened with an increasing sequence of disk-shaped kernels. Note the eventual disappearance of the central bright object. The inscribed numbers denote SE radii.
The second equation represents the granulometric filtering operation, which can extract bright objects of a specific size range from an image [5, 6].
Homogeneous scaling, that is, homothety, can be varied with the metric, which is induced on the SE. This can be box-like, circular, diamond, etc.
Another useful realization is the morphological gradient operation, which is the difference between an opening and a closure
4. Geometrical image features
Mathematically, images can be represented as surfaces in the three-dimensional Euclidean space, where the elevation represents the signal intensity. In this sense, the intensity at a certain point in the direction
Components of the gradient are given by
where for smooth signals the partial derivatives commute
The fact that digital images are sampled on a discrete grid may represent some difficulty as differentiation in the literal sense does not work for discrete signals. Notably, naive computations are numerically unstable and amplify the high-frequency noise. This difficulty can be overcome by applying the distribution theory, starting from the Leibniz identity for smooth signals [7]:
where
From this point on, differentiation of a digital image will be interpreted only in the generalized sense as a convolution with some smooth kernel. In such way, various local differential geometric invariants can be also incorporated into the processing. There are several filter families, which possess desirable properties, which can be exploited for systematic image noise suppression and computation of differential invariants. These families are formalized by the framework of the scale-space theory. Notable examples are the spatial derivatives of the Gaussian, which are used in the linear scale-space theory 5.1.
4.1 Differential invariants
There are several types of geometric features, which are useful for segmentation applications. Typical interesting image features are blobs, filaments, and corners. Notably, object boundaries can be represented in terms of edges, which can be approximated by steps in image intensity. All these features can be computed from the local differential structure of the image. The theory will be exemplified with the Gaussian derivatives, which, in view of the duality property of Eq. (7), can be used to compute the image derivatives.
The first four differential invariants are given in Table 1. The gradient vector field of the test image is represented in Figure 3.
Gradient amplitude | |
Gradient orientation | |
Laplacian | |
Determinant of the Hessian |
Table 1.

Figure 3.
The gradient image field. The gradient vector filed is overlaid onto a smoothed and downsampled version of the original image. The gradient amplitude is encoded by the arrow intensity.
The eigenvalues of the Hessian tensor are solutions of the characteristic equation
If the eigenvalues have opposite signs, this is an indication for a saddle point at the point of reference. Therefore, the zero-crossing of the Laplacian operator can be used to delimit regions, encompassing blobs. The zero-crossings form the so-called zero space, which can be used to identify objects. The regions where the Laplacian changes sign can be extracted by connected component analysis, which are defined as regions of adjacent pixels that have the same input label. In this regard, different neighborhoods can be considered for the blobs (4-connected, N4) and for the contours (8-connected, N8). To compute the connected components of an image, we first (conceptually) split the image into horizontal runs of adjacent pixels and then color the runs with unique labels, reusing the labels of vertically adjacent runs whenever possible. In a second phase, adjacent runs of different colors are then merged [9].
The zero space is demonstrated in Figure 4, where the connected components where the Laplacian changes sign are labeled. From the figure, it is apparent that the cell nuclei can be enclosed well by the blobs.

Figure 4.
Connected components of the Laplacian operator’s zero space. The boundary (left) is overlaid on the cell nuclei image (right). The connected components (center) are calculated from Laplacian of Gaussian, s = 12.
The number of differential invariants increases with the increase of the image dimensions. However, the theory can be extended along similar lines. A very useful development in this direction is geometric algebra and calculus, which provide a dimension invariant representation of the geometrical structures.
The so-introduced geometric image features can be used as building blocks for advanced machine learning strategies for interactive segmentation and classification. This strategy was implemented in two segmentation platforms based on ImageJ/Fiji. The Trainable Weka Segmentation (TWS) [10] and the Active Segmentation [11] have recently presented new opportunities for analyzing complex datasets. Specifically, the active segmentation uses the scale-space-based filters presented here.
5. Scale-space theory
In the digital domain, smoothing leads to loss of resolution and, therefore, of some information. However, the information loss can be limited if one uses multiple smoothing scales (see Figure 5).

Figure 5.
Gaussian scale space of cell nuclei. An image of cell nuclei stained with DAPI is convolved with an increasing sequence of Gaussian kernels. Inscribed labels denote kernel half widths.
Scale-space theory is a framework for multiscale image representation, which has been developed by the computer vision scientists with intuitive motivations from physics and biological vision, as introduced by [12]. The underlying idea is to account for the multiscale nature of real-world objects, which implies that objects may be perceived in different ways depending on the scale of observation. Taken to the limit, a scale-space representation furthermore considers representations at all scales simultaneously. Scale spaces have been introduced independently in Japan and Europe by [12, 13]. The axiomatic linear scale-space theory was formalized in series of works by Witkin [14] and Koenderink [15].
Scale-space approaches are ubiquitous in feature detection/description, as well as dense correspondence mapping (e.g., large-offset optical flow is typically done in coarse-to-fine fashion) [9].
5.1 The Gaussian scale space
The liner scale-space theory provides a systematic way of dealing with spatially uncorrelated Gaussian noise. A fundamental result of scale-space theory states that if some general conditions are imposed on the types of computations that are to be performed in the earliest stages of visual processing, then convolution by the Gaussian kernel and its derivatives provides a canonical class of image operators with unique properties. The Gaussian kernel in 1D is given by
and
in two dimensions. A very useful property of the kernel is its separability, which allows for efficient computation of convolutions for multiple spatial dimensions. That is, for example, in two dimensions
Therefore, the computational cost scales linearly with the support of the kernel rather than quadratically.
The Gaussian scale space depends on a free scalar parameter
In its typical presentation, the scale-space theory applies only smoothing steps. Later, the theory was extended to include also differentiation and thus account for the differential structure of the images [16]. In the spatial domain, the Gaussian derivatives for the one-dimensional case can be computed in closed form as
where
starting from

Figure 6.
Differential Gaussian 2-jet space. A microscopic image of Drosophila brain (first column) is convolved with Gaussian derivative kernels. Different kernels are shown above the arrows. The second column shows the components of the gradient. The third column shows the components of the Hessian. The local jet space of order k has
In spite of several properties that make linear diffusion filtering useful, it also reveals some drawbacks [17]:
An obvious disadvantage of Gaussian smoothing is the fact that it does not only smooth noise but also blurs important features such as edges. Moreover, it is uncommitted to any prior information about the image structure.
Linear diffusion filtering propagates edges when moving from finer to coarser scales, which can lead to difficulties in edge identification and instabilities.
5.2 α -Scale spaces
The
The Riesz fractional Laplacian operator is defined in the Fourier domain by
where the
5.3 Nonlinear scale spaces
Linear diffusion scale spaces are well-posed and have a solid axiomatic foundation. On the other hand, for some applications, they have the undesirable property that they do not permit contrast enhancement and that they may blur and delocalize structures. Nonlinear scale spaces try to overcome some of these limitations. Such scale spaces arise in nonlinear partial differential equation framework, which will be sketched below. The formal properties of some types of scale spaces have been established by Alvarez et al. [4]. In particular, they established a strong link with the related field of mathematical morphology (see Section 3). The following second-order partial differential equation was demonstrated in particular
where
In this line of development, the Laplacian of Gaussian (LoG) operator can be decomposed into orthogonal and tangential components ([17], Ch. 1). The representation is provided below:
The parentheses denote scalar multiplication with the component of the gradient. The orthogonal decomposition is equivalent to an effective vectorization of the filter. The normal component is antiparallel to the gradient (i.e., in normal direction to the isophote curve), while the tangential component is parallel to the isophote curve passing through the point. These components can be used to segment blob-like or tubular structures. Segmentation based on the orthogonal decomposition is illustrated in Figure 7.

Figure 7.
Blob segmentation. Zero-crossing of the LoG decomposition, s = 6 (A) and s = 12 (B). Two blobs are highlighted for better appreciation. The normal component is in Lap T, tangential component of the Laplacian; Lap O, normal component of the Laplacian.
The orthogonal decomposition leads naturally to anisotropic diffusion (Figure 8). For example, if the tangential component is selected, this will lead to preservation of globular structures, while if the normal component is selected, this will lead to enhancement of the tubular structures. The equation

Figure 8.
Anisotropic diffusion along principal flow directions. Astrocytes were stained immunohistochemically for glial fibrillary acidic protein (GFAP) and imaged on a confocal microscope (left). Anisotropic diffusion evolved according to the orthogonal decomposition of the Laplacian, s = 3, 3 steps—Tangential direction (center) and along the gradient direction (right). Note the granularity of the right image and its blurred appearance compared to the central image.
6. Implementation
The filters described in the present manuscript are implemented in ImageJ as a set of plug-ins (Table 2). Two implementation strategies have been used: the integer order filters are implemented in the spatial domain, while the fractional order filters are implemented in the Fourier domain [21].1 The plug-ins are distributed under the GNU Lesser General Public License v3.0 and are available as code repository from the GitHub website [22].2 The choice of implementation platform was due to the widespread use of ImageJ in the biomedical and life science communities.
Plug-in | Function |
---|---|
LoG filter | Laplacian of Gaussian (LoG) |
ALoG filter | Anisotropic decomposition of LoG |
ADiff filter | Anisotropic diffusion |
LoG2 filter | Bi-Laplacian of Gaussian |
LoGN2D filter | N-order power of the Laplacian of Gaussian |
Gaussian jet | Gaussian jet of order n |
Zero-crosser | Connected components |
Table 2.
ImageJ plug-ins demonstrated in the chapter.
ImageJ is a public domain image processing program written in Java. Since its inception in 1997, ImageJ has evolved to become a standard analytical tool in a number of scientific communities. In particular, for life science communities, it is available as the Fiji plug-in platform, which allows for easy plug-in deployment and dependency management. ImageJ has an open architecture providing extensibility via third-party Java modules (called plug-ins) and scripting macros. It is developed by Wayne Rasband since 1997 and expanded via contributed software code by an international group of contributors. Plug-ins are distributed together with their source code under various licenses determined by the plug-in authors. The user guide of the platform [23] is maintained at http://imagej.nih.gov/ij/docs/guide
7. Discussion
The morphological complexity of the nervous tissue is a challenge for conventional segmentation techniques developed for computer vision applications or cultured cells. The challenges lie in the morphological complexity of neurons and glial cells overlaid on the heterogeneity of the extracellular matrix. This complexity translates into variations of the tracer signal and touching of relevant structures.
Segmentation of fluorescent images poses particular issues due to low signal-to-noise ratio, unequal staining, as well as the complexity of structures that need to be identified. This irreducible variation must inform choices about segmentation methods. In particular, methods employing multiple spatial scales are favorable. Structure identification is inherently a multiscale problem because object structure is recursive, that is, objects may contain substructures, which themselves contain substructures, etc.
A large number of algorithms for image segmentation have been proposed in literature (overview in [9]). However, many of them completely ignore the issue of scale. As a result, they are capable of identifying only limited types of structures. In contrast, multiscale approaches eventually rely on the topological properties of the segmented objects, either by means of scale spaces or by nonlinear vector field transforms [25, 26]. As a result, such methods are able to combine detected features into robust segmentation tools. The present chapter introduced two classes of multiscale methods for image segmentation: the mathematical morphology operations and scale spaces. The main applications of the theory are classification and segmentation of signals. Presented methods are generic and thus have broad applicability to both one-dimensional signals, such as electrophysiological recordings, and to two and three-dimensional signals, such as microscopic images.
8. Conclusions and outlook
The main utility of the presented approaches is to build a multidimensional multiscale feature space, which is subsequently used to learn characteristic “fingerprints” of the objects of interests. The large variation of structures present in microscopic images precludes the design of an “ideal” tool. Instead, multiple approaches should be combined and features computed that would inform machine learning approaches, which are able to adapt to the morphology of the cells and tissues at hand. Development in this direction has been undertaken with the advent of deep learning techniques. ImageJ-based implementations, such as the Trainable Weka Segmentation [10] and the Active Segmentation platforms [11], have been made available to end-users.
A.1 Ranking operations
This section starts with a brief introduction to the set notation. In many sources it is called also the “set builder notation.” The empty set is denoted as
From a formal perspective, the mathematical morphology is the application of lattice theory to spatial structures [3]. Formally, the erosion is expressed as
for binary images, while for grayscale discrete images, it is
Formally, the dilation for binary images is
while for grayscale discrete images
In the continuous approximation case, the minimum and maximum should be replaced by infimum and supremum, respectively. Consider the set
A.2 Some useful Fourier transforms
The concept of frequency and the decomposition of waveforms into elementary “harmonic” wave motions first arose in the context of music and sound. The Fourier transform and its inverse in the continuous domain are defined as
The reader is directed to the book of [27] for an introduction on the topic.
The Fourier transform of the Gaussian is given by
and of its derivatives by
In the Fourier domain, the fractional heat kernel is expressed as
By substitution with the radial wavenumber
Therefore, the kernel bandwidth can be controlled by the fractional power
A.3 Convolutions and Fourier domain processing
So far the described theory can work both in the spatial and the Fourier domain. A schematic treatment of the Fourier transform is given in Section A.2. Interested readers are referred to Burgers for a more complete introduction. The Fourier domain processing implemented via Fast Fourier Transform has a certain advantage. On the first place, for large convolution kernels, it can lead to speedup. This is so because convolution in spatial (respectively temporal) domain corresponds to multiplication in the Fourier domain. This incurs fixed computation costs; therefore, the convolution operation scales as
In the diagram above, the arrows indicate transformation, while FFT and IFFT denote forward and Inverse Fast Fourier Transforms, respectively. In the example of differentiation in the previous section, the kernel is the wave vector
List of acronyms
mathematical morphology
structuring element
fast Fourier transform
inverse fast Fourier transform
glial fibrillary acidic protein
Laplacian of Gaussian
region of interest
References
- 1.
Boyat AK, Joshi BK. A review paper: Noise models in digital image processing. Signal & Image Processing: An International Journal. 2015; 6 (2):63-75 - 2.
Sezgin M, Sankur B. Survey over image thresholding techniques and quantitative performance evaluation. Journal of Electronic Imaging. 2004; 13 (1):146-166 - 3.
Serra J. Introduction to mathematical morphology. Computer Vision, Graphics, and Image Processing. 1986; 35 (3):283-305 - 4.
Alvarez L, Guichard F, Lions PL, Morel JM. Axioms and fundamental equations of image processing. Archive for Rational Mechanics and Analysis. 1993; 123 (3):199-257 - 5.
Prodanov D, Heeroma J, Marani E. Automatic morphometry of synaptic boutons of cultured cells using granulometric analysis of digital images. Journal of Neuroscience Methods. 2006; 151 :168-177 - 6.
Prodanov D, Feirabend HKP. Automated characterization of nerve fibers labeled fluorescently: Determination of size, class and spatial distribution. Brain Research. 2008; 1233 :35-50 - 7.
Florack L, Ter Haar Romeny B, Viergever M, Koenderink J. The Gaussian scale-space paradigm and the multiscale local jet. International Journal of Computer Vision. apr 1996; 18 (1):61-75 - 8.
Larsen ABL, Darkner S, Dahl AL, Pedersen KS. Jet-based local image descriptors. In: Computer Vision – ECCV. Springer Berlin Heidelberg; 2012. pp. 638, 2012-650 - 9.
Szeliski R. Computer Vision. Springer-Verlag GmbH; 2010 - 10.
Arganda-Carreras I, Kaynig V, Rueden C, Eliceiri KW, Schindelin J, Cardona A, et al. Trainable weka segmentation: A machine learning tool for microscopy pixel classification. Bioinformatics. 2017; 33 (15):2424-2426 - 11.
Vohra S, Prodanov D. Classification and segmentation of cells in anatomic & time lapse microscopic images based on geometrical features and machine learning. Frontiers in Neuroinformatics. 2016; 10 - 12.
Marr D, Hildreth E. Theory of edge detection. Proceedings of the Royal Society of London. Series B. 1980; 207 :187-217 - 13.
Iijima T. Theory of pattern recognition. Electronics and Communications in Japan. 1963:123-134 - 14.
Witkin AP. Scale-space filtering. In: Proceedings of the 8th International Joint Conference on Artificial Intelligence (IJCAI ‘83), Vol. 2, Aug. 8–12. 1983. pp. 1019-1022 - 15.
Koenderink JJ. The structure of images. Biological Cybernetics. 1984; 50 (5):363-370 - 16.
Lindeberg T. Scale-Space. Wiley Encyclopedia of Computer Science and Engineering; 2007. pp. 2495-2504 - 17.
Weickert J. Anisotropic Diffusion in Image Processing. ECMI Series. Stuttgart: Teubner-Verlag; 1998 - 18.
Pauwels EJ, Van Gool LJ, Fiddelaers P, Moons T. An extended class of scale-invariant and recursive scale space filters. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1995; 17 (7):691-701 - 19.
Duits R, Felsberg M, Florack L, Platel B. α -Scale spaces on a bounded domain. In: Scale Space Methods in Computer Vision. Springer; 2003. pp. 494-510 - 20.
Mainardi F. Fractional Calculus and Waves in Linear Viscoelasticity. Imperial College Press; 2010 - 21.
García-Fernández V, Prodanov D. Image segmentation based on frequency domain operation (FFT) and plugin implementation for ImageJ. Frontiers in Neuroinformatics. 2015; 9 - 22.
Prodanov D. Scale Space Analysis Filters for ImageJ. July 2019 - 23.
Ferreira T, Raspband W. ImageJ User Guide. NIH; 2012 - 24.
Pascau J, Mateos JM. Image Processing with ImageJ. PACKT PUB; 2013 - 25.
Ahuja N. A transform for multiscale image segmentation by integrated edge and region detection. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1996; 18 (12):1211-1235 - 26.
Tabb M, Ahuja N. Multiscale image segmentation by integrated edge and region detection. IEEE Transactions on Image Processing. 1997; 6 (5):642-655 - 27.
Burger W, Burge M. Principles of Digital Image Processing. Springer London Ltd; 2009 - 28.
Prodanov D, Konopczynski T, Trojnar M. Selected applications of scale spaces in microscopic image analysis. Cybernetics and Information Technologies. 2015; 15 (7):5-12
Notes
- The installation procedure of the spatial-domain filters is straightforward, and this is the reason why only spatial-domain filters are included in the public repository.
- https://github.com/dprodanov/scalespace.