Description Usage Arguments Details Value Author(s) References See Also Examples

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 |

```
Loading required package: spatstat
Loading required package: spatstat.data
Loading required package: nlme
Loading required package: rpart
spatstat 1.64-1 (nickname: ‘Help you I can, yes!’)
For an introduction to spatstat, type ‘beginner’
Note: spatstat version 1.64-1 is out of date by more than 9 months; we recommend upgrading to the latest version.
Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.5-1 (2019-12-12) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.
Attaching package: ‘spam’
The following objects are masked from ‘package:base’:
backsolve, forwardsolve
See https://github.com/NCAR/Fields for
an extensive vignette, other supplements and source code
Loading required package: smoothie
Loading required package: smatr
Loading required package: turboEM
Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
Loading required package: numDeriv
Loading required package: quantreg
Loading required package: SparseM
Attaching package: ‘SparseM’
The following object is masked from ‘package:spam’:
backsolve
The following object is masked from ‘package:base’:
backsolve
Attaching package: ‘turboEM’
The following objects are masked from ‘package:numDeriv’:
grad, hessian
[1] 452600
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.