Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

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()
Comment

PREVIOUS NEXT
Code Example
Python :: COMBINE TWO 2-D NUMPY ARRAYS WITH NP.VSTACK 
Python :: select series of columns 
Python :: how to loop over all dates in python 
Python :: how to make a relationship in python 
Python :: coin flip numpy 
Python :: pinyin to pinyin numbers python 
Python :: how to open camre aopencv 
Python :: argmin returns one value for 2d array 
Python :: bouon arrondi tkinter 
Python :: how to add 2 integers in python 
Python :: python star sign before list 
Python :: bill wiliams fractal python pandas 
Python :: Free the Bunny Prisoners 
Python :: var person 
Python :: locate certs path for python 
Python :: jinja 2 iterate over dictionary 
Python :: spotify python bot 
Python :: Lcd screen 3.5 inch to pi 
Python :: how to print a text in python 
Python :: how to remove na values in r data frame 
Python :: threshhold crossing on list python 
Python :: len of square matrix 
Python :: <ipython-input-31-da456dc89cda in <module 
Python :: p and c in python 
Python :: Finding the Sum of a Symmetrical Sub-List 
Python :: filter pandas stack overflow 
Python :: save multiple df to pkl 
Python :: fix misspelled in Wikipedia library on python 
Python :: python which __divs__ are there 
Python :: quicksort python 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =