IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imagekurtosis2dImg (inImg,inHalfKnlSizeX,inHalfKnlSizeY)

Detailed Description

local 2d image kurtosis computation

This algorithm computes for each pixel of output image associated local kurtosis 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])^4}}-3(\sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{(InImg[x, y]-\bar{M}[x, y])^2}})^2} {[\sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{(InImg[x, y]-\bar{M}[x, y])^2}}]^2} \]

where

\[ \bar{M}[x, y] = \sum_{o_{y}=-N_y}^{N_y}{\sum_{o_{x}=N_x}^{N_x}{InImg[x, y]}} \]

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

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

kurtosis2dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLStats as stats

Code Example

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

Example of C++ code :

Example informations

Header file

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

Code Example

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