April 2020
Intermediate to advanced
438 pages
12h 2m
English
Follow these steps to pose the inpainting problem as a convex optimization problem and solve it using pyunlocbox library's solvers:
#!pip install pyunlocboxfrom pyunlocbox import functions, solversim_original = rgb2gray(imread('images/cat.png'))
np.random.seed(1) # Reproducible results.mask = np.random.uniform(size=im_original.shape)mask = mask > 0.8g = lambda x: mask * xim_corrupted = g(im_original)
Read now
Unlock full access