We can blur images with a Gaussian filter (http://en.wikipedia.org/wiki/Gaussian_filter). This filter is based on the normal distribution. A corresponding SciPy function requires the standard deviation as a parameter. In this recipe, we will also plot a Polar rose and a spiral http://en.wikipedia.org/wiki/Polar_coordinate_system. These figures are not directly related, but it seemed more fun to combine them here.
We start by initializing the polar plots, after which we will blur the Lena image and plot using polar coordinates:
Initialize the polar plots:
NFIGURES = 5 k = np.random.random_integers(1, 5, NFIGURES) a = np.random.random_integers(1, 5, NFIGURES) colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']
To blur Lena, apply the Gaussian filter with a standard deviation of
4
:plt.subplot(212) blurred = scipy.ndimage.gaussian_filter(lena, sigma=4) plt.imshow(blurred) plt.axis('off')
matplotlib has a
polar()
function, which plots in polar coordinates:theta = np.linspace...