Image.mpq#
- Image.mpq(p: int, q: int) float[source]#
Image moments
Computes the pq’th moment of the image:
\[m(I) = \sum_{uv} I_{uv} u^p v^q\]Examples
>>> 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.