Image.mpq#
- Image.mpq(p: int, q: int) float[source]#
Image moments
- Parameters:
p (int) – u exponent
q (int) – v exponent
- Returns:
moment
- Type:
scalar
Computes the pq’th moment of the image:
\[m(I) = \sum_{uv} I_{uv} u^p v^q\]Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Read('shark1.png') >>> img.mpq(1, 0) np.int64(341888955)
Note
Supports single channel images only.
mpq(0, 0)is the same assum()but less efficient.
- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 12.1.3.4.
- Seealso: