up [pdf]
from rsf.proj import *

# Download data
Fetch('mona.img','imgs')

# Convert to standard format
Flow('mona','mona.img',
     '''
     echo n1=512 n2=513 in=$SOURCE data_format=native_uchar |
     dd type=float
     ''',stdin=0)

Result('mona',
       '''
       grey transp=n allpos=y title="Mona Lisa"
       color=b screenratio=1 wantaxis=n
       ''')

Result('edge','mona',
       '''
       canny | dd type=float | 
       grey allpos=y title="Edge Detector" transp=n screenratio=1 wantaxis=n
       ''')

# Edge preserving smoothing

rect=80 # smoothing radius

Flow('mona2','mona','impl2 rect1=%d rect2=%d tau=1' % (rect,rect))

Result('mona2',
       '''
       grey transp=n allpos=y title="Smoothed"
       color=b screenratio=1 wantaxis=n
       ''')

Result('edge2','mona2',
       '''
       canny | dd type=float | 
       grey allpos=y title="Edge Detector" transp=n screenratio=1 wantaxis=n
       ''')

End()

sfdd
sfgrey
sfcanny
sfimpl2

data/imgs/mona.img