Calculate the raw Hu image moment Mij.

1 | ```
Mij(x, s, i = 0, j = 0)
``` |

`x` |
A matrix. |

`s` |
A two-column matrix giving the location coordinates. May be missing in which case they are assumed to be integers giving the row and column numbers. |

`i,j` |
Integer giving the moment order for each coordinate x and y, resp. |

The raw moment M_ij (Hu 1962) is calculated by

M_ij = sum(x^i * y^j * Im[i, j])

where x and y are the pixel coordinates and Im is the (image) matrix. Various useful properties of an image may be gleaned from certain moments. For example, the image area is given by M_00, and the image centroid is (M_10 / M_00, M_01 / M_00). The image orientation angle can also be derived.

A single numeric giving the desired moment is returned.

Eric Gilleland

Hu, M. K. (1962) Visual Pattern Recognition by Moment Invariants. *IRE Trans. Info. Theory*, **IT-8**, 179–187.

1 2 3 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.