I fail to find an easy-to-use function in any Python library (preferrably PIL) for conversion from RGB to YUV. Since I have to convert many images, I don't want to implement it myself (would be expensive without LUTs and so on).
When I do the intuitive:
from PIL import Image
img = Image.open('test.jpeg')
img_yuv = img.convert('YUV')
I get an error:
ValueError: conversion from RGB to YUV not supported
Do you know why this is the case? Is there any efficieint implementation of that in python and maybe even PIL?
I am no computer vision expert but I thought this ocnversion is standard in most of the libraries...
Thanks,
Roman
You can try this:
import cv2
img_yuv = cv2.cvtColor(img, cv2.COLOR_BGR2YUV)