0. Write a script to generate a border around the raccoon image (for example a 20 pixel size black border; black color code is 0 0 0)
1. Do it again without losing pixels and generate then a raccoon1 array/image
2. 1. Mask the face of the raccoon with a grey circle (centered of radius 240 at location 690 260 of the raccoon1 image; grey color code is for example (120 120 120)). Tip: check the np.indices function.
2. Mask the face of the raccon with a grey square by using NumPy broadcast capabilities (height and width 480 and same center as before)
2. Mask the face of the raccoon with a grey square by using NumPy broadcast capabilities (height and width 480 and same center as before)
3. We propose to smooth the image : the value of a pixel of the smoothed image is the the average of the values of its neighborhood (ie the 8 neighbors + itself).
%% Cell type:markdown id: tags:
...
...
@@ -383,11 +383,11 @@
%% Cell type:markdown id: tags:
### Solution 2.B
Mask the face of the raccon with a grey square by using NumPy broadcast capabilities (height and width 480 and same center as before)
Mask the face of the raccoon with a grey square by using NumPy broadcast capabilities (height and width 480 and same center as before)