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

opencv grayscale to rgb

backtorgb = cv2.cvtColor(gray,cv2.COLOR_GRAY2RGB)
Comment

rgb to grayscale python

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

convert image to grayscale in Python with OpenCV

 im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
Comment

PREVIOUS NEXT
Code Example
Python :: sns figsize 
Python :: record the amount of time ittales for code to run python 
Python :: ipykernel pip 
Python :: convert python list to text file 
Python :: import mean squared log error 
Python :: find element by title selenium python 
Python :: python os remove file 
Python :: python reload import 
Python :: how to change windows icon tkinter 
Python :: how to install mediapipe python 
Python :: pyspark date to week number 
Python :: python regex for a url 
Python :: get current date in python 
Python :: ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected. 
Python :: print colored text python 
Python :: python elif invalid syntax 
Python :: pandas plotly backend 
Python :: sort python nested list according to a value 
Python :: Package python3-pip is not available, but is referred to by another package. 
Python :: django create empty migration 
Python :: how to open a software using python 
Python :: plt tight layout 
Python :: selenium python enter text 
Python :: python add month datetime 
Python :: wait function python 
Python :: how to install pandas datareader in conda 
Python :: update tensorflow pip 
Python :: run django app locally 
Python :: print all keys having same value 
Python :: select closest number in array python 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =