machinevisiontoolbox.Image.npq

Image.npq(p, q)

Normalized central image moments

Parameters:
  • p (int) – u exponent

  • q (int) – v exponent

Returns:

moment

Type:

scalar

Computes the pq’th normalized central moment of the image:

ν(I)=μpq(I)m00(I)=1m00(I)uvIuv(uu0)p(vv0)q

where u0=m10(I)/m00(I) and v0=m01(I)/m00(I).

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('shark1.png')
>>> img.npq(2, 2)
1.1596991128539824e-07
Note:
  • The normalized central moments are invariant to translation and scale.

  • Supports single channel images only.

References:
  • Robotics, Vision & Control for Python, Section 12.1.3.4, P. Corke, Springer 2023.

Seealso:

sum mpq upq