<jupyter_start><jupyter_text>Take an image and apply Gaussian blur like in Figure 1-9. Plot the image contours for increasing values of σ . What happens? Can you explain why?<jupyter_code>%matplotlib inline

from PIL import Image
from pylab import *
from numpy import *
from scipy.ndimage import filters

def make_contour(im):
    figure()
    gray()
    contour(im, origin='image')
    axis('equal')
    axis('off')


def gaussian_filter(im, sigma):
    return filters.gaussian_filter(im, sigma)
    
gray()<jupyter_output><empty_output><jupyter_text>原始图像的轮廓图<jupyter_code>im = array(Image.open('../images/empire.jpg').convert('L'))
make_contour(im)
title('original')
### 高斯滤波 偏差值为 2 的轮廓图
im2 = make_contour(gaussian_filter(im, 2))
title('gaussian filter with sigma=2')
### 高斯滤波 偏差值为 5 的轮廓图
im5 = make_contour(gaussian_filter(im, 5))
title('gaussian filter with sigma=5')<jupyter_output><empty_output><jupyter_text>高斯滤波 偏差值为 10 的轮廓图<jupyter_code>im10 = make_contour(gaussian_filter(im, 10))
title('gaussian filter with sigma=10')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12169811320754717, 'fraction_numerical': 0.016981132075471698, 'mean_word_length': 6.368055555555555, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '299707', 'license': 'MIT', 'n_tokens_mistral': 432, 'n_tokens_neox': 430, 'n_words': 90, 'path': 'Chapter01/exercise-1.ipynb', 'repo_name': 'wolfg1969/Programming-Computer-Vision-with-Python-practice', 'size': '1060'}