Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
5566d314
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,发现更多精彩内容 >>
提交
5566d314
编写于
12月 10, 2013
作者:
I
Ilya Lavrenov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more strict checks outside ROI
上级
9d87f9c9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
44 deletion
+43
-44
modules/core/src/convert.cpp
modules/core/src/convert.cpp
+6
-4
modules/core/test/ocl/test_arithm.cpp
modules/core/test/ocl/test_arithm.cpp
+4
-8
modules/core/test/ocl/test_split_merge.cpp
modules/core/test/ocl/test_split_merge.cpp
+1
-2
modules/imgproc/test/ocl/test_color.cpp
modules/imgproc/test/ocl/test_color.cpp
+1
-2
modules/imgproc/test/ocl/test_imgproc.cpp
modules/imgproc/test/ocl/test_imgproc.cpp
+7
-21
modules/imgproc/test/ocl/test_warp.cpp
modules/imgproc/test/ocl/test_warp.cpp
+3
-6
modules/ts/include/opencv2/ts/ocl_test.hpp
modules/ts/include/opencv2/ts/ocl_test.hpp
+21
-1
未找到文件。
modules/core/src/convert.cpp
浏览文件 @
5566d314
...
...
@@ -1306,9 +1306,10 @@ namespace cv {
static
bool
ocl_LUT
(
InputArray
_src
,
InputArray
_lut
,
OutputArray
_dst
)
{
int
dcn
=
_dst
.
channels
(),
lcn
=
_lut
.
channels
(),
dtype
=
_dst
.
type
();
int
dtype
=
_dst
.
type
(),
lcn
=
_lut
.
channels
(),
dcn
=
CV_MAT_CN
(
dtype
),
ddepth
=
CV_MAT_DEPTH
(
dtype
);
bool
doubleSupport
=
ocl
::
Device
::
getDefault
().
doubleFPConfig
()
>
0
;
if
(
_src
.
dims
()
>
2
)
if
(
_src
.
dims
()
>
2
||
(
!
doubleSupport
&&
ddepth
==
CV_64F
)
)
return
false
;
UMat
src
=
_src
.
getUMat
(),
lut
=
_lut
.
getUMat
();
...
...
@@ -1316,8 +1317,9 @@ static bool ocl_LUT(InputArray _src, InputArray _lut, OutputArray _dst)
UMat
dst
=
_dst
.
getUMat
();
ocl
::
Kernel
k
(
"LUT"
,
ocl
::
core
::
lut_oclsrc
,
format
(
"-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s"
,
dcn
,
lcn
,
ocl
::
typeToStr
(
src
.
depth
()),
ocl
::
typeToStr
(
dst
.
depth
())));
format
(
"-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s%s"
,
dcn
,
lcn
,
ocl
::
typeToStr
(
src
.
depth
()),
ocl
::
typeToStr
(
ddepth
),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
));
k
.
args
(
ocl
::
KernelArg
::
ReadOnlyNoSize
(
src
),
ocl
::
KernelArg
::
ReadOnlyNoSize
(
lut
),
ocl
::
KernelArg
::
WriteOnly
(
dst
));
...
...
modules/core/test/ocl/test_arithm.cpp
浏览文件 @
5566d314
...
...
@@ -92,8 +92,7 @@ PARAM_TEST_CASE(Lut, MatDepth, MatDepth, Channels, bool, bool)
void
Near
(
double
threshold
=
0.
)
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
@@ -165,14 +164,12 @@ PARAM_TEST_CASE(ArithmTestBase, MatDepth, Channels, bool)
void
Near
(
double
threshold
=
0.
)
{
EXPECT_MAT_NEAR
(
dst1
,
udst1
,
threshold
);
EXPECT_MAT_NEAR
(
dst1_roi
,
udst1_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst1
,
threshold
)
}
void
Near1
(
double
threshold
=
0.
)
{
EXPECT_MAT_NEAR
(
dst2
,
udst2
,
threshold
);
EXPECT_MAT_NEAR
(
dst2_roi
,
udst2_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst2
,
threshold
)
}
};
...
...
@@ -532,8 +529,7 @@ OCL_TEST_P(Transpose, SquareInplace)
OCL_OFF
(
cv
::
transpose
(
src1_roi
,
src1_roi
));
OCL_ON
(
cv
::
transpose
(
usrc1_roi
,
usrc1_roi
));
EXPECT_MAT_NEAR
(
src1
,
usrc1
,
0.0
);
EXPECT_MAT_NEAR
(
src1_roi
,
usrc1_roi
,
0.0
);
OCL_EXPECT_MATS_NEAR
(
src1
,
0
)
}
}
...
...
modules/core/test/ocl/test_split_merge.cpp
浏览文件 @
5566d314
...
...
@@ -113,8 +113,7 @@ PARAM_TEST_CASE(MergeTestBase, MatDepth, Channels, bool)
void
Near
(
double
threshold
=
0.
)
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
);
}
};
...
...
modules/imgproc/test/ocl/test_color.cpp
浏览文件 @
5566d314
...
...
@@ -86,8 +86,7 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool)
void
Near
(
double
threshold
)
{
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
void
performTest
(
int
channelsIn
,
int
channelsOut
,
int
code
,
double
threshold
=
1e-3
)
...
...
modules/imgproc/test/ocl/test_imgproc.cpp
浏览文件 @
5566d314
...
...
@@ -97,15 +97,9 @@ PARAM_TEST_CASE(ImgprocTestBase, MatType,
void
Near
(
double
threshold
=
0.0
,
bool
relative
=
false
)
{
if
(
relative
)
{
EXPECT_MAT_NEAR_RELATIVE
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR_RELATIVE
(
dst_roi
,
udst_roi
,
threshold
);
}
OCL_EXPECT_MATS_NEAR_RELATIVE
(
dst
,
threshold
)
else
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
}
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
@@ -158,10 +152,9 @@ PARAM_TEST_CASE(CopyMakeBorder, MatDepth, // depth
UMAT_UPLOAD_OUTPUT_PARAMETER
(
dst
)
}
void
Near
(
double
threshold
=
0.0
)
void
Near
()
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
0
)
}
};
...
...
@@ -305,15 +298,9 @@ struct Integral :
void
Near2
(
double
threshold
=
0.0
,
bool
relative
=
false
)
{
if
(
relative
)
{
EXPECT_MAT_NEAR_RELATIVE
(
dst2
,
udst2
,
threshold
);
EXPECT_MAT_NEAR_RELATIVE
(
dst2_roi
,
udst2_roi
,
threshold
);
}
OCL_EXPECT_MATS_NEAR_RELATIVE
(
dst2
,
threshold
)
else
{
EXPECT_MAT_NEAR
(
dst2
,
udst2
,
threshold
);
EXPECT_MAT_NEAR
(
dst2_roi
,
udst2_roi
,
threshold
);
}
OCL_EXPECT_MATS_NEAR
(
dst2
,
threshold
)
}
};
...
...
@@ -412,8 +399,7 @@ PARAM_TEST_CASE(CLAHETest, Size, double, bool)
void
Near
(
double
threshold
=
0.0
)
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
modules/imgproc/test/ocl/test_warp.cpp
浏览文件 @
5566d314
...
...
@@ -104,8 +104,7 @@ PARAM_TEST_CASE(WarpTestBase, MatType, Interpolation, bool, bool)
void
Near
(
double
threshold
=
0.0
)
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
@@ -203,8 +202,7 @@ PARAM_TEST_CASE(Resize, MatType, double, double, Interpolation, bool)
void
Near
(
double
threshold
=
0.0
)
{
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
@@ -280,8 +278,7 @@ PARAM_TEST_CASE(Remap, MatDepth, Channels, std::pair<MatType, MatType>, BorderTy
void
Near
(
double
threshold
=
0.0
)
{
EXPECT_MAT_NEAR
(
dst
,
udst
,
threshold
);
EXPECT_MAT_NEAR
(
dst_roi
,
udst_roi
,
threshold
);
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
)
}
};
...
...
modules/ts/include/opencv2/ts/ocl_test.hpp
浏览文件 @
5566d314
...
...
@@ -110,6 +110,26 @@ extern int test_loop_times;
<< cv::format("Size: %d x %d", mat1.size().width, mat1.size().height) << std::endl; \
}
#define OCL_EXPECT_MATS_NEAR(name, eps) \
{ \
EXPECT_MAT_NEAR(name ## _roi, u ## name ## _roi, eps); \
int nextValue = rng.next(); \
RNG dataRng1(nextValue), dataRng2(nextValue); \
dataRng1.fill(name ## _roi, RNG::UNIFORM, Scalar::all(-MAX_VALUE), Scalar::all(MAX_VALUE)); \
dataRng2.fill(u ## name ## _roi, RNG::UNIFORM, Scalar::all(-MAX_VALUE), Scalar::all(MAX_VALUE)); \
EXPECT_MAT_NEAR(name, u ## name, 0
/*FLT_EPSILON*/
); \
}
#define OCL_EXPECT_MATS_NEAR_RELATIVE(name, eps) \
{ \
EXPECT_MAT_NEAR_RELATIVE(name ## _roi, u ## name ## _roi, eps); \
int nextValue = rng.next(); \
RNG dataRng1(nextValue), dataRng2(nextValue); \
dataRng1.fill(name ## _roi, RNG::UNIFORM, Scalar::all(-MAX_VALUE), Scalar::all(MAX_VALUE)); \
dataRng2.fill(u ## name ## _roi, RNG::UNIFORM, Scalar::all(-MAX_VALUE), Scalar::all(MAX_VALUE)); \
EXPECT_MAT_NEAR_RELATIVE(name, u ## name, 0
/*FLT_EPSILON*/
); \
}
#define EXPECT_MAT_SIMILAR(mat1, mat2, eps) \
{ \
ASSERT_EQ(mat1.type(), mat2.type()); \
...
...
@@ -302,7 +322,7 @@ IMPLEMENT_PARAM_CLASS(Channels, int)
#define OCL_OFF(fn) cv::ocl::setUseOpenCL(false); fn
#define OCL_ON(fn) cv::ocl::setUseOpenCL(true); fn
#define OCL_ALL_DEPTHS Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F)
#define OCL_ALL_DEPTHS Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F
, CV_64F
)
#define OCL_ALL_CHANNELS Values(1, 2, 3, 4)
CV_ENUM
(
Interpolation
,
INTER_NEAREST
,
INTER_LINEAR
,
INTER_CUBIC
,
INTER_AREA
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录