Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
971e35f2
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
971e35f2
编写于
8月 17, 2011
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bug in gpu::cvtColor
上级
5e9ae6b1
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
1173 addition
and
128 deletion
+1173
-128
modules/gpu/src/color.cpp
modules/gpu/src/color.cpp
+62
-62
modules/gpu/src/cuda/color.cu
modules/gpu/src/cuda/color.cu
+8
-4
modules/gpu/src/opencv2/gpu/device/detail/color.hpp
modules/gpu/src/opencv2/gpu/device/detail/color.hpp
+23
-6
modules/gpu/test/test_imgproc.cpp
modules/gpu/test/test_imgproc.cpp
+1080
-56
未找到文件。
modules/gpu/src/color.cpp
浏览文件 @
971e35f2
...
...
@@ -51,7 +51,7 @@ void cv::gpu::cvtColor(const GpuMat&, GpuMat&, int, int, Stream&) { throw_nogpu(
#else
/* !defined (HAVE_CUDA) */
namespace
cv
{
namespace
gpu
{
namespace
color
namespace
cv
{
namespace
gpu
{
namespace
device
{
#define OPENCV_GPU_DECLARE_CVTCOLOR_ONE(name) \
void
name
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
cudaStream_t
stream
);
...
...
@@ -207,7 +207,7 @@ namespace
void
bgr_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgr_to_rgb_8u
,
0
,
bgr_to_rgb_16u
,
0
,
0
,
bgr_to_rgb_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -220,7 +220,7 @@ namespace
void
bgr_to_bgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgr_to_bgra_8u
,
0
,
bgr_to_bgra_16u
,
0
,
0
,
bgr_to_bgra_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -233,7 +233,7 @@ namespace
void
bgr_to_rgba
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgr_to_rgba_8u
,
0
,
bgr_to_rgba_16u
,
0
,
0
,
bgr_to_rgba_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -246,7 +246,7 @@ namespace
void
bgra_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgra_to_bgr_8u
,
0
,
bgra_to_bgr_16u
,
0
,
0
,
bgra_to_bgr_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -259,7 +259,7 @@ namespace
void
bgra_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgra_to_rgb_8u
,
0
,
bgra_to_rgb_16u
,
0
,
0
,
bgra_to_rgb_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -272,7 +272,7 @@ namespace
void
bgra_to_rgba
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgra_to_rgba_8u
,
0
,
bgra_to_rgba_16u
,
0
,
0
,
bgra_to_rgba_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -290,7 +290,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
bgr_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr_to_bgr565
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -300,7 +300,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
bgr_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
rgb_to_bgr555
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -310,7 +310,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
rgb_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
rgb_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
rgb_to_bgr565
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -320,7 +320,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
rgb_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
rgb_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgra_to_bgr555
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -330,7 +330,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
bgra_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgra_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgra_to_bgr565
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -340,7 +340,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
bgra_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgra_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
rgba_to_bgr555
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -350,7 +350,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
rgba_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
rgba_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
rgba_to_bgr565
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -360,7 +360,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
rgba_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
rgba_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr555_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -370,7 +370,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC3
);
color
::
bgr555_to_rgb
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr555_to_rgb
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr565_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -380,7 +380,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC3
);
color
::
bgr565_to_rgb
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr565_to_rgb
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr555_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -390,7 +390,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC3
);
color
::
bgr555_to_bgr
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr555_to_bgr
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr565_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -400,7 +400,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC3
);
color
::
bgr565_to_bgr
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr565_to_bgr
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr555_to_rgba
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -410,7 +410,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC4
);
color
::
bgr555_to_rgba
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr555_to_rgba
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr565_to_rgba
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -420,7 +420,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC4
);
color
::
bgr565_to_rgba
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr565_to_rgba
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr555_to_bgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -430,7 +430,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC4
);
color
::
bgr555_to_bgra
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr555_to_bgra
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr565_to_bgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -440,12 +440,12 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC4
);
color
::
bgr565_to_bgra
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr565_to_bgra
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
gray_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
gray_to_bgr_8u
,
0
,
gray_to_bgr_16u
,
0
,
0
,
gray_to_bgr_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -458,7 +458,7 @@ namespace
void
gray_to_bgra
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
gray_to_bgra_8u
,
0
,
gray_to_bgra_16u
,
0
,
0
,
gray_to_bgra_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -476,7 +476,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
gray_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
gray_to_bgr555
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
gray_to_bgr565
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -486,7 +486,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC2
);
color
::
gray_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
gray_to_bgr565
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr555_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -496,7 +496,7 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC1
);
color
::
bgr555_to_gray
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr555_to_gray
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
bgr565_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
...
...
@@ -506,12 +506,12 @@ namespace
dst
.
create
(
src
.
size
(),
CV_8UC1
);
color
::
bgr565_to_gray
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
device
::
bgr565_to_gray
(
src
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
rgb_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
rgb_to_gray_8u
,
0
,
rgb_to_gray_16u
,
0
,
0
,
rgb_to_gray_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -524,7 +524,7 @@ namespace
void
bgr_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgr_to_gray_8u
,
0
,
bgr_to_gray_16u
,
0
,
0
,
bgr_to_gray_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -537,7 +537,7 @@ namespace
void
rgba_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
rgba_to_gray_8u
,
0
,
rgba_to_gray_16u
,
0
,
0
,
rgba_to_gray_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -550,7 +550,7 @@ namespace
void
bgra_to_gray
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[]
=
{
bgra_to_gray_8u
,
0
,
bgra_to_gray_16u
,
0
,
0
,
bgra_to_gray_32f
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32F
);
...
...
@@ -563,7 +563,7 @@ namespace
void
rgb_to_yuv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -589,7 +589,7 @@ namespace
void
bgr_to_yuv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -615,7 +615,7 @@ namespace
void
yuv_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -641,7 +641,7 @@ namespace
void
yuv_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -667,7 +667,7 @@ namespace
void
rgb_to_YCrCb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -693,7 +693,7 @@ namespace
void
bgr_to_YCrCb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -719,7 +719,7 @@ namespace
void
YCrCb_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -745,7 +745,7 @@ namespace
void
YCrCb_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -771,7 +771,7 @@ namespace
void
rgb_to_xyz
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -797,7 +797,7 @@ namespace
void
bgr_to_xyz
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -823,7 +823,7 @@ namespace
void
xyz_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -849,7 +849,7 @@ namespace
void
xyz_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -875,7 +875,7 @@ namespace
void
rgb_to_hsv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -901,7 +901,7 @@ namespace
void
bgr_to_hsv
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -927,7 +927,7 @@ namespace
void
hsv_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -953,7 +953,7 @@ namespace
void
hsv_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -979,7 +979,7 @@ namespace
void
rgb_to_hls
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1005,7 +1005,7 @@ namespace
void
bgr_to_hls
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1031,7 +1031,7 @@ namespace
void
hls_to_rgb
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1057,7 +1057,7 @@ namespace
void
hls_to_bgr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1083,7 +1083,7 @@ namespace
void
rgb_to_hsv_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1109,7 +1109,7 @@ namespace
void
bgr_to_hsv_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1135,7 +1135,7 @@ namespace
void
hsv_to_rgb_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1161,7 +1161,7 @@ namespace
void
hsv_to_bgr_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1187,7 +1187,7 @@ namespace
void
rgb_to_hls_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1213,7 +1213,7 @@ namespace
void
bgr_to_hls_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1239,7 +1239,7 @@ namespace
void
hls_to_rgb_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1265,7 +1265,7 @@ namespace
void
hls_to_bgr_full
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
dcn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
color
;
using
namespace
cv
::
gpu
::
device
;
static
const
gpu_func_t
funcs
[
2
][
2
][
6
]
=
{
{
...
...
@@ -1364,7 +1364,7 @@ void cv::gpu::cvtColor(const GpuMat& src, GpuMat& dst, int code, int dcn, Stream
rgb_to_hls
,
// CV_RGB2HLS =53
hsv_to_bgr
,
// CV_HSV2BGR =54
bgr
_to_rgb
,
// CV_HSV2RGB =55
hsv
_to_rgb
,
// CV_HSV2RGB =55
0
,
// CV_Lab2BGR =56
0
,
// CV_Lab2RGB =57
...
...
modules/gpu/src/cuda/color.cu
浏览文件 @
971e35f2
...
...
@@ -44,11 +44,15 @@
#include "opencv2/gpu/device/transform.hpp"
#include "opencv2/gpu/device/color.hpp"
using
namespace
cv
::
gpu
;
using
namespace
cv
::
gpu
::
device
;
namespace
cv
{
namespace
gpu
{
namespace
color
namespace
cv
{
namespace
gpu
{
namespace
device
{
template
<
>
struct
TransformFunctorTraits
<
bgra_to_rgba_traits
<
uchar
>::
functor_type
>
:
DefaultTransformFunctorTraits
<
bgra_to_rgba_traits
<
uchar
>::
functor_type
>
{
enum
{
smart_block_dim_x
=
8
};
enum
{
smart_block_dim_y
=
8
};
enum
{
smart_shift
=
4
};
};
#define OPENCV_GPU_IMPLEMENT_CVTCOLOR(name, traits) \
void
name
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
cudaStream_t
stream
)
\
{
\
...
...
modules/gpu/src/opencv2/gpu/device/detail/color.hpp
浏览文件 @
971e35f2
...
...
@@ -100,15 +100,32 @@ namespace cv { namespace gpu { namespace device
namespace
detail
{
template
<
typename
T
,
typename
D
,
int
bidx
>
struct
RGB2RGB
:
public
unary_function
<
T
,
D
>
template
<
typename
T
,
int
scn
,
int
dcn
,
int
bidx
>
struct
RGB2RGB
:
unary_function
<
typename
TypeVec
<
T
,
scn
>::
vec_type
,
typename
TypeVec
<
T
,
dcn
>::
vec_type
>
{
__device__
D
operator
()(
const
T
&
src
)
const
__device__
typename
TypeVec
<
T
,
dcn
>::
vec_type
operator
()(
const
typename
TypeVec
<
T
,
scn
>::
vec_type
&
src
)
const
{
D
dst
;
typename
TypeVec
<
T
,
dcn
>::
vec_type
dst
;
dst
.
x
=
(
&
src
.
x
)[
bidx
];
dst
.
y
=
src
.
y
;
dst
.
z
=
(
&
src
.
x
)[
bidx
^
2
];
setAlpha
(
dst
,
getAlpha
<
typename
VecTraits
<
T
>::
elem_type
>
(
src
));
setAlpha
(
dst
,
getAlpha
<
T
>
(
src
));
return
dst
;
}
};
template
<
>
struct
RGB2RGB
<
uchar
,
4
,
4
,
2
>
:
unary_function
<
uint
,
uint
>
{
__device__
uint
operator
()(
uint
src
)
const
{
uint
dst
=
0
;
dst
|=
(
0xff
&
(
src
>>
16
));
dst
|=
(
0xff
&
(
src
>>
8
))
<<
8
;
dst
|=
(
0xff
&
(
src
))
<<
16
;
dst
|=
(
0xff
&
(
src
>>
24
))
<<
24
;
return
dst
;
}
};
...
...
@@ -117,10 +134,10 @@ namespace cv { namespace gpu { namespace device
#define OPENCV_GPU_IMPLEMENT_RGB2RGB_TRAITS(name, scn, dcn, bidx) \
template
<
typename
T
>
struct
name
##
_traits
\
{
\
typedef
detail
::
RGB2RGB
<
typename
TypeVec
<
T
,
scn
>::
vec_type
,
typename
TypeVec
<
T
,
dcn
>::
vec_type
,
bidx
>
functor_type
;
\
typedef
detail
::
RGB2RGB
<
T
,
scn
,
dcn
,
bidx
>
functor_type
;
\
static
__host__
__device__
__forceinline__
functor_type
create_functor
()
\
{
\
return
detail
::
RGB2RGB
<
typename
TypeVec
<
T
,
scn
>::
vec_type
,
typename
TypeVec
<
T
,
dcn
>::
vec_type
,
bidx
>
();
\
return
functor_type
();
\
}
\
};
...
...
modules/gpu/test/test_imgproc.cpp
浏览文件 @
971e35f2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录