Is anybody having problems with OpenCV 2.4 and converting images to the YCrCb color space? I am using the Python bindings and I can't seem to find whatever definition is used to convert BGR2YCrCb. Here are some things that I have been trying:
>>> 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 anybody know how to perform the conversion in cv2?
In Python, COLOR_BGR2YCrCb
is called COLOR_BGR2YCR_CB
.
Looking at build/modules/python/pyopencv_generated_const_reg.h
revealed:
97: PUBLISH2(COLOR_BGR2YCR_CB,cv::COLOR_BGR2YCrCb);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With