Calculation of the minimum spanning tree, simultaneously to the image flooding, with edges weighted according to volume extinction values.
from smilPython import *
imIn = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
imGrad = Image(imIn)
imMark = Image(imIn, "UINT16")
imBasins = Image(imMark)
nRegions = 25
extType = "v"
imGraphOut = Image(imMark)
g.removeLowEdges(nRegions)
graphToMosaic(imBasins, g, imGraphOut)
label(imGraphOut, imGraphOut)
imGraphOut.showLabel()
imImgOut = Image(imMark)
watershedExtinction(imGrad, imMark, imImgOut, imBasins, extType)
compare(imImgOut,
">", nRegions, 0, imMark, imMark);
basins(imGrad, imMark, imImgOut)
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