Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
33ae6420
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,发现更多精彩内容 >>
提交
33ae6420
编写于
11月 09, 2013
作者:
I
Ilya Lavrenov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
color.cpp refactoring: created generic interface for toRGB and fromRGB callers
上级
a57030a0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
135 deletion
+28
-135
modules/ocl/src/color.cpp
modules/ocl/src/color.cpp
+15
-127
modules/ocl/src/opencl/cvt_color.cl
modules/ocl/src/opencl/cvt_color.cl
+7
-7
modules/ocl/test/test_color.cpp
modules/ocl/test/test_color.cpp
+6
-1
未找到文件。
modules/ocl/src/color.cpp
浏览文件 @
33ae6420
...
...
@@ -50,7 +50,7 @@
using
namespace
cv
;
using
namespace
cv
::
ocl
;
static
void
RGB2Gray_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
static
void
fromRGB_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
,
const
std
::
string
&
kernelName
)
{
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
...
...
@@ -58,8 +58,8 @@ static void RGB2Gray_caller(const oclMat &src, oclMat &dst, int bidx)
std
::
string
build_options
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
bidx
));
...
...
@@ -68,11 +68,11 @@ static void RGB2Gray_caller(const oclMat &src, oclMat &dst, int bidx)
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"RGB2Gray"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
size_t
gt
[
3
]
=
{
dst
.
cols
,
dst
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
kernelName
.
c_str
()
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
}
static
void
Gray2RGB_caller
(
const
oclMat
&
src
,
oclMat
&
dst
)
static
void
toRGB_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
,
const
std
::
string
&
kernelName
)
{
int
channels
=
dst
.
channels
();
std
::
string
build_options
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
...
...
@@ -80,99 +80,8 @@ static void Gray2RGB_caller(const oclMat &src, oclMat &dst)
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
channels
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
dst
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"Gray2RGB"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
}
static
void
RGB2YUV_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
{
std
::
string
build_options
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
bidx
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
dst
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"RGB2YUV"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
}
static
void
YUV2RGB_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
{
int
channels
=
dst
.
channels
();
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
std
::
string
buildOptions
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
channels
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
bidx
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
dst
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"YUV2RGB"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
buildOptions
.
c_str
());
}
static
void
YUV2RGB_NV12_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
{
std
::
string
build_options
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
bidx
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
dst
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
dst
.
cols
/
2
,
dst
.
rows
/
2
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"YUV2RGBA_NV12"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
}
static
void
YCrCb2RGB_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
{
int
channels
=
dst
.
channels
();
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
std
::
string
buildOptions
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
channels
));
...
...
@@ -182,29 +91,8 @@ static void YCrCb2RGB_caller(const oclMat &src, oclMat &dst, int bidx)
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"YCrCb2RGB"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
buildOptions
.
c_str
());
}
static
void
RGB2YCrCb_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
bidx
)
{
std
::
string
build_options
=
format
(
"-D DEPTH_%d"
,
src
.
depth
());
int
src_offset
=
src
.
offset
/
src
.
elemSize1
(),
src_step
=
src
.
step1
();
int
dst_offset
=
dst
.
offset
/
dst
.
elemSize1
(),
dst_step
=
dst
.
step1
();
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
bidx
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
dst
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
dst_offset
));
size_t
gt
[
3
]
=
{
src
.
cols
,
src
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
"RGB2YCrCb"
,
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
size_t
gt
[
3
]
=
{
dst
.
cols
,
dst
.
rows
,
1
},
lt
[
3
]
=
{
16
,
16
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
cvt_color
,
kernelName
.
c_str
(),
gt
,
lt
,
args
,
-
1
,
-
1
,
build_options
.
c_str
());
}
static
void
cvtColor_caller
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
code
,
int
dcn
)
...
...
@@ -232,7 +120,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
3
||
scn
==
4
);
bidx
=
code
==
CV_BGR2GRAY
||
code
==
CV_BGRA2GRAY
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
1
));
RGB2Gray_caller
(
src
,
dst
,
bidx
);
fromRGB_caller
(
src
,
dst
,
bidx
,
"RGB2Gray"
);
break
;
}
case
CV_GRAY2BGR
:
...
...
@@ -241,7 +129,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
1
);
dcn
=
code
==
CV_GRAY2BGRA
?
4
:
3
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
dcn
));
Gray2RGB_caller
(
src
,
dst
);
toRGB_caller
(
src
,
dst
,
0
,
"Gray2RGB"
);
break
;
}
case
CV_BGR2YUV
:
...
...
@@ -250,7 +138,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
3
||
scn
==
4
);
bidx
=
code
==
CV_BGR2YUV
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
3
));
RGB2YUV_caller
(
src
,
dst
,
bidx
);
fromRGB_caller
(
src
,
dst
,
bidx
,
"RGB2YUV"
);
break
;
}
case
CV_YUV2BGR
:
...
...
@@ -261,7 +149,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
3
&&
(
dcn
==
3
||
dcn
==
4
));
bidx
=
code
==
CV_YUV2BGR
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
dcn
));
YUV2RGB_caller
(
src
,
dst
,
bidx
);
toRGB_caller
(
src
,
dst
,
bidx
,
"YUV2RGB"
);
break
;
}
case
CV_YUV2RGB_NV12
:
...
...
@@ -276,7 +164,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
Size
dstSz
(
sz
.
width
,
sz
.
height
*
2
/
3
);
dst
.
create
(
dstSz
,
CV_MAKETYPE
(
depth
,
dcn
));
YUV2RGB_NV12_caller
(
src
,
dst
,
bidx
);
toRGB_caller
(
src
,
dst
,
bidx
,
"YUV2RGBA_NV12"
);
break
;
}
case
CV_BGR2YCrCb
:
...
...
@@ -285,7 +173,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
3
||
scn
==
4
);
bidx
=
code
==
CV_BGR2YCrCb
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
3
));
RGB2YCrCb_caller
(
src
,
dst
,
bidx
);
fromRGB_caller
(
src
,
dst
,
bidx
,
"RGB2YCrCb"
);
break
;
}
case
CV_YCrCb2BGR
:
...
...
@@ -296,7 +184,7 @@ static void cvtColor_caller(const oclMat &src, oclMat &dst, int code, int dcn)
CV_Assert
(
scn
==
3
&&
(
dcn
==
3
||
dcn
==
4
));
bidx
=
code
==
CV_YCrCb2BGR
?
0
:
2
;
dst
.
create
(
sz
,
CV_MAKETYPE
(
depth
,
dcn
));
YCrCb2RGB_caller
(
src
,
dst
,
bidx
);
toRGB_caller
(
src
,
dst
,
bidx
,
"YCrCb2RGB"
);
break
;
}
/*
...
...
modules/ocl/src/opencl/cvt_color.cl
浏览文件 @
33ae6420
...
...
@@ -100,7 +100,7 @@ __kernel void RGB2Gray(int cols, int rows, int src_step, int dst_step,
}
}
__kernel
void
Gray2RGB
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels,
__kernel
void
Gray2RGB
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels,
int
bidx,
__global
const
DATA_TYPE*
src,
__global
DATA_TYPE*
dst,
int
src_offset,
int
dst_offset
)
{
...
...
@@ -203,17 +203,17 @@ __constant int ITUR_BT_601_CVG = 852492;
__constant
int
ITUR_BT_601_CVR
=
1673527
;
__constant
int
ITUR_BT_601_SHIFT
=
20
;
__kernel
void
YUV2RGBA_NV12
(
int
cols,
int
rows,int
src_step,int
dst_step
,
int
bidx,
int
width,
int
height,
__global
const
uchar*
src,
__global
uchar*
dst,
__kernel
void
YUV2RGBA_NV12
(
int
cols,
int
rows,
int
src_step,
int
dst_step,
int
channels
,
int
bidx,
__global
const
uchar*
src,
__global
uchar*
dst,
int
src_offset,
int
dst_offset
)
{
const
int
x
=
get_global_id
(
0
)
;
// max_x = width / 2
const
int
y
=
get_global_id
(
1
)
;
// max_y = height/ 2
const
int
x
=
get_global_id
(
0
)
;
const
int
y
=
get_global_id
(
1
)
;
if
(
y
<
height
/
2
&&
x
<
width
/
2
)
if
(
y
<
rows
/
2
&&
x
<
cols
/
2
)
{
__global
const
uchar*
ysrc
=
src
+
mad24
(
y
<<
1
,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
const
uchar*
usrc
=
src
+
mad24
(
height
+
y,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
const
uchar*
usrc
=
src
+
mad24
(
rows
+
y,
src_step,
(
x
<<
1
)
+
src_offset
)
;
__global
uchar*
dst1
=
dst
+
mad24
(
y
<<
1
,
dst_step,
(
x
<<
3
)
+
dst_offset
)
;
__global
uchar*
dst2
=
dst
+
mad24
((
y
<<
1
)
+
1
,
dst_step,
(
x
<<
3
)
+
dst_offset
)
;
...
...
modules/ocl/test/test_color.cpp
浏览文件 @
33ae6420
...
...
@@ -116,6 +116,8 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool)
#define CVTCODE(name) cv::COLOR_ ## name
// RGB <-> Gray
OCL_TEST_P
(
CvtColor
,
RGB2GRAY
)
{
doTest
(
3
,
1
,
CVTCODE
(
RGB2GRAY
));
...
...
@@ -152,6 +154,7 @@ OCL_TEST_P(CvtColor, GRAY2BGRA)
doTest
(
1
,
4
,
CVTCODE
(
GRAY2BGRA
));
}
// RGB <-> YUV
OCL_TEST_P
(
CvtColor
,
RGB2YUV
)
{
...
...
@@ -186,6 +189,7 @@ OCL_TEST_P(CvtColor, YUV2BGRA)
doTest
(
3
,
4
,
CVTCODE
(
YUV2BGR
));
}
// RGB <-> YCrCb
OCL_TEST_P
(
CvtColor
,
RGB2YCrCb
)
{
...
...
@@ -220,6 +224,8 @@ OCL_TEST_P(CvtColor, YCrCb2BGRA)
doTest
(
3
,
4
,
CVTCODE
(
YCrCb2BGR
));
}
// YUV -> RGBA_NV12
struct
CvtColor_YUV420
:
public
CvtColor
{
...
...
@@ -262,7 +268,6 @@ OCL_TEST_P(CvtColor_YUV420, YUV2BGR_NV12)
doTest
(
1
,
3
,
CV_YUV2BGR_NV12
);
}
INSTANTIATE_TEST_CASE_P
(
OCL_ImgProc
,
CvtColor
,
testing
::
Combine
(
testing
::
Values
(
MatDepth
(
CV_8U
),
MatDepth
(
CV_16U
),
MatDepth
(
CV_32F
)),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录