from rsf.proj import *
Fetch('mona.img','imgs')
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
''')
rect=80
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
''')
Flow('patch','mona','patch w=200,200 p=3,3 | put n3=9 n4=1')
Flow('patch2','patch','impl2 rect1=%d rect2=%d tau=1' % (rect,rect),
split=[4,'omp'])
Flow('pmona2','patch2','put n3=3 n4=3 | patch inv=y weight=y')
Result('pmona2',
'''
grey transp=n allpos=y title="Smoothed (with Patching)"
color=b screenratio=1 wantaxis=n
''')
End() |