1 from smilPython
import *
3 imIn = Image(
"https://smil.cmm.minesparis.psl.eu/images/lena.png")
5 imMark = Image(imIn,
"UINT16")
6 imBasins = Image(imMark)
16 imGraphOut = Image(imMark)
18 g.removeLowEdges(nRegions)
19 graphToMosaic(imBasins, g, imGraphOut)
21 label(imGraphOut, imGraphOut)
22 imGraphOut.showLabel()
27 imImgOut = Image(imMark)
28 watershedExtinction(imGrad, imMark, imImgOut, imBasins, extType)
29 compare(imImgOut,
">", nRegions, 0, imMark, imMark);
30 basins(imGrad, imMark, imImgOut)
32 label(imImgOut, imImgOut)
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