Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

programme phyton pour realiser un programme qui transforme une image en niveau de gris

from matplotlib import pyplot as plt
import matplotlib.image as mpimg

img = mpimg.imread('test.jpg')

R, G, B = img[:,:,0], img[:,:,1], img[:,:,2]
imgGray = 0.2989 * R + 0.5870 * G + 0.1140 * B
plt.imshow(imgGray, cmap='gray')
plt.show()
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #programme #phyton #pour #realiser #programme #qui #transforme #une #image #en #niveau #de #gris
ADD COMMENT
Topic
Name
7+6 =