有人在使用 OpenCV 2.4 并将图像转换为 YCrCb 颜色空间时遇到问题吗?我正在使用 Python 绑定,但似乎找不到用于转换 BGR2YCrCb 的任何定义。以下是我一直在尝试的一些事情:
>>> 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'
>>>
有人知道如何在 cv2 中执行转换吗?