IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Y projection 2d : Statistic measurement along the x axisSee full documentation
DoublesyProjection2d (inSubImg,eInProjStatType)

Detailed Description

measure of common statistics indicators in the image (mean, max, etc.) computed along the X axis

The computed statistics for each line can be : minimum, maximum, sum, mean, variance, standard deviation or median (see ipsdk::imaproc::attr::eProjStatType).

The output is a vector whose size equals to the number of lines of the input image.

Here is an example of a 8-bits grey level image and all the Y projections operations which can be applied :

mandrill_yProjection2dRes.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# y projection measurement
yProjection2dResult = glbmsr.yProjection2d(inImg, PyIPSDK.eProjStatType.ePST_Mean)
# retrieve measurement results
meanValues = yProjection2dResult.coll
print("Mean value for projected image along X axis for y=50 is " + str(meanValues[50]))

Example of C++ code :

Example informations

Header file

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

Code Example

// compute Y minimum projection for input image
// --------------------------------------------
DoublesPtr outProjStatMin = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Min);
// compute Y maximum projection for input image
// --------------------------------------------
DoublesPtr outProjStatMax = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Max);
// compute Y sum projection for input image
// --------------------------------------------
DoublesPtr outProjStatSum = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Sum);
// compute Y mean projection for input image
// --------------------------------------------
DoublesPtr outProjStatMean = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Mean);
// compute Y variance projection for input image
// --------------------------------------------
DoublesPtr outProjStatVar = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Variance);
// compute Y standard deviation projection for input image
// --------------------------------------------
DoublesPtr outProjStatStdDev = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_StdDev);
// compute Y median projection for input image
// --------------------------------------------
DoublesPtr outProjStatMedian = glbmsr::yProjection2d(pInImg, ipsdk::imaproc::attr::eProjStatType::ePST_Median);