In [2]:
%run common.ipynb
from __future__ import division


Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['f']
`%matplotlib` prevents importing * from pylab and numpy

In [3]:
gimshow(img, title='Original image')



In [4]:
med_img = None
def f(size):
    global med_img
    med_img = ndimage.median_filter(img, size)
    gimshow(med_img, title='Smoothed image')
    print 'Variance:', img.var(), ',', med_img.var()
interact(f, size=(1,15,2))


Variance: 714.107846358 , 525.47082553

In [ ]: