Answers for "convert image to hsv opencv python"

2

convert opencv image to pil image

import cv2
import numpy as np
from PIL import Image

img = cv2.imread("path/to/img.png")

# You may need to convert the color.
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
im_pil = Image.fromarray(img)

# For reversing the operation:
im_np = np.asarray(im_pil)
Posted by: Guest on June-26-2020
-1

opencv python rgb to hsv

colorsys.rgb_to_hsv(px[2], px[1], px[0})
Posted by: Guest on August-27-2020

Code answers related to "convert image to hsv opencv python"

Python Answers by Framework

Browse Popular Code Answers by Language