IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Binary Reconstruction 2dSee full documentation
imagebinaryReconstruction2dImg (inBinImg,inBinMarkImg)

Detailed Description

Binary reconstruction of an image 2d.

This algorithm allows to reconstruct an input binary image InBinImg using a marker input image InBinMarkImg with respect to a given neighborhood 2d policy (see 2d neighborhood models).

The reconstruction of InBinImg from InBinMarkImg is the union of connected components of InBinImg which contain at least a pixel of InBinMarkImg.

It can also be seen as the dilation of InBinMarkImg into InBinImg until convergence.

Two versions of this algorithm are implemented which can be selected using attribute InOptOptimizationPolicy which associated to enumerate ipsdk::imaproc::attr::eProcessingOptimizationPolicy :

Here is an example of binary reconstruction of an image 2d :

binaryReconstruction2dImg.png

In this example input binary image data are represented in white while input binary marker image data are represented in red.

Note
See "Morphological Grayscale Reconstruction in Image Analysis: Applications and Efficient Algorithms, Luc Vicent, IEEE Transactions on Image Processing, 1993, Volume 2, 176-201" for more informations on this algorithm.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inMarkImg = PyIPSDK.loadTiffImageFile(inputMarkImgPath)
# binary reconstruction 2d computation
outImg = advmorpho.binaryReconstruction2dImg(inImg, inMarkImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/BinaryReconstruction2dImg/BinaryReconstruction2dImg.h>

Code Example

// opening input image
ImagePtr pInBinImg = loadTiffImageFile(inputImgPath);
// opening input image
ImagePtr pInBinMarkImg = loadTiffImageFile(inputMarkImgPath);
// compute binary reconstruction of input image using input mark image
ImagePtr pOutImg = binaryReconstruction2dImg(pInBinImg, pInBinMarkImg);