SMIL  0.8
 All Classes Functions Variables Groups Pages
thresholds.py

1 from smilPython import *
2 
3 # Load an image
4 im1 = Image("http://cmm.ensmp.fr/~faessel/smil/images/lena.png")
5 im1.show()
6 
7 # Manual threshold (between 100 and 255)
8 im2 = Image(im1)
9 threshold(im1, 100, 255, im2)
10 im2.show()
11 
12 # Otsu automatic threshold
13 im3 = Image(im1)
14 # Generate two threshold values (i.e. 3 classes)
15 otsuThreshold(im1, im3, 2)
16 # Display the resulting image with three labels values corresponding to the three classes
17 im3.showLabel()