Image moments
Encyclopedia
In image processing
, computer vision
and related fields, an image moment is a certain particular weighted average (moment
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
, and information about its orientation.
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
In image processing
, computer vision
and related fields, an image moment is a certain particular weighted average (moment
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
, and information about its orientation.
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
In image processing
, computer vision
and related fields, an image moment is a certain particular weighted average (moment
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
, and information about its orientation.
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
where and are the components of the centroid
.
If ƒ(x, y) is a digital image, then the previous equation becomes
The central moments of order up to 3 are:
It can be shown that:
Central moments are translational invariant.
.
The covariance matrix
of the image is now
.
The eigenvectors of this matrix correspond to the major and minor axes of the image intensity, so the orientation can thus be extracted from the angle of the eigenvector associated with the largest eigenvalue. It can be shown that this angle Θ is given by the following formula:
The above formula holds as long as:
The eigenvalues of the covariance matrix can easily be shown to be
and are proportional to the squared length of the eigenvector axes. The relative difference in magnitude of the eigenvalues are thus an indication of the eccentricity of the image, or how elongated it is. The eccentricity
is
to both translation
and changes in scale
by dividing the corresponding central moment by the properly scaled (00)th moment, using the following formula.
under translation
, changes in scale
, and also rotation
. Most frequently used are the Hu set of invariant moments :
The first one, I1, is analogous to the moment of inertia
around the image's centroid, where the pixels' intensities are analogous to physical density. The last one, I7, is skew invariant, which enables it to distinguish mirror images of otherwise identical images.
A general theory on deriving complete and independent sets of rotation invariant moments was proposed by J. Flusser and T. Suk. They showed that the traditional Hu's invariant set is not independent nor complete. I2 and I3 are not very useful for pattern recognition, as they are dependent. On the original Hu's set there is a missing third order independent moment invariant:
Image processing
In electrical engineering and computer science, image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image...
, computer vision
Computer vision
Computer vision is a field that includes methods for acquiring, processing, analysing, and understanding images and, in general, high-dimensional data from the real world in order to produce numerical or symbolic information, e.g., in the forms of decisions...
and related fields, an image moment is a certain particular weighted average (moment
Moment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
Centroid
In geometry, the centroid, geometric center, or barycenter of a plane figure or two-dimensional shape X is the intersection of all straight lines that divide X into two parts of equal moment about the line. Informally, it is the "average" of all points of X...
, and information about its orientation.
Raw moments
For a 2-D continuous function f(x,y) the momentMoment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
Probability density function
In probability theory, a probability density function , or density of a continuous random variable is a function that describes the relative likelihood for this random variable to occur at a given point. The probability for the random variable to fall within a particular region is given by the...
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
Examples
Simple image properties derived via raw moments include:- Area (for binary images) or sum of grey level (for greytone images): M00
- Centroid:
In image processing
Image processing
In electrical engineering and computer science, image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image...
, computer vision
Computer vision
Computer vision is a field that includes methods for acquiring, processing, analysing, and understanding images and, in general, high-dimensional data from the real world in order to produce numerical or symbolic information, e.g., in the forms of decisions...
and related fields, an image moment is a certain particular weighted average (moment
Moment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
Centroid
In geometry, the centroid, geometric center, or barycenter of a plane figure or two-dimensional shape X is the intersection of all straight lines that divide X into two parts of equal moment about the line. Informally, it is the "average" of all points of X...
, and information about its orientation.
Raw moments
For a 2-D continuous function f(x,y) the momentMoment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
Probability density function
In probability theory, a probability density function , or density of a continuous random variable is a function that describes the relative likelihood for this random variable to occur at a given point. The probability for the random variable to fall within a particular region is given by the...
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
Examples
Simple image properties derived via raw moments include:- Area (for binary images) or sum of grey level (for greytone images): M00
- Centroid:
In image processing
Image processing
In electrical engineering and computer science, image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image...
, computer vision
Computer vision
Computer vision is a field that includes methods for acquiring, processing, analysing, and understanding images and, in general, high-dimensional data from the real world in order to produce numerical or symbolic information, e.g., in the forms of decisions...
and related fields, an image moment is a certain particular weighted average (moment
Moment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
) of the image pixels' intensities, or a function of such moments, usually chosen to have some attractive property or interpretation.
Image moments are useful to describe objects after segmentation. Simple properties of the image which are found via image moments include area (or total intensity), its centroid
Centroid
In geometry, the centroid, geometric center, or barycenter of a plane figure or two-dimensional shape X is the intersection of all straight lines that divide X into two parts of equal moment about the line. Informally, it is the "average" of all points of X...
, and information about its orientation.
Raw moments
For a 2-D continuous function f(x,y) the momentMoment (mathematics)
In mathematics, a moment is, loosely speaking, a quantitative measure of the shape of a set of points. The "second moment", for example, is widely used and measures the "width" of a set of points in one dimension or in higher dimensions measures the shape of a cloud of points as it could be fit by...
(sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,...
Adapting this to scalar (greyscale) image with pixel intensities I(x,y), raw image moments Mij are calculated by
In some cases, this may be calculated by considering the image as a probability density function
Probability density function
In probability theory, a probability density function , or density of a continuous random variable is a function that describes the relative likelihood for this random variable to occur at a given point. The probability for the random variable to fall within a particular region is given by the...
, i.e., by dividing the above by
A uniqueness theorem (Papoulis [1991]) states that if f(x,y)
is piecewise continuous and has nonzero values only in a finite part of the xy
plane, moments of all orders exist, and the moment sequence (Mpq) is uniquely determined by f(x,y). Conversely, (Mpq) uniquely determines f(x,y). In practice, the image is summarized with functions of a few lower order moments.
Examples
Simple image properties derived via raw moments include:- Area (for binary images) or sum of grey level (for greytone images): M00
- Centroid: , } = {M10/M00, M01/M00 }
Central moments
Central moments are defined aswhere and are the components of the centroid
Centroid
In geometry, the centroid, geometric center, or barycenter of a plane figure or two-dimensional shape X is the intersection of all straight lines that divide X into two parts of equal moment about the line. Informally, it is the "average" of all points of X...
.
If ƒ(x, y) is a digital image, then the previous equation becomes
The central moments of order up to 3 are:
It can be shown that:
Central moments are translational invariant.
Examples
Information about image orientation can be derived by first using the second order central moments to construct a covariance matrixCovariance matrix
In probability theory and statistics, a covariance matrix is a matrix whose element in the i, j position is the covariance between the i th and j th elements of a random vector...
.
The covariance matrix
Covariance matrix
In probability theory and statistics, a covariance matrix is a matrix whose element in the i, j position is the covariance between the i th and j th elements of a random vector...
of the image is now
.
The eigenvectors of this matrix correspond to the major and minor axes of the image intensity, so the orientation can thus be extracted from the angle of the eigenvector associated with the largest eigenvalue. It can be shown that this angle Θ is given by the following formula:
The above formula holds as long as:
The eigenvalues of the covariance matrix can easily be shown to be
and are proportional to the squared length of the eigenvector axes. The relative difference in magnitude of the eigenvalues are thus an indication of the eccentricity of the image, or how elongated it is. The eccentricity
Eccentricity (mathematics)
In mathematics, the eccentricity, denoted e or \varepsilon, is a parameter associated with every conic section. It can be thought of as a measure of how much the conic section deviates from being circular.In particular,...
is
Scale invariant moments
Moments ηi j where i + j ≥ 2 can be constructed to be invariantInvariant (mathematics)
In mathematics, an invariant is a property of a class of mathematical objects that remains unchanged when transformations of a certain type are applied to the objects. The particular class of objects and type of transformations are usually indicated by the context in which the term is used...
to both translation
Translation (geometry)
In Euclidean geometry, a translation moves every point a constant distance in a specified direction. A translation can be described as a rigid motion, other rigid motions include rotations and reflections. A translation can also be interpreted as the addition of a constant vector to every point, or...
and changes in scale
Scale (ratio)
The scale ratio of some sort of model which represents an original proportionally is the ratio of a linear dimension of the model to the same dimension of the original. Examples include a 3-dimensional scale model of a building or the scale drawings of the elevations or plans of a building. In such...
by dividing the corresponding central moment by the properly scaled (00)th moment, using the following formula.
Rotation invariant moments
It is possible to calculate moments which are invariantInvariant (mathematics)
In mathematics, an invariant is a property of a class of mathematical objects that remains unchanged when transformations of a certain type are applied to the objects. The particular class of objects and type of transformations are usually indicated by the context in which the term is used...
under translation
Translation (geometry)
In Euclidean geometry, a translation moves every point a constant distance in a specified direction. A translation can be described as a rigid motion, other rigid motions include rotations and reflections. A translation can also be interpreted as the addition of a constant vector to every point, or...
, changes in scale
Scale (ratio)
The scale ratio of some sort of model which represents an original proportionally is the ratio of a linear dimension of the model to the same dimension of the original. Examples include a 3-dimensional scale model of a building or the scale drawings of the elevations or plans of a building. In such...
, and also rotation
Rotation
A rotation is a circular movement of an object around a center of rotation. A three-dimensional object rotates always around an imaginary line called a rotation axis. If the axis is within the body, and passes through its center of mass the body is said to rotate upon itself, or spin. A rotation...
. Most frequently used are the Hu set of invariant moments :
The first one, I1, is analogous to the moment of inertia
Moment of inertia
In classical mechanics, moment of inertia, also called mass moment of inertia, rotational inertia, polar moment of inertia of mass, or the angular mass, is a measure of an object's resistance to changes to its rotation. It is the inertia of a rotating body with respect to its rotation...
around the image's centroid, where the pixels' intensities are analogous to physical density. The last one, I7, is skew invariant, which enables it to distinguish mirror images of otherwise identical images.
A general theory on deriving complete and independent sets of rotation invariant moments was proposed by J. Flusser and T. Suk. They showed that the traditional Hu's invariant set is not independent nor complete. I2 and I3 are not very useful for pattern recognition, as they are dependent. On the original Hu's set there is a missing third order independent moment invariant:
External links
- Moment invariants, Institute of Information Theory and Automation, Prague, CZ
- Analysis of Binary Images, University of Edinburgh
- Statistical Moments, University of Edinburgh
- Variant moments, Machine Perception and Computer Vision page (Matlab and Python source code).