Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

rgb to grayscale python opencv

import cv2
  
image = cv2.imread('C:/Users/N/Desktop/Test.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
cv2.imshow('Original image',image)
cv2.imshow('Gray image', gray)
  
cv2.waitKey(0)
cv2.destroyAllWindows()
Comment

rgb to grayscale python

from PIL import Image
img = Image.open('image.png').convert('LA')
img.save('greyscale.png')
Comment

PREVIOUS NEXT
Code Example
Python :: python pip install from script 
Python :: generate a list of random non repeated numbers python 
Python :: get active window title python 
Python :: python system arguments 
Python :: random color python matplotlib 
Python :: cv display image in full screen 
Python :: pandas datetime now 
Python :: pandas to list 
Python :: python random string 
Python :: get size of window tkinter 
Python :: python ffmpeg 
Python :: python import json into pymongo 
Python :: pandas sort values reset index 
Python :: draw circles matplotlib 
Python :: get video duration opencv python 
Python :: how to maker loops coun t in second in pytho 
Python :: py datetime.date get unix 
Python :: install python 3.6 mac brew 
Python :: create new django project 
Python :: matplotlib background color 
Python :: python year month from date 
Python :: resize image array python 
Python :: matplotlib set dpi 
Python :: Extract categorical data features 
Python :: how to make a query for not none value in django 
Python :: python module for converting miles to km 
Python :: python get cpu info 
Python :: how to stop the program in python 
Python :: to int in pandas 
Python :: convert transformation matrix to pose ros 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =