Python, Image Processing, Kernel, Matplotlib, TensorFlow.
channel. # The typical weights used are 0.2989 for Red, 0.5870 for Green, and 0.1140 for Blue grayscale_image = 0.2989 * image_array[:,:,0] + 0.5870 * image_array[:,:,1] + 0.1140 * image_array[:,:,2] # Display the grayscale image plt.figure(figsize=(20, 20)) plt.imshow(grayscale_image, cmap='gray')