skimage2.measure.moments_normalized#
- skimage2.measure.moments_normalized(mu, order=3, spacing=None)[source]#
Calculate all normalized central image moments up to a certain order.
Note that normalized central moments are translation and scale invariant but not rotation invariant.
- Parameters:
- mu(M[, …], M) array
Central image moments, where M must be greater than or equal to
order.- orderint, optional
Maximum order of moments. Default is 3.
- spacingtuple of float, shape (ndim,)
The pixel spacing along each axis of the image.
- Returns:
- nu(
order + 1``[, ...], ``order + 1) array Normalized central image moments.
- nu(
References
[1]Wilhelm Burger, Mark Burge. Principles of Digital Image Processing: Core Algorithms. Springer-Verlag, London, 2009.
[2]B. Jähne. Digital Image Processing. Springer-Verlag, Berlin-Heidelberg, 6. edition, 2005.
[3]T. H. Reiss. Recognizing Planar Objects Using Invariant Image Features, from Lecture notes in computer science, p. 676. Springer, Berlin, 1993.
Examples
>>> from _skimage2.measure import moments, moments_central >>> image = np.zeros((20, 20), dtype=np.float64) >>> image[13:17, 13:17] = 1 >>> m = moments(image) >>> centroid = (m[0, 1] / m[0, 0], m[1, 0] / m[0, 0]) >>> mu = moments_central(image, centroid) >>> moments_normalized(mu) array([[ nan, nan, 0.078125 , 0. ], [ nan, 0. , 0. , 0. ], [0.078125 , 0. , 0.00610352, 0. ], [0. , 0. , 0. , 0. ]])