An image or a contour (binary image) can be analysed by moments.
A moment M under an order (p, q) is defined as follows:
With the double integral running over the whole domain of x and y (whole image or ROI).
As digital images represent a discrete subspace, we can replace the double integral with a double summation:
The central moments (referring to the centroid coordinates) can be calculated based on the previous moments
Which have the property of being invariant with respect to translations (the centroid coordinates are based on M moments).
Invariance can be extended:
Clearly, the latter are the most widely used.
Hu moments are a concise way of describing complex images.