Answers for "how to change color of image in opencv"

0

how to change color of image in opencv

# if you want to change color while reading the image, set flag=0 for Grayscale
img = cv2.imread("example.png", flag=0)

# if you want to change color of a pre-loaded image (Grayscale)
# chnage the code parameter accordingly, here it turns into grayscale
img = cv2.cvtColor(img, code=cv2.COLOR_BGR2GRAY)
Posted by: Guest on April-24-2021

Code answers related to "how to change color of image in opencv"

Python Answers by Framework

Browse Popular Code Answers by Language