SMIL  1.0.4
Watershed Extinction

Detailed Description

+ Collaboration diagram for Watershed Extinction:

Classes

class  ExtinctionFlooding< T, labelT, extValType, HQ_Type >
 Generic extinction flooding process. More...
 

Functions

template<class T , class labelT , class outT >
RES_T watershedExtinctionGraph (const Image< T > &imIn, const Image< labelT > &imMarkers, Image< labelT > &imBasinsOut, Graph< labelT, outT > &graph, const char *extinctionType="v", const StrElt &se=DEFAULT_SE)
 Calculation of the minimum spanning tree, simultaneously to the image flooding, with edges weighted according to volume extinction values. More...
 
template<class T , class labelT >
Graph< labelT, labelT > watershedExtinctionGraph (const Image< T > &imIn, const Image< labelT > &imMarkers, Image< labelT > &imBasinsOut, const char *extinctionType="v", const StrElt &se=DEFAULT_SE)
 Warning: returns a graph with ranking values.
 

Function Documentation

◆ watershedExtinctionGraph()

RES_T smil::watershedExtinctionGraph ( const Image< T > &  imIn,
const Image< labelT > &  imMarkers,
Image< labelT > &  imBasinsOut,
Graph< labelT, outT > &  graph,
const char *  extinctionType = "v",
const StrElt se = DEFAULT_SE 
)

Calculation of the minimum spanning tree, simultaneously to the image flooding, with edges weighted according to volume extinction values.

Example

from smilPython import *
imIn = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
imGrad = Image(imIn)
imMark = Image(imIn, "UINT16")
imBasins = Image(imMark)
gradient(imIn, imGrad)
hMinimaLabeled(imGrad, 5, imMark)
nRegions = 25
extType = "v"
# Graph version
imGraphOut = Image(imMark)
g = watershedExtinctionGraph(imGrad, imMark, imBasins, extType)
g.removeLowEdges(nRegions)
graphToMosaic(imBasins, g, imGraphOut)
# Re-labelize (usefull only to have the same label values in both versions)
label(imGraphOut, imGraphOut)
imGraphOut.showLabel()
# Image version
imImgOut = Image(imMark)
watershedExtinction(imGrad, imMark, imImgOut, imBasins, extType)
compare(imImgOut, ">", nRegions, 0, imMark, imMark);
basins(imGrad, imMark, imImgOut)
# Re-labelize (usefull only to have the same label values in both versions)
label(imImgOut, imImgOut)
imImgOut.showLabel()
RES_T compare(const Image< T1 > &imIn1, const char *compareType, const Image< T1 > &imIn2, const Image< T2 > &trueIm, const Image< T2 > &falseIm, Image< T2 > &imOut)
compare() - Compare each pixel of two images (or an image and a value)
Definition: DImageArith.hpp:1244
RES_T hMinimaLabeled(const Image< T1 > &imIn, const T1 &height, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
hMinimaLabeled() - Calculate the h-minima and labelize them
Definition: DMorphoExtrema.hpp:182
size_t label(const Image< T1 > &imIn, Image< T2 > &imOut, const StrElt &se=DEFAULT_SE)
label() - Image labelization
Definition: DMorphoLabel.hpp:564
RES_T gradient(const Image< T > &imIn, Image< T > &imOut, const StrElt &se=DEFAULT_SE)
gradient() - Morphological gradient
Definition: DMorphoResidues.hpp:62
RES_T watershedExtinctionGraph(const Image< T > &imIn, const Image< labelT > &imMarkers, Image< labelT > &imBasinsOut, Graph< labelT, outT > &graph, const char *extinctionType="v", const StrElt &se=DEFAULT_SE)
Calculation of the minimum spanning tree, simultaneously to the image flooding, with edges weighted a...
Definition: DMorphoWatershedExtinction.hpp:602
RES_T basins(const Image< T > &imIn, const Image< labelT > &imMarkers, Image< labelT > &imBasinsOut, const StrElt &se=DEFAULT_SE)
Constrained basins.
Definition: DMorphoWatershed.hpp:364