SMIL 1.1.1
Loading...
Searching...
No Matches
example-distance-geodesic.py
1import smilPython as sp
2
3im = sp.Image("cells.png")
4
5imDist = sp.Image(im)
6imMask = sp.Image(im)
7imMark = sp.Image(im)
8imGeoDist = sp.Image(im)
9
10# create a marker image, the same as the original image except at
11# some point inside the "true" region, which is set to "0"
12nl = sp.HexSE()
13sp.distance(im, imDist, nl)
14sp.compare(imDist, "==", sp.maxVal(imDist), 0, im, imMark)
15
16# use the original image as the mask.
17sp.copy(im, imMask)
18sp.distanceGeodesic(imMark, imMask, imGeoDist, nl)
19
20imGeoDist.show()
21sp.maxVal(imGeoDist)