BaşlayınÜcretsiz Başlayın

Images as data: changing images

To modify an image, you can modify the existing numbers in the array. In a color image, you can change the values in one of the color channels without affecting the other colors, by indexing on the last dimension of the array.

The image you imported in the previous exercise is available in data.

Bu egzersiz

Image Modeling with Keras

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Modify the bricks image to replace the top left corner of the image (10 by 10 pixels) into a red square.
  • Visualize the resulting image.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Set the red channel in this part of the image to 1
data[____] = ____

# Set the green channel in this part of the image to 0
data[____] = ____

# Set the blue channel in this part of the image to 0
data[____] = ____

# Visualize the result
____
____
Kodu Düzenle ve Çalıştır