IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Grey Inertia Measure 3d
Inertia3dDatagreyInertiaMsr3d (inImg)
Inertia3dDatagreyInertiaMsr3d (inImg,inMaskImg)

Detailed Description

Computes the global inertia based on the grey levels of the input 3D image.

This algorithm computes the second order central moment for the entire 3D image, ponderated by the pixels intensities, thanks to the inertia matrix $ M $.

\[ M = \begin{bmatrix} m_{xx} & m_{xy} & m_{xz} \\ m_{yx} & m_{yy} & m_{yz} \\ m_{zx} & m_{zy} & m_{zz} \end{bmatrix} \]

Whose components are computed as follows :

\[ \begin{array}{r c l} m_{xx} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(x - \bar{x} \right)^2 I(x, y, z)} \\ m_{xy} = m_{yx} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(x - \bar{x} \right) \left(y - \bar{y} \right) I(x, y, z)} \\ m_{xz} = m_{zx} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(x - \bar{x} \right) \left(z - \bar{z} \right) I(x, y, z)} \\ m_{yy} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(y - \bar{y} \right)^2 I(x, y, z)}\\ m_{yz} = m_{zy} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(y - \bar{y} \right) \left(z - \bar{z} \right) I(x, y, z)}\\ m_{zz} & = & \sum_{\lbrace x, y, z \rbrace \in \Omega}{ \left(z - \bar{z} \right)^2 I(x, y, z)} \end{array} \]

Where $ I(x, y, z) $ is the image intensity at the position $ (x, y, z) $, $ \bar{x} $, $ \bar{y} $ and $ \bar{z} $ are the grey barycenter coordinates and $ \Omega $ is the set of pixel coordinates in the image.

From these composents, the following descriptors are extracted :

Here is an example of result for a 3D grey level image:

GreyInertiaMsr3d.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# Pixel localization computation
outInertia3d = glbmsr.greyInertiaMsr3d(inImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLGlobalMeasure/Processor/GreyInertiaMsr3d/GreyInertiaMsr3d.h>

Code Example

// compute the pixel locations
Inertia3dDataPtr pInertia = greyInertiaMsr3d(pInImg);