Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
82d3efc6
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,发现更多精彩内容 >>
提交
82d3efc6
编写于
1月 13, 2014
作者:
I
Ilya Lavrenov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added perf test for cv::Canny
上级
30b5234e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
82 addition
and
39 deletion
+82
-39
modules/imgproc/perf/opencl/perf_filters.cpp
modules/imgproc/perf/opencl/perf_filters.cpp
+32
-29
modules/imgproc/perf/opencl/perf_imgproc.cpp
modules/imgproc/perf/opencl/perf_imgproc.cpp
+27
-1
modules/ts/include/opencv2/ts/ocl_perf.hpp
modules/ts/include/opencv2/ts/ocl_perf.hpp
+23
-9
未找到文件。
modules/imgproc/perf/opencl/perf_filters.cpp
浏览文件 @
82d3efc6
...
...
@@ -52,16 +52,19 @@
namespace
cvtest
{
namespace
ocl
{
typedef
tuple
<
Size
,
MatType
,
int
>
FilterParams
;
typedef
TestBaseWithParam
<
FilterParams
>
FilterFixture
;
///////////// Blur ////////////////////////
typedef
Size_MatTyp
e
BlurFixture
;
typedef
FilterFixtur
e
BlurFixture
;
OCL_PERF_TEST_P
(
BlurFixture
,
Blur
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
)
,
ksize
(
3
,
3
)
;
const
int
type
=
get
<
1
>
(
params
),
bordertype
=
BORDER_CONSTANT
;
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
),
bordertype
=
BORDER_CONSTANT
;
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
1
:
1e-5
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -69,21 +72,21 @@ OCL_PERF_TEST_P(BlurFixture, Blur,
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
OCL_TEST_CYCLE
()
cv
::
blur
(
src
,
dst
,
ksize
,
Point
(
-
1
,
-
1
),
bordertype
);
OCL_TEST_CYCLE
()
cv
::
blur
(
src
,
dst
,
Size
(
ksize
,
ksize
)
,
Point
(
-
1
,
-
1
),
bordertype
);
SANITY_CHECK
(
dst
,
eps
);
}
///////////// Laplacian////////////////////////
typedef
Size_MatTyp
e
LaplacianFixture
;
typedef
FilterFixtur
e
LaplacianFixture
;
OCL_PERF_TEST_P
(
LaplacianFixture
,
Laplacian
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
3
;
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
)
;
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
1
:
1e-5
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -98,14 +101,14 @@ OCL_PERF_TEST_P(LaplacianFixture, Laplacian,
///////////// Erode ////////////////////
typedef
Size_MatTyp
e
ErodeFixture
;
typedef
FilterFixtur
e
ErodeFixture
;
OCL_PERF_TEST_P
(
ErodeFixture
,
Erode
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
3
;
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
)
;
const
Mat
ker
=
getStructuringElement
(
MORPH_RECT
,
Size
(
ksize
,
ksize
));
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -120,14 +123,14 @@ OCL_PERF_TEST_P(ErodeFixture, Erode,
///////////// Dilate ////////////////////
typedef
Size_MatTyp
e
DilateFixture
;
typedef
FilterFixtur
e
DilateFixture
;
OCL_PERF_TEST_P
(
DilateFixture
,
Dilate
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
3
;
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
)
;
const
Mat
ker
=
getStructuringElement
(
MORPH_RECT
,
Size
(
ksize
,
ksize
));
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -144,15 +147,15 @@ OCL_PERF_TEST_P(DilateFixture, Dilate,
CV_ENUM
(
MorphOp
,
MORPH_OPEN
,
MORPH_CLOSE
,
MORPH_GRADIENT
,
MORPH_TOPHAT
,
MORPH_BLACKHAT
)
typedef
tuple
<
Size
,
MatType
,
MorphOp
>
MorphologyExParams
;
typedef
tuple
<
Size
,
MatType
,
MorphOp
,
int
>
MorphologyExParams
;
typedef
TestBaseWithParam
<
MorphologyExParams
>
MorphologyExFixture
;
OCL_PERF_TEST_P
(
MorphologyExFixture
,
MorphologyEx
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
MorphOp
::
all
()))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
MorphOp
::
all
()
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
MorphologyExParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
op
=
get
<
2
>
(
params
),
ksize
=
3
;
const
int
type
=
get
<
1
>
(
params
),
op
=
get
<
2
>
(
params
),
ksize
=
get
<
3
>
(
params
)
;
const
Mat
ker
=
getStructuringElement
(
MORPH_RECT
,
Size
(
ksize
,
ksize
));
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -210,14 +213,14 @@ OCL_PERF_TEST_P(ScharrFixture, Scharr,
///////////// GaussianBlur ////////////////////////
typedef
Size_MatTyp
e
GaussianBlurFixture
;
typedef
FilterFixtur
e
GaussianBlurFixture
;
OCL_PERF_TEST_P
(
GaussianBlurFixture
,
GaussianBlur
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
,
7
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
7
;
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
)
;
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
1
+
DBL_EPSILON
:
3e-4
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
@@ -232,14 +235,14 @@ OCL_PERF_TEST_P(GaussianBlurFixture, GaussianBlur,
///////////// Filter2D ////////////////////////
typedef
Size_MatTyp
e
Filter2DFixture
;
typedef
FilterFixtur
e
Filter2DFixture
;
OCL_PERF_TEST_P
(
Filter2DFixture
,
Filter2D
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
))
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_TEST_TYPES
,
OCL_PERF_ENUM
(
3
,
5
)
))
{
const
Size_MatType_t
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
3
;
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
)
;
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
1
:
1e-5
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
...
...
modules/imgproc/perf/opencl/perf_imgproc.cpp
浏览文件 @
82d3efc6
...
...
@@ -132,7 +132,7 @@ OCL_PERF_TEST_P(CornerHarrisFixture, CornerHarris,
OCL_TEST_CYCLE
()
cv
::
cornerHarris
(
src
,
dst
,
5
,
7
,
0.1
,
borderType
);
SANITY_CHECK
(
dst
,
3
e-5
);
SANITY_CHECK
(
dst
,
5
e-5
);
}
///////////// Integral ////////////////////////
...
...
@@ -212,6 +212,32 @@ OCL_PERF_TEST_P(SqrBoxFilterFixture, SqrBoxFilter, OCL_TEST_SIZES)
SANITY_CHECK
(
dst
);
}
///////////// Canny ////////////////////////
typedef
tuple
<
int
,
bool
>
CannyParams
;
typedef
TestBaseWithParam
<
CannyParams
>
CannyFixture
;
OCL_PERF_TEST_P
(
CannyFixture
,
Canny
,
::
testing
::
Combine
(
OCL_PERF_ENUM
(
3
,
5
),
Bool
()))
{
const
CannyParams
params
=
GetParam
();
int
apertureSize
=
get
<
0
>
(
params
);
bool
L2Grad
=
get
<
1
>
(
params
);
Mat
_img
=
imread
(
getDataPath
(
"gpu/stereobm/aloe-L.png"
),
cv
::
IMREAD_GRAYSCALE
);
ASSERT_TRUE
(
!
_img
.
empty
())
<<
"can't open aloe-L.png"
;
UMat
img
;
_img
.
copyTo
(
img
);
UMat
edges
(
img
.
size
(),
CV_8UC1
);
declare
.
in
(
img
,
WARMUP_RNG
).
out
(
edges
);
OCL_TEST_CYCLE
()
cv
::
Canny
(
img
,
edges
,
50.0
,
100.0
,
apertureSize
,
L2Grad
);
SANITY_CHECK
(
edges
);
}
}
}
// namespace cvtest::ocl
#endif // HAVE_OPENCL
modules/ts/include/opencv2/ts/ocl_perf.hpp
浏览文件 @
82d3efc6
...
...
@@ -57,19 +57,33 @@ using std::tr1::tuple;
#define OCL_PERF_STRATEGY PERF_STRATEGY_SIMPLE
#define OCL_PERF_TEST(fixture, name) SIMPLE_PERF_TEST(fixture, name)
#define OCL_PERF_TEST_P(fixture, name, params) SIMPLE_PERF_TEST_P(fixture, name, params)
#define SIMPLE_PERF_TEST_P(fixture, name, params)\
class OCL##_##fixture##_##name : public fixture {\
public:\
OCL##_##fixture##_##name() {}\
protected:\
virtual void PerfTestBody();\
};\
TEST_P(OCL##_##fixture##_##name, name){ declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); }\
INSTANTIATE_TEST_CASE_P(
/*none*/
, OCL##_##fixture##_##name, params);\
#define SIMPLE_PERF_TEST(fixture, name) \
class OCL##_##fixture##_##name : \
public ::perf::TestBase \
{ \
public: \
OCL##_##fixture##_##name() { } \
protected: \
virtual void PerfTestBody(); \
}; \
TEST_F(OCL##_##fixture##_##name, name) { declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
void OCL##_##fixture##_##name::PerfTestBody()
#define SIMPLE_PERF_TEST_P(fixture, name, params) \
class OCL##_##fixture##_##name : \
public fixture \
{ \
public: \
OCL##_##fixture##_##name() { } \
protected: \
virtual void PerfTestBody(); \
}; \
TEST_P(OCL##_##fixture##_##name, name) { declare.strategy(OCL_PERF_STRATEGY); RunPerfTestBody(); } \
INSTANTIATE_TEST_CASE_P(
/*none*/
, OCL##_##fixture##_##name, params); \
void OCL##_##fixture##_##name::PerfTestBody()
#define OCL_SIZE_1 szVGA
#define OCL_SIZE_2 sz720p
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录