IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Pixel Classification Random Forest Algorithm

Compute Random Forest pixel classification. More...

IPSDKIPLMACHINELEARNING_API image::ImagePtr ipsdk::imaproc::ml::pixelClassificationRFImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const image::ImagePtr &pOutBinLabImg)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API image::ImagePtr ipsdk::imaproc::ml::pixelClassificationRFImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const ipReal32 inOptMemoryRatio)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const ipReal32 inOptMemoryRatio, const image::ImagePtr &pOutBinLabImg)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API PixelClassificationRFResult ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const image::ImagePtr &pOutBinLabImg, const image::ImagePtr &pOutRealImg)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API PixelClassificationRFResult ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const ipReal32 inOptMemoryRatio)
 wrapper function for Compute Random Forest pixel classification More...
 
IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::RandomForestModelConstPtr &pModel, const ipReal32 inOptMemoryRatio, const image::ImagePtr &pOutBinLabImg, const image::ImagePtr &pOutRealImg)
 wrapper function for Compute Random Forest pixel classification More...
 

Detailed Description

Compute Random Forest pixel classification.

This algorithm allows to classify pixels on an image, by using the random forest algorithm on a trained model

It the model contains two, the output image will be binary, otherwise it will be labeled. The function will first compute all the features, then apply the random forest algorithm. If the features are already compute, they can be given in a sequence image, instead of the input image.

See Smart segmentation module for more details about the model creation.

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InRandomForestModel [Input] Complete model of the random forest X
ipsdk::imaproc::attr::InOptMemoryRatio [Input Optional] memory ratio for random forest X
ipsdk::imaproc::attr::InOptProbabilities [Input Optional] bool value for probabilities in pixel classfication algorithm X
ipsdk::imaproc::attr::OutOptWk1Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk2Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk3Img [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutBinLabImg [Output] binary or label image for processing operation customOutput (_pOutBinLabImg, outputBinaryLabel(_pInImg,_pInRandomForestModel))
ipsdk::imaproc::attr::OutOptRealImg [Output Optional] image for processing operation (data contained in image buffer are reals) X

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_3d,_pInImg,_pOutBinLabImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLMachineLearning as ml

Code Example

#Opening image and model
inImg = PyIPSDK.loadTiffImageFile(utImagePath)
model, boolResult = PyIPSDK.readFromXmlFile(utModelPath)
outImg = ml.pixelClassificationRFImg(inImg, model)

Example of C++ code :

Example informations

Associated library

IPSDKIPLMachineLearning

Header file

Code Example

ImagePtr pInImg = loadTiffImageFile(inputImgPath);
FileReadResult res = readFromXmlFile(inputModelPath);
RandomForestModelPtr pModel = boost::static_pointer_cast<RandomForestModel>(res._pObject);
ImagePtr pOutBinLabImg = pixelClassificationRFImg(pInImg, pModel);
See also
PixelClassificationRFImgLvl1

Function Documentation

◆ pixelClassificationRFImg() [1/4]

IPSDKIPLMACHINELEARNING_API image::ImagePtr ipsdk::imaproc::ml::pixelClassificationRFImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFImg() [2/4]

IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const image::ImagePtr pOutBinLabImg 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFImg() [3/4]

IPSDKIPLMACHINELEARNING_API image::ImagePtr ipsdk::imaproc::ml::pixelClassificationRFImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const ipReal32  inOptMemoryRatio 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFImg() [4/4]

IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const ipReal32  inOptMemoryRatio,
const image::ImagePtr pOutBinLabImg 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFWithProbabilitiesImg() [1/4]

IPSDKIPLMACHINELEARNING_API PixelClassificationRFResult ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFWithProbabilitiesImg() [2/4]

IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const image::ImagePtr pOutBinLabImg,
const image::ImagePtr pOutRealImg 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFWithProbabilitiesImg() [3/4]

IPSDKIPLMACHINELEARNING_API PixelClassificationRFResult ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const ipReal32  inOptMemoryRatio 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pixelClassificationRFWithProbabilitiesImg() [4/4]

IPSDKIPLMACHINELEARNING_API void ipsdk::imaproc::ml::pixelClassificationRFWithProbabilitiesImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::RandomForestModelConstPtr pModel,
const ipReal32  inOptMemoryRatio,
const image::ImagePtr pOutBinLabImg,
const image::ImagePtr pOutRealImg 
)

wrapper function for Compute Random Forest pixel classification

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure