Convert from RGB to YUYV in OpenCV

asked 2016-10-05 10:05:01 -0500

Is there a way to convert from RGB to YUYV (YUY 4:2:2) format? I noted that OpenCV has reverse operation, but not RGB to YUYV for some reason. Maybe someone can point to code which does that (even outside of OpenCV library)?

edit retag flag offensive close merge delete


I think that all color conversion codes are here

LBerger gravatar imageLBerger ( 2016-10-05 13:30:11 -0500 )edit

Hmm be careful with RGB .. because if you do an imread OpenCV images are BGR! So what you need is COLOR_BGR2YUV!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-10-07 03:31:42 -0500 )edit