Developer Reference

  • 2020
  • 10/21/2020
  • Public Content
Contents

Image Moments

Spatial and central moments are important statistical properties of an image. The spatial moment
M
U
(
m
,
n
) of order (
m,n
) is defined as follows:
where the summation is performed for all rows and columns in the image;
P
j,k
are pixel values;
x
k
and
y
j
are pixel coordinates;
m
and
n
are integer power exponents that define the moment order.
The central moment
U
U
(
m
,
n
) is the spatial moment computed relative to the “center of gravity” (
x
0
,
y
0
):
where
x
0
=
M
U
(1,0)/
M
U
(0,0) and
y
0
=
M
U
(0,1)/
M
U
(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”
:
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.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804