Visual Servoing Platform  version 3.7.1 under development (2026-08-06)
Additional image morphology functions

Functions

VISP_EXPORT void VISP_NAMESPACE_NAME::fillHoles (vpImage< unsigned char > &I)
 
VISP_EXPORT void VISP_NAMESPACE_NAME::reconstruct (const vpImage< unsigned char > &marker, const vpImage< unsigned char > &mask, vpImage< unsigned char > &h_kp1, const vpImageMorphology::vpConnexityType &connexity=vpImageMorphology::CONNEXITY_4)
 

Detailed Description

Additional image morphology functions.

Tutorials

If you are interested, you may have a look at

Function Documentation

◆ fillHoles()

void VISP_NAMESPACE_NAME::fillHoles ( vpImage< unsigned char > &  I)

Fill the holes in a binary image.

Parameters
I: Input binary image (0 means background, 255 means foreground).
Examples
testContours.cpp, and tutorial-count-coins.cpp.

Definition at line 45 of file vpMorph.cpp.

References VISP_NAMESPACE_NAME::floodFill(), vpImage< Type >::getHeight(), vpImage< Type >::getSize(), vpImage< Type >::getWidth(), vpImageTools::imageAdd(), vpImageTools::imageSubtract(), and VISP_NAMESPACE_NAME::reconstruct().

◆ reconstruct()

void VISP_NAMESPACE_NAME::reconstruct ( const vpImage< unsigned char > &  marker,
const vpImage< unsigned char > &  mask,
vpImage< unsigned char > &  h_kp1,
const vpImageMorphology::vpConnexityType connexity = vpImageMorphology::CONNEXITY_4 
)

Perform morphological reconstruction of the image marker under the image mask. Definition from Gleb V. Tcheslavsk: > The morphological reconstruction by dilation of a grayscale image \( g \) by a grayscale marker image \( f \) > is defined as the geodesic dilation of \( f \) with respect to \( g \) repeated (iterated) until stability is reached:

\[ R_{g}^{D} \left ( f \right ) = D_{g}^{\left ( k \right )} \left ( f \right ) \]

with \( k \) such that: \( D_{g}^{\left ( k \right )} \left ( f \right ) = D_{g}^{\left ( k+1 \right )} \left ( f \right ) \)

Parameters
marker: Grayscale image marker.
mask: Grayscale image mask.
h_kp1: Image morphologically reconstructed.
connexity: Type of connexity.

Definition at line 122 of file vpMorph.cpp.

References vpImage< Type >::getHeight(), vpImage< Type >::getSize(), and vpImage< Type >::getWidth().

Referenced by VISP_NAMESPACE_NAME::fillHoles().