Visible to Intel only — GUID: GUID-F850F39E-4C64-4CE7-8C17-B5611CC2E921
Visible to Intel only — GUID: GUID-F850F39E-4C64-4CE7-8C17-B5611CC2E921
Image Moments
Spatial and central moments are important statistical properties of an image. The spatial moment MU (m,n) of order (m,n) is defined as follows:
where the summation is performed for all rows and columns in the image; Pj,k are pixel values; xk and yj are pixel coordinates; m and n are integer power exponents that define the moment order.
The central moment UU ( m,n) is the spatial moment computed relative to the “center of gravity” (x0, y0):
where x0 = MU (1,0)/ MU(0,0) and y0 = MU(0,1)/ MU(0,0).
The normalized spatial moment M(m,n) and central moment U(m, n) are defined as follows:
The Intel IPP functions support moments of order (m, n) with 0 ≤ m + n ≤ 3. The computation of seven invariant Hu moments derived from the second and third order moments is also supported. All computed moments are stored in context structures of type IppiMomentState_64s (for integer versions)or IppiMomentState_64f (for floating point versions).
Most Intel IPP functions for computing image moments have code branches that implement different algorithms to compute the results. You can choose the desired code variety to be used by the given function by setting the hint argument to one of the following values that are listed in Table “Hint Arguments for Image Moment Functions”:
Value | Description |
---|---|
ippAlgHintNone | The computation algorithm will be chosen by the internal function logic. |
ippAlgHintFast | Fast algorithm must be used. The output results will be less accurate. |
ippAlgHintAccurate | High accuracy algorithm must be used. The function will need more time to execute. |
- MomentGetStateSize
Computes the size of the external buffer for the moment context structure. - MomentInit
Initializes the moment context structure. - Moments
Computes all image moments of order 0 to 3 and Hu moment invariants. - GetSpatialMoment
Retrieves image spatial moment of the specified order, computed by ippiMoments. - GetCentralMoment
Retrieves image central moment computed by ippiMoments. - GetNormalizedSpatialMoment
Retrieves the normalized value of the image spatial moment computed by ippiMoments. - GetNormalizedCentralMoment
Retrieves the normalized value of the image central moment computed by ippiMoments. - GetHuMoments
Retrieves image Hu moment invariants computed by ippiMoments function.