SMIL  0.8
 All Classes Functions Variables Groups Pages
benchs.py

1 from smilPython import *
2 
3 sx = 1024
4 sy = 1024
5 bench_nruns = 1E3
6 
7 
8 # Load an image
9 imIn = Image("http://cmm.ensmp.fr/~faessel/smil/images/DNA_small.png")
10 
11 im1 = Image(sx, sy)
12 im2 = Image(im1)
13 im3 = Image(im1)
14 
15 resize(imIn, im1)
16 
17 print("*** Base ***")
18 bench(copy, im1, im2)
19 bench(fill,im2, 0)
20 bench(inv, im1, im2)
21 bench(add, im1, im2, im3)
22 bench(sub, im1, im2, im3)
23 bench(mul, im1, im2, im3)
24 bench(div, im1, im2, im3)
25 
26 print("\n*** Arithmetic ***")
27 bench(inf, im1, im2, im3)
28 bench(sup, im1, im2, im3)
29 bench(equ, im1, im2, im3)
30 bench(low, im1, im2, im3)
31 
32 print("\n*** Morphology ***")
33 bench(dilate, im1, im2, hSE(1))
34 bench(dilate, im1, im2, sSE(1))
35 bench(dilate, im1, im2, CrossSE(1))
36 bench(open, im1, im2, hSE(1))
37 bench(open, im1, im2, sSE(1))
38 bench(open, im1, im2, CrossSE(1))
39 
40