SMIL 1.1.1
Loading...
Searching...
No Matches
hit_or_miss.py
1from smilPython import *
2
3# Load an image
4im1 = Image("https://smil.cmm.minesparis.psl.eu/images/balls.png")
5im1.show()
6
7# Create the skeleton using a thinning with a combination of the 4 rotations of the composite SE sL1 and sL2
8im2 = Image(im1)
9fullThin(im1, HMT_sL1(4) | HMT_sL2(4), im2)
10
11# Detect line junctions
12im3 = Image(im1)
13hitOrMiss(im2, HMT_sLineJunc(8), im3)
14
15# Detect line ends
16im4 = Image(im1)
17hitOrMiss(im2, HMT_sLineEnd(8), im4)
18
19# Modigy results for display...
20dilate(im3, im3, hSE())
21dilate(im4, im4, hSE())
22inf(im3, 1, im3)
23inf(im4, 3, im4)
24sup(im3, im4, im4)
25
26im2.getViewer().drawOverlay(im4)
27im2.show()
28