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 :: reverse string in python without using function 
Python :: explode multiple columns pandas 
Python :: array slicing python 
Python :: python second element of every tuple in list 
Python :: how to search for an item in a list in python 
Python :: django-storages delete folder 
Python :: Openpyxl automatic width 
Python :: 151 - Power Crisis solution in python 
Python :: python bot ban script 
Python :: create instances of a class in a for loop 
Python :: how to add items to a set in python 
Python :: python slicing a list 
Python :: matplotlib yaxis off 
Python :: where are docker logs 
Python :: python string to lowercase 
Python :: 2d array python 
Python :: django get form id from request 
Python :: python get website chrome network tab 
Python :: normalized histogram pandas 
Python :: pyhton comment 
Python :: python counting up and down 
Python :: how to check whether input is string or not 
Python :: python selenium chrome save session 
Python :: how to find min, max in dictionaries 
Python :: reshape (-1,1) 
Python :: how to import something in python 
Python :: change folder icon with python 
Python :: how to delete in python 
Python :: django log queryset 
Python :: hwo to except every error in python try statemen 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =