Image.upq#
- Image.upq(p: int, q: int) float[source]#
Central image moments
- Parameters:
p (int) – u exponent
q (int) – v exponent
- Returns:
moment
- Type:
scalar
Computes the pq’th central moment of the image:
\[\mu(I) = \sum_{uv} I_{uv} (u-u_0)^p (v-v_0)^q\]where \(u_0 = m_{10}(I) / m_{00}(I)\) and \(v_0 = m_{01}(I) / m_{00}(I)\).
Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Read('shark1.png') >>> img.upq(2, 2) np.float64(922044470450.7102)
Note
The central moments are invariant to translation.
Supports single channel images only.
- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 12.1.3.4.
- Seealso: