bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / measure / _moments / moments_central
function
skimage.measure._moments:moments_central
source: /dev/scikit-image/src/skimage/measure/_moments.py :201
Signature
def moments_central ( image , center = None , order = 3 , * , spacing = None , ** kwargs ) Summary
Calculate all central image moments up to a certain order.
Extended Summary
The center coordinates (cr, cc) can be calculated from the raw moments as: {M[1, 0] / M[0, 0], M[0, 1] / M[0, 0]}.
Note that central moments are translation invariant but not scale and rotation invariant.
Parameters
image: (N[, ...]) double or uint8 arrayRasterized shape as image.
center: tuple of float, optionalCoordinates of the image centroid. This will be computed if it is not provided.
order: int, optionalThe maximum order of moments computed.
spacing: tuple of float, shape (ndim,)The pixel spacing along each axis of the image.
Returns
mu: (``order + 1``, ``order + 1``) arrayCentral image moments.
Examples
image = np.zeros((20, 20), dtype=np.float64) image[13:17, 13:17] = 1✓
M = moments(image) centroid = (M[1, 0] / M[0, 0], M[0, 1] / M[0, 0]) moments_central(image, centroid)⚠
Aliases
-
skimage.measure.moments_central