Page 342 - AI Ver 1.0 Class 10
P. 342
Output:
My Pet
20. Using the library: import cv2, matplotlib
Upload your own picture in your favorite dress and put a black box on the face and the hands.
Ans. Program:
import cv2
from matplotlib import pyplot as plt
import numpy as np
img = cv2.imread('D:\Picture of myself.jpg')
print(img.shape)
img[500:1600,2200:3500]=[0,0,0]
img[2800:3700,2300:3300]=[0,0,0]
plt.imshow (cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
plt.title('Shaded Face')
plt.axis ('off')
plt.show()
Output:
(3755, 5632, 3)
Shaded Face
340 Touchpad Artificial Intelligence-X

