IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

local 2d image skewness computation More...

IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::skewness2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY)
 wrapper function for Computation of the local skewness on a rectangular neighbourhood on a 2d image More...
 
IPSDKIPLSTATS_API void ipsdk::imaproc::stats::skewness2dImg (const image::ImageConstPtr &pInImg, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY, const image::ImagePtr &pOutImg)
 wrapper function for Computation of the local skewness on a rectangular neighbourhood on a 2d image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InHalfKnlSizeX [Input] half kernel size along X axis for operation X
ipsdk::imaproc::attr::InHalfKnlSizeY [Input] half kernel size along Y axis for operation X
ipsdk::imaproc::attr::OutRealImg [Output] image for processing operation (data contained in image buffer are reals) ipsdk::imaproc::duplicateInOut (_pOutRealImg, _pInImg, image::eImageBufferType::eIBT_Real32)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutRealImg)

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

Associated library

IPSDKIPLStats

Header file

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);
See also
Skewness2dImgLvl1
Skewness2dImgLvl2
Skewness2dImgLvl3

Function Documentation

◆ skewness2dImg() [1/2]

IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::skewness2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY 
)

wrapper function for Computation of the local skewness on a rectangular neighbourhood on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ skewness2dImg() [2/2]

IPSDKIPLSTATS_API void ipsdk::imaproc::stats::skewness2dImg ( const image::ImageConstPtr pInImg,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY,
const image::ImagePtr pOutImg 
)

wrapper function for Computation of the local skewness on a rectangular neighbourhood on a 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure