.raw image to yuv image

I have raw images. how can i covert it into yuv images using opencv

Old answer in previous forum but still valid I think
In python