Skip to main content

Moments

Using the 3D Blob Analysis module, you can calculate moment-based features, such as a blob's centroid (first-order moment), and its linearity or planarity (second-order moments). To enable the calculation of a specified order, use M3dblobControl with M_MOMENTS, and then set the order with M_MOMENT_ORDER (the default is 2). Note that Aurora Imaging Library calculates all moments up to and including those of the specified order. Retrieve results using M3dblobGetResult.

First-order moment calculations reflect the center of mass of a blob (its centroid), while second-order moment calculations reflect the distribution of points around an axis. Accordingly, second-order features include principal component analysis (PCA) results and related eigenvalues, as well as the standard deviation of points, the covariance matrix, and a blob's linearity and planarity.

[Image: 3dim_PrincipalAxes.png]

If you only require a specific type of moment-based feature result, you can use M3dblobControl to enable that calculation directly. For example, you can enable PCA feature calculations (M3dblobControl with M_PCA), and then retrieve only those results (using M3dblobGetResult with M_PRINCIPAL_AXIS_...). Otherwise, enabling M_MOMENTS with an order of at least 2 enables the calculation and eventual retrieval of all second-order moments, as well as first-order moments (the centroid).

You can also use M3dblobGetResult to retrieve moment-based feature results with respect to the origin of the working coordinate system (ordinary moments), or with respect to the blob's centroid (central moments); use the M_MOMENT_XYZ() and M_MOMENT_CENTRAL_XYZ() result types, respectively. When setting the moment order (M_MOMENT_ORDER) before calculating these results, note that the specified order must be a value that is greater than or equal to the sum of the powers in X, Y, and Z, according to the ordinary or central moment formula (see M3dblobGetResult). For example, to retrieve only third, second, and first-order moment results, PowerX + PowerY + PowerZ must not exceed 3.

Copyright © 2026 Zebra Technologies.