Ask Your Question
0

Default color space for frames in video

asked 2016-12-26 07:27:32 -0600

Uma gravatar image

Hai, I have a video which is having yuv color space and H264 codec. I am using Opencv videocapture function to read a frame. I just want to know whether the frame's mat object is in BGR or YUV color space pixels ?

Thanks in advance.....

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-12-26 07:46:21 -0600

berak gravatar image

VideoCapture will convert the image automatically to BGR colorspace.

you can disable this conversion (and receive YUV) by setting the CAP_PROP_CONVERT_RGB property to false.

edit flag offensive delete link more

Comments

Thanks..If suppose I am reading raw YUV frame using file read operation and then I need to write frame using imwrite means, what color space will be present when using imwrite function?

Uma gravatar imageUma ( 2016-12-26 23:37:54 -0600 )edit

imwrite() won't change the colorspace

berak gravatar imageberak ( 2016-12-27 01:47:35 -0600 )edit

Thanks @berak

Uma gravatar imageUma ( 2016-12-27 04:59:41 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-26 07:27:32 -0600

Seen: 5,053 times

Last updated: Dec 26 '16