SMIL  0.8
 All Classes Functions Variables Groups Pages
multichannel_operations.py

1 from smilPython import *
2 
3 # Load a RGB image
4 im1 = Image("http://cmm.ensmp.fr/~faessel/smil/images/arearea.png")
5 im1.show()
6 
7 # Copy the green channel into a UINT8 image
8 im2 = Image()
9 copyChannel(im1, 1, im2)
10 im2.show()
11 
12 # Split RGB channels into a 3D UINT8 image with 3 slices (one for each channel)
13 im3 = Image()
14 splitChannels(im1, im3)
15 im3.show()
16 
17 # Perform a 2D dilation on the slices
18 im4 = Image(im3)
19 dilate(im3, im4)
20 im4.show()
21 
22 # And merge the result into a RGB image
23 im5 = Image(im1)
24 mergeChannels(im4, im5)
25 im5.show()