Ask Your Question
0

OpenCV: BGR to YUV conversion

asked Mar 4 '15

begueradj gravatar image

updated Mar 5 '15

Is there a way to convert an image from BGR to YUV color space ?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Mar 4 '15

bvbdort gravatar image

updated Mar 5 '15

In c++ use

  cvtColor(img_in, img_out, CV_BGR2YUV);

In python

 img_out = cv2.cvtColor(img_in, cv2.COLOR_BGR2YUV)
Preview: (hide)

Comments

I did that in Python and it says : AttributeError: 'module' object has no attribute 'CV_BGR2YUV'

begueradj gravatar imagebegueradj (Mar 5 '15)edit

it works, thank you very much !

begueradj gravatar imagebegueradj (Mar 5 '15)edit

Question Tools

1 follower

Stats

Asked: Mar 4 '15

Seen: 31,938 times

Last updated: Mar 05 '15