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