IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Add a marker in a label imageSee full documentation
imageaddMarkerImg (inLabelImg,inBinImg,labelValue)

Detailed Description

Assign a new label value to the pixels determined by the input binary image.

This algorithm allows to add a new connected component to the input label image. This new connected component is described by the pixels set to true in the input binary image. The value of the label is provided by the user with the third parameter.

The figure below illustrates an example with the input label (top left) and binary images (bottom left) and the output label image (right) :

addMarkerImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho

Code Example

# add marker 2d image computation
outImg = morpho.addMarkerImg(imLabel, imBinary, labelValue)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLBasicMorphology/Processor/AddMarkerImg/AddMarkerImg.h>

Code Example

// Sample with a generated output image
// ------------------------------------
// compute addition of input images
ImagePtr pAutoOutImg = addMarkerImg(pLabelImg, pBinaryImg, newLabelValue);
// Sample with a provided output image
// -----------------------------------
// create output image
ImageGeometryPtr pOutputImageGeometry = geometry2d(eImageBufferType::eIBT_Label16, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
// compute addition of input images
addMarkerImg(pLabelImg, pBinaryImg, newLabelValue, pOutImg);