SMIL 1.1.1
Loading...
Searching...
No Matches
operators.py
1from smilPython import *
2
3# Load an image
4im1 = Image("https://smil.cmm.minesparis.psl.eu/images/lena.png")
5im1.show()
6
7im2 = Image(im1)
8# Mask of im1>0:
9# im1 > 100 returns an image = 255 when im1>100 and = 0 otherwise
10# take the result and make the inf (&) with the original image
11im2 << ( (im1>100) & im1 )
12im2.show()
13
14
15im3 = Image(im1)
16sePts = ((0,0), (0,1), (1,1), (1,0), (-1,1), (-1,0), (-1,-1), (0,-1), (1,-1))
17# Fill 0
18im3 << 0
19# Take the sup with each translation of im1...
20for (dx,dy) in sePts:
21 im3 |= trans(im1, dx, dy)
22im3.show()