Help Sally restore her graduation photo
You are going to combine all the knowledge you acquired throughout the course to complete a final challenge: reconstructing a very damaged photo.
Help Sally restore her favorite portrait which was damaged by noise, distortion, and missing information due to a breach in her laptop.
damaged_image.You will be fixing the problems of this image by:
- Rotating it to be uprightusing
rotate() - Applying noise reduction with
denoise_tv_chambolle() - Reconstructing the damaged parts with
inpaint_biharmonic()from theinpaintmodule.
show_image() is already preloaded.
Latihan ini adalah bagian dari kursus
Image Processing in Python
Petunjuk latihan
- Import the necessary module to apply restoration on the image.
- Rotate the image by calling the function
rotate(). - Use the chambolle algorithm to remove the noise from the image.
- With the mask provided, use the biharmonic method to restore the missing parts of the image and obtain the final image.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Import the necessary modules
from skimage.restoration import denoise_tv_chambolle, ____
from skimage import transform
# Transform the image so it's not rotated
upright_img = ____(damaged_image, 20)
# Remove noise from the image, using the chambolle method
upright_img_without_noise = ____(upright_img,weight=0.1, multichannel=True)
# Reconstruct the image missing parts
mask = get_mask(upright_img)
result = ____.____(upright_img_without_noise, mask, multichannel=True)
show_image(result)