# import smilPython
import smilPython as sp
# functions using matplotlib to display images on jupyter notebooks
from smilPlot import *
import numpy as np
# Get an image
imIn = sp.Image("http://smil.cmm.mines-paristech.fr/images/mosaic.png")
print(imIn)
2D image Data type: UINT8 Size: 176x144 Allocated (24.75KB)
# Allocate images with the same size but with UINT16 pixel data types
imMos = sp.Image(imIn, "UINT16")
imArea = sp.Image(imMos)
imSeg = sp.Image(imMos)
# Label imIn
sp.label(imIn, imMos)
sp.labelWithArea(imIn, imArea)
g = sp.mosaicToGraph(imMos, imArea)
sp.drawGraph(imMos, g, imSeg)
imMos.getViewer().drawOverlay(imSeg)
g.removeNodeEdges(3)
sp.graphToMosaic(imMos, g, imSeg)
smilPlot([imIn, imMos, imSeg], label = [False, True, True])