let us suppose we have following image :
i want to extract only head part, so i have applied following code :
import cv2
import numpy as np
import matplotlib.pyplot as plt
image =cv2.imread("dog.jpg",0)
image =cv2.resize(image,(400,400))
mask =np.zeros((400,400),dtype='uint8')
mask[50:150,150:250]=1
print(mask[50:150,150:250])
image =cv2.bitwise_and(image,mask)
plt.imshow(image,cmap='gray')
plt.show()
but result is :
could you please tell me why i can’t see extracted part? should i convert it to some format?thanks in advance