Mij: Raw Image Moments.

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

View source: R/imomenter.R

Description

Calculate the raw Hu image moment Mij.

Usage

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

Arguments

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.

Details

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.

Value

A single numeric giving the desired moment is returned.

Author(s)

Eric Gilleland

References

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

See Also

imomenter

Examples

1
2
3
data( "geom000" )

Mij( geom000 ) # area

Example output

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, typebeginnerNote: 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:spamThe following objects are masked frompackage: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:SparseMThe following object is masked frompackage:spam:

    backsolve

The following object is masked frompackage:base:

    backsolve


Attaching package:turboEMThe following objects are masked frompackage:numDeriv:

    grad, hessian

[1] 452600

SpatialVx documentation built on March 28, 2021, 1:10 a.m.