Image moments
From Wikipedia, the free encyclopedia
Used in image processing, computer vision and related fields, image moments are certain particular weighted averages (moments) of the image pixels' intensities, or functions of those moments, usually chosen to have some attractive property or interpretation.
They 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.
Contents |
[edit] Raw moments
For a 2-D continuous function f(x,y) the moment (sometimes called "raw moment") of order (p + q) is defined as
for p,q = 0,1,2,... Adapting this to scalar (greytone) 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, e.g., 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.
[edit] Examples
Simple image properties derived via raw moments include:
- Area (for binary images) or sum of grey level (for greytone images):
- Centroid:
[edit] Central moments
Central moments are defined as:
where and are the components of the centroid.
If f(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.
[edit] Examples
Information about image orientation can be derived by first using the second order central moments to construct a covariance matrix.
The covariance matrix of the image I(x,y) 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 eigenvalues of the covariance matrix can easily be shown to be
which are proportional to the squared length of the eigenvector axes. Thus the relative difference in magnitude of the eigenvalues are an indication of how elongated the image is.
[edit] Scale invariant moments
Moments where can also be invariant to both translation and changes in scale by dividing central moments by the properly scaled (00)th moment, using the following formula.
[edit] Rotation invariant moments
It is possible to calculate moments which are invariant under translation, changes in scale, and also rotation. Most frequently used are the Hu set of invariant moments:
- I1 = η20 + η02
- I2 = (η20 − η02)2 + (2η11)2
- I3 = (η30 − 3η12)2 + (3η21 − η03)2
- I4 = (η30 + η12)2 + (η21 + η03)2
- I5 = (η30 − 3η12)(η30 + η12)[(η30 + η12)2 − 3(η21 + η03)2] + (3η21 − η03)(η21 + η03)[3(η30 + η12)2 − (η21 + η03)2]
- I6 = (η20 − η02)[(η30 + η12)2 − (η21 + η03)2 + 4η11(η30 + η12)(η21 + η03)]
- I7 = (3η21 − η03)(η30 + η12)[(η30 + η12)2 − 3(η21 + η03)2] − (η30 − 3η12)(η21 + η03)[3(η30 + η12)2 − (η21 + η03)2].
The first one, I1, is roughly proportional to the moment of inertia around the image's centroid, if the pixels' intensities were interpreted as physical density. The last one, I7, is skew invariant, which enables it to distinguish mirror images of otherwise identical images.
[edit] External links
- Analysis of Binary Images, University of Edinburgh
- Statistical Moments, University of Edinburgh
[edit] References
- M. K. Hu, "Visual Pattern Recognition by Moment Invariants", IRE Trans. Info. Theory, vol. IT-8, pp.179-187, 1962.