Cv2 and BGR2YCrCb do not work with Python bindings

Does anyone have problems with OpenCV 2.4 and converting images to YCrCb color space? I am using Python bindings and I cannot find any definition used to convert BGR2YCrCb. Here are some things I tried:

>>> import cv2
>>> cv2.COLOR_BGR2GRAY # works fine
6L
>>> cv2.COLOR_BGR2HSV # works fine
40L
>>> cv2.COLOR_BGR2YCrCb # now the trouble starts
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'COLOR_BGR2YCrCb'
>>> cv2.COLOR_BGR2YCC
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'COLOR_BGR2YCC'
>>>

Does anyone know how to convert to cv2?

+5
source share
1 answer

In Python COLOR_BGR2YCrCbis called . COLOR_BGR2YCR_CB

A glance build/modules/python/pyopencv_generated_const_reg.hshowed:

97: PUBLISH2(COLOR_BGR2YCR_CB,cv::COLOR_BGR2YCrCb);
+8
source

All Articles