April 2020
Intermediate to advanced
438 pages
12h 2m
English
You need to perform the following steps to implement image restoration with dictionary learning using the scikit-learn library functions:
lena = rgb2gray(imread('images/lena.png'))height, width = lena.shapeprint('Distorting the lower half of the image...')distorted = lena.copy()distorted[height // 2:, :] += 0.085 * \ np.random.randn(height // 2, width)
print('Extracting reference patches...')patch_size = (7, 7)data = extract_patches_2d(distorted[height ...Read now
Unlock full access