Moments , see Moments of a Distribution , are weighted mean values determined in image processing from the brightness values of the individual pixels of an image. They are usually chosen to reflect desired properties of the image or to have certain geometrical interpretations. Moments are useful for describing individual objects in a segmented image. Fundamental properties of images that can be calculated using moments are area (or sum of the brightness values), center of gravity and orientation.
Not centered moments
For a two-dimensional continuous function , the moment -th degree is defined as
For
Applied to digital gray value images with the gray value function , the non-centered moments result
In some cases, the non-centered moments can be calculated by taking the gray value function as a probability density function. To do this, divide the above formula through
According to the uniqueness theorem of Athanasios Papoulis (1991), moments of any degree exist if is piecewise continuous and only becomes non-zero in a finite part of the xy-plane . In this case the sequence of moments is uniquely determined by. Likewise, the function clearly determines. In practice, however, a few moments of low degree are usually sufficient to characterize an image with sufficient accuracy.
Examples
Simple image properties that can be determined by off-center moments include:
- Area (for binary images) or sum of the gray values (for gray value images):
- Main emphasis:
Central moments (translation-invariant moments)
Central moments are invariant with respect to translations , they are defined as
Applied to digital gray value images with the gray value function g (x, y), the central moments μ ij result from
The central moments up to grade 3 are:
It can be shown that:
Examples
Information about the orientation of the image can be obtained by first using the three central second degree moments to compute a covariance matrix .
The covariance matrix of the image is then
-
.
The eigenvectors of this matrix correspond to the major and minor semiaxes of the brightness values. Thus, the orientation of the image can be determined from the angle of the eigenvector with the greatest eigenvalue. It can be shown that this angle Θ can be calculated by the following formula.
The eigenvalues of the covariance matrix are
The eccentricity of the image is
Scaling invariant moments
Moments η i j with i + j ≥ 2 can be constructed, which are invariant with regard to scaling and translation, by dividing the corresponding central moment by the correspondingly scaled moment of degree 0.
Rotationally invariant moments
It is also possible to construct moments that are also invariant with respect to an image rotation . The Hu set of invariant moments is often used .
The first, I 1 , is roughly equivalent to the moment of inertia around the center of gravity of the image if the brightness values of the pixels are interpreted as physical density .
Application examples
Moments are good for two things. On the one hand, they serve to classify objects in binarized , i.e. black-and-white images, which are the result of preprocessing that decides which parts of an image belong to an object (black = 1) and which do not (white = 0). An image that contains gray values in addition to black and white because the preprocessing algorithm was not always sure whether a pixel belongs to the object or the background can also be used by normalizing the gray levels to the value range [0, 1] .
The example of text recognition shows that a "T" and an "I" are left – right symmetrical and therefore do not differ in the focus , but differ at the moment due to the different variance and also differ greatly at the moment . For this moment, due to the top-bottom symmetry, a value close to 0 should come out for "I", while a scanned T has significantly more pixels at the top than at the bottom and has a strongly negative value here (for y-values increasing downwards).
On the other hand, moments can be used to compare the arrangement of any extracted features from images or the like. For example, if you have extracted some corners using a corner finder , the moments can be used to determine in which part of the image within a sequence of images (= video) change takes place. If the translation-invariant central moments are used for this , the detection is stable against camera shaking.
Web links
swell
Individual evidence
-
↑ Zhihu Huang, Jinsong Leng: Analysis of Hu's moment invariants on image scaling and rotation . In: 2010 2nd International Conference on Computer Engineering and Technology . tape 7 , April 2010, p. V7–476 – V7–480 , doi : 10.1109 / iccet.2010.5485542 ( ieee.org [accessed November 25, 2017]).