SMIL 1.1.2
Loading...
Searching...
No Matches
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.
 
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()

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.

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()