Computer Vison Lab Task
Computer Vison Lab Task
plt.figure(figsize=(10, 10))
plt.imshow(image_gray, cmap='gray')
plt.show()
plt.figure(figsize=(5,5))
plt.imshow(baboon[:, :, 0])
plt.show()
Q-02: What will happen if you modify the code to baboon[:, :, 1]?
baboon_red = baboon.copy()
baboon_red[:, :, 0] = 0
baboon_red[:, :, 1] = 0
plt.figure(figsize=(10, 10))
plt.imshow(cv2.cvtColor(baboon_red, cv2.COLOR_BGR2RGB))
plt.show()
new_image = image[0:rows,:,:]
B = new_image.copy()
new_image[:,:,:] = 0
plt.imshow(B)
plt.show()
plt.figure(figsize=(10,10))
plt.subplot(121)
plt.imshow(cv2.cvtColor(baboon, cv2.COLOR_BGR2RGB))
plt.title("RGB image")
plt.subplot(122)
plt.imshow(im_bgr,cmap='gray')
plt.title("Different color channels")
plt.show()
Q-11: What will happen if you use cv2.cvtColor with cv2.COLOR_BGR2GRAY on the cropped
image?