IPSDK 4.1
IPSDK : Image Processing Software Development Kit
Skewness 2d
imageskewness2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY)

Detailed Description

local 2d image skewness computation

This algorithm computes for each pixel of output image associated local skewness on a rectangular neighbourhood of input image.

Given an input image $InImg$ and rectangular kernel half sizes $N_x = InHalfKnlSizeX$ and $N_y = InHalfKnlSizeY$, output image values are given by :

\[ OutImg[x, y] = \dfrac{\sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{(InImg[x, y]-\bar{M}[x, y])^3}}}{[\sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{(InImg[x, y]-\bar{M}[x, y])^2}}]^{\frac{3}{2}}} \]

where

\[ \bar{M}[x, y] = \dfrac{1}{(2 N_y + 1)(2 N_x + 1)}\sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{InImg[x, y]}} \]

See also
http://en.wikipedia.org/wiki/Skewness

Here is an example of a Skewness computation applied on a 8 bits grey level image with $InHalfKnlSizeX = InHalfKnlSizeY = 2$:

skewness2dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLStats as stats

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# skewness 2d image computation
outImg = stats.skewness2dImg(inImg, 3, 3)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLStats/Processor/Skewness2dImg/Skewness2dImg.h>

Code Example

// opening input image
ImageGeometryPtr pInImageGeometry = geometry2d(imageBufferType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inputImgPath, *pInImageGeometry);
// compute skewness on input image
ImagePtr pOutImg = skewness2dImg(pInImg, inHalfKnlSizeX, inHalfKnlSizeY);