IPSDK 4.1
IPSDK : Image Processing Software Development Kit
Extract Classes
imageextractClassImg (inLabelImg,strInClassList)

Detailed Description

Creates a binary images from a label image a string describing the list of classes to extract.

This algorithm binarizes the input label image in order to keep only the pixels whose classes (i.e. label value) are specified in the input string.

The string must be se sequence of integer values, separated by a ','. For example, "2, 6, 19" will return a binary image with all pixels set to 0, except those that have a value of 2, 6 or 19 in the input label image.

The image below illustrates the result for the selection "1, 4, 5":

extractClassImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLMachineLearning as ml

Code Example

outImg = ml.extractClassImg(inLabelImg, "1, 4, 5")

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLMachineLearning/Processor/ExtractClassImg/ExtractClassImg.h>

Code Example

std::string strClassList = "1, 4, 5";
ImagePtr pOutImg = extractClassImg(pInLabImg, strClassList);