From 7bda6992e584c75fd1bc569cdaac931385eb76c0 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Mon, 19 Aug 2013 13:17:55 +0400 Subject: [PATCH] fixed gpu BGR <-> YUV color conversion --- modules/core/include/opencv2/core/cuda/color.hpp | 32 +++++++++++----------- .../include/opencv2/cudev/functional/color_cvt.hpp | 32 +++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/modules/core/include/opencv2/core/cuda/color.hpp b/modules/core/include/opencv2/core/cuda/color.hpp index a2b772d..d5f94c9 100644 --- a/modules/core/include/opencv2/core/cuda/color.hpp +++ b/modules/core/include/opencv2/core/cuda/color.hpp @@ -107,25 +107,25 @@ namespace cv { namespace gpu { namespace cudev #undef OPENCV_GPU_IMPLEMENT_RGB2GRAY_TRAITS - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv, 3, 3, 0) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv, 4, 3, 0) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv4, 3, 4, 0) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv4, 4, 4, 0) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv, 3, 3, 2) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv, 4, 3, 2) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv4, 3, 4, 2) - OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv4, 4, 4, 2) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv, 3, 3, 2) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv, 4, 3, 2) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgb_to_yuv4, 3, 4, 2) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(rgba_to_yuv4, 4, 4, 2) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv, 3, 3, 0) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv, 4, 3, 0) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgr_to_yuv4, 3, 4, 0) + OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS(bgra_to_yuv4, 4, 4, 0) #undef OPENCV_GPU_IMPLEMENT_RGB2YUV_TRAITS - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgb, 3, 3, 0) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgba, 3, 4, 0) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgb, 4, 3, 0) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgba, 4, 4, 0) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgr, 3, 3, 2) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgra, 3, 4, 2) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgr, 4, 3, 2) - OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgra, 4, 4, 2) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgb, 3, 3, 2) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_rgba, 3, 4, 2) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgb, 4, 3, 2) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_rgba, 4, 4, 2) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgr, 3, 3, 0) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv_to_bgra, 3, 4, 0) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgr, 4, 3, 0) + OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS(yuv4_to_bgra, 4, 4, 0) #undef OPENCV_GPU_IMPLEMENT_YUV2RGB_TRAITS diff --git a/modules/cudev/include/opencv2/cudev/functional/color_cvt.hpp b/modules/cudev/include/opencv2/cudev/functional/color_cvt.hpp index 1984687..8be8547 100644 --- a/modules/cudev/include/opencv2/cudev/functional/color_cvt.hpp +++ b/modules/cudev/include/opencv2/cudev/functional/color_cvt.hpp @@ -100,14 +100,14 @@ CV_CUDEV_GRAY2RGB_INST(GRAY_to_BGRA, 4) { \ }; -CV_CUDEV_RGB2YUV_INST(RGB_to_YUV, 3, 3, 0) -CV_CUDEV_RGB2YUV_INST(RGBA_to_YUV, 4, 3, 0) -CV_CUDEV_RGB2YUV_INST(RGB_to_YUV4, 3, 4, 0) -CV_CUDEV_RGB2YUV_INST(RGBA_to_YUV4, 4, 4, 0) -CV_CUDEV_RGB2YUV_INST(BGR_to_YUV, 3, 3, 2) -CV_CUDEV_RGB2YUV_INST(BGRA_to_YUV, 4, 3, 2) -CV_CUDEV_RGB2YUV_INST(BGR_to_YUV4, 3, 4, 2) -CV_CUDEV_RGB2YUV_INST(BGRA_to_YUV4, 4, 4, 2) +CV_CUDEV_RGB2YUV_INST(RGB_to_YUV, 3, 3, 2) +CV_CUDEV_RGB2YUV_INST(RGBA_to_YUV, 4, 3, 2) +CV_CUDEV_RGB2YUV_INST(RGB_to_YUV4, 3, 4, 2) +CV_CUDEV_RGB2YUV_INST(RGBA_to_YUV4, 4, 4, 2) +CV_CUDEV_RGB2YUV_INST(BGR_to_YUV, 3, 3, 0) +CV_CUDEV_RGB2YUV_INST(BGRA_to_YUV, 4, 3, 0) +CV_CUDEV_RGB2YUV_INST(BGR_to_YUV4, 3, 4, 0) +CV_CUDEV_RGB2YUV_INST(BGRA_to_YUV4, 4, 4, 0) #undef CV_CUDEV_RGB2YUV_INST @@ -118,14 +118,14 @@ CV_CUDEV_RGB2YUV_INST(BGRA_to_YUV4, 4, 4, 2) { \ }; -CV_CUDEV_YUV2RGB_INST(YUV_to_RGB, 3, 3, 0) -CV_CUDEV_YUV2RGB_INST(YUV_to_RGBA, 3, 4, 0) -CV_CUDEV_YUV2RGB_INST(YUV4_to_RGB, 4, 3, 0) -CV_CUDEV_YUV2RGB_INST(YUV4_to_RGBA, 4, 4, 0) -CV_CUDEV_YUV2RGB_INST(YUV_to_BGR, 3, 3, 2) -CV_CUDEV_YUV2RGB_INST(YUV_to_BGRA, 3, 4, 2) -CV_CUDEV_YUV2RGB_INST(YUV4_to_BGR, 4, 3, 2) -CV_CUDEV_YUV2RGB_INST(YUV4_to_BGRA, 4, 4, 2) +CV_CUDEV_YUV2RGB_INST(YUV_to_RGB, 3, 3, 2) +CV_CUDEV_YUV2RGB_INST(YUV_to_RGBA, 3, 4, 2) +CV_CUDEV_YUV2RGB_INST(YUV4_to_RGB, 4, 3, 2) +CV_CUDEV_YUV2RGB_INST(YUV4_to_RGBA, 4, 4, 2) +CV_CUDEV_YUV2RGB_INST(YUV_to_BGR, 3, 3, 0) +CV_CUDEV_YUV2RGB_INST(YUV_to_BGRA, 3, 4, 0) +CV_CUDEV_YUV2RGB_INST(YUV4_to_BGR, 4, 3, 0) +CV_CUDEV_YUV2RGB_INST(YUV4_to_BGRA, 4, 4, 0) #undef CV_CUDEV_YUV2RGB_INST -- 2.7.4