SMIL  1.0.3
thresholds.py
1 from smilPython import *
2 
3 # Load an image
4 im1 = Image("https://smil.cmm.minesparis.psl.eu/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()
vector< T > otsuThreshold(const Image< T > &imIn, Image< T_out > &imOut, UINT nbrThresholds)
otsuThreshold() - Otsu Threshold
Definition: DImageHistogram.hpp:785
RES_T threshold(const Image< T > &imIn, T minVal, T maxVal, T_out trueVal, T_out falseVal, Image< T_out > &imOut)
threshold() - Image threshold
Definition: DImageHistogram.hpp:269