IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Local Orientation 2d
imagelocalOrientation2dImg (inSingleImg,roiSize,roiOffset)

Detailed Description

Computes local inertia orientation on ROIs of the input image.

This algorithm computes the local inertia 2D orientation of the input image.

The image is first splitted into ROIs with the Split an image to a sequence of 2D ROIs algorithm. The ROI are described by the parameters InInputImg2dSize and InInputImg2dOffset.

A global orientation is calculated for each ROI using the Grey Inertia Measure 2d algorithm. To improve the orientation estimation, a circular mask is used to ignore the highest frequencies. The mask is calculated by the algorithm.

The global orientation is then assigned to each pixel of the corresponding ROI and the ROIs are finally merged with the Merge 2D ROIs from a sequence image algorithm.

The figure below illustrates the process:

localOrientation2dImg_process.png

If the ROIs overlap, the merge step (with Merge 2D ROIs from a sequence image) average the orientations estimated for all the ROIs including the overlap area.

The following figure displays an example of result calculated forthe mandrill image. On the left, we can observe the raw result with angles varying from 0 to $\pi$. On the right, the orientation is displayed with arrows overlayed with the inpu image for a better reading.

localOrientation2dImg_result.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLStats as stats

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# variance 2d image computation
outImg = stats.localOrientation2dImg(inImg, roiSize, roiStride)

Example of C++ code :

Example informations

Header file

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

Code Example

// opening input image
ImageGeometryPtr pInImageGeometry = geometry2d(imageBufferType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inputImgPath, *pInImageGeometry);
// compute variance on input image
ImagePtr pOutImg = localOrientation2dImg(pInImg, roiSize, roiStride);