IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

holes filling in a binary 2d image More...

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::fillHole2dImg (const image::ImageConstPtr &pInBinImg)
 wrapper function for holes filling in a binary 2d image More...
 
IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::fillHole2dImg (const image::ImageConstPtr &pInBinImg, const eNeighborhood2dType &inOptNeighborhood2d, const ipsdk::imaproc::attr::eProcessingOptimizationPolicy &inOptOptimizationPolicy, const image::ImagePtr &pOutImg)
 wrapper function for holes filling in a binary 2d image More...
 

Detailed Description

holes filling in a binary 2d image

This algorithm allows to fill holes inside connected components in an input binary image InBinImg with respect to a given neighborhood 2d policy (see 2d neighborhood models).

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 hole filling algorithm on an image 2d :

fillHole2dImg.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InBinImg [Input] binary image for processing operation X
ipsdk::imaproc::attr::InOptNeighborhood2d [Input optional] neighborhood 2d type for operation X
ipsdk::imaproc::attr::InOptOptimizationPolicy [Input Optional] processing optimization policy for algorithm X
ipsdk::imaproc::attr::OutOptWk1BinImg [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutOptWk1LabelImg [Output Optional] Temporary working image for algorithm X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInBinImg)

Global Rule description

Global rule description for algorithm :
((ipsdk::imaproc::matchSizeAndType (_pInBinImg,_pOutImg)) && 
 (ipsdk::processor::ifIsSet (
   _pOutOptWk1BinImg, (
    ipsdk::imaproc::matchSize (_pInBinImg,_pOutOptWk1BinImg)))) && 
 (ipsdk::processor::ifIsSet (
   _pOutOptWk1LabelImg, (
    ipsdk::imaproc::matchSize (_pInBinImg,_pOutOptWk1LabelImg)))))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input image
inBinImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# compute hole filling on input image
outImg = advmorpho.fillHole2dImg(inBinImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLAdvancedMorphology

Header file

Code Example

// opening input image
ImagePtr pInBinImg = loadTiffImageFile(inputImgPath);
// compute hole filling on input image
ImagePtr pOutImg = fillHole2dImg(pInBinImg);
See also
FillHole2dImgLvl1

Function Documentation

◆ fillHole2dImg() [1/2]

IPSDKIPLADVANCEDMORPHOLOGY_API image::ImagePtr ipsdk::imaproc::advmorpho::fillHole2dImg ( const image::ImageConstPtr pInBinImg)

wrapper function for holes filling in a binary 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ fillHole2dImg() [2/2]

IPSDKIPLADVANCEDMORPHOLOGY_API void ipsdk::imaproc::advmorpho::fillHole2dImg ( const image::ImageConstPtr pInBinImg,
const eNeighborhood2dType inOptNeighborhood2d,
const ipsdk::imaproc::attr::eProcessingOptimizationPolicy inOptOptimizationPolicy,
const image::ImagePtr pOutImg 
)

wrapper function for holes filling in a binary 2d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure