Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2df096c1
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,发现更多精彩内容 >>
提交
2df096c1
编写于
6月 02, 2011
作者:
A
Andrey Morozov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
converted drawing tests to the format of google test system
上级
c8f0147a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
24 deletion
+23
-24
modules/highgui/test/test_drawing.cpp
modules/highgui/test/test_drawing.cpp
+23
-24
未找到文件。
modules/highgui/test/test_drawing.cpp
浏览文件 @
2df096c1
...
@@ -40,17 +40,16 @@
...
@@ -40,17 +40,16 @@
//M*/
//M*/
#include "test_precomp.hpp"
#include "test_precomp.hpp"
#include "opencv2/highgui/highgui.hpp"
#if 0
using
namespace
cv
;
using
namespace
cv
;
//#define DRAW_TEST_IMAGE
//#define DRAW_TEST_IMAGE
class CV_DrawingTest : public
Cv
Test
class
CV_DrawingTest
:
public
cvtest
::
Base
Test
{
{
public:
public:
CV_DrawingTest( const char* testName )
: CvTest( testName, "drawing funcs" )
{}
CV_DrawingTest
(
const
char
*
testName
){}
protected:
protected:
void
run
(
int
);
void
run
(
int
);
virtual
void
draw
(
Mat
&
img
)
=
0
;
virtual
void
draw
(
Mat
&
img
)
=
0
;
...
@@ -59,7 +58,6 @@ protected:
...
@@ -59,7 +58,6 @@ protected:
void
CV_DrawingTest
::
run
(
int
)
void
CV_DrawingTest
::
run
(
int
)
{
{
int code = CvTS::OK;
Mat
testImg
,
valImg
;
Mat
testImg
,
valImg
;
const
string
name
=
"drawing/image.jpg"
;
const
string
name
=
"drawing/image.jpg"
;
string
path
=
ts
->
get_data_path
(),
filename
;
string
path
=
ts
->
get_data_path
(),
filename
;
...
@@ -73,8 +71,8 @@ void CV_DrawingTest::run( int )
...
@@ -73,8 +71,8 @@ void CV_DrawingTest::run( int )
valImg
=
imread
(
filename
);
valImg
=
imread
(
filename
);
if
(
valImg
.
empty
()
)
if
(
valImg
.
empty
()
)
{
{
ts->printf(
CvTS::
LOG, "test image can not be read");
ts
->
printf
(
ts
->
LOG
,
"test image can not be read"
);
code = CvTS::FAIL_INVALID_TEST_DATA
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
)
;
}
}
else
else
{
{
...
@@ -82,22 +80,22 @@ void CV_DrawingTest::run( int )
...
@@ -82,22 +80,22 @@ void CV_DrawingTest::run( int )
float
Eps
=
0.9
f
;
float
Eps
=
0.9
f
;
if
(
err
>
Eps
)
if
(
err
>
Eps
)
{
{
ts->printf(
CvTS::
LOG, "CV_RELATIVE_L1 between testImg and valImg is equal %f (larger than %f)\n", err, Eps );
ts
->
printf
(
ts
->
LOG
,
"CV_RELATIVE_L1 between testImg and valImg is equal %f (larger than %f)
\n
"
,
err
,
Eps
);
code = CvTS::FAIL_BAD_ACCURACY
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
)
;
}
}
else
else
{
{
code = checkLineIterator( testImg
);
ts
->
set_failed_test_info
(
checkLineIterator
(
testImg
)
);
}
}
}
}
#endif
#endif
ts
->
set_failed_test_info
(
code
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
}
}
class
CV_DrawingTest_CPP
:
public
CV_Drawing
Test
class
CV_DrawingTest_CPP
:
public
cvtest
::
Base
Test
{
{
public:
public:
CV_DrawingTest_CPP
()
:
CV_DrawingTest
(
"drawing_cpp"
)
{}
CV_DrawingTest_CPP
()
{}
protected:
protected:
virtual
void
draw
(
Mat
&
img
);
virtual
void
draw
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
...
@@ -235,17 +233,18 @@ int CV_DrawingTest_CPP::checkLineIterator( Mat& img )
...
@@ -235,17 +233,18 @@ int CV_DrawingTest_CPP::checkLineIterator( Mat& img )
float
err
=
(
float
)
norm
(
v
);
float
err
=
(
float
)
norm
(
v
);
if
(
err
!=
0
)
if
(
err
!=
0
)
{
{
ts
->
printf
(
CvTS
::
LOG
,
"LineIterator works incorrect"
);
ts
->
printf
(
ts
->
LOG
,
"LineIterator works incorrect"
);
return
CvTS
::
FAIL_INVALID_OUTPUT
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
)
;
}
}
}
}
return
CvTS
::
OK
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
return
0
;
}
}
class
CV_DrawingTest_C
:
public
CV_Drawing
Test
class
CV_DrawingTest_C
:
public
cvtest
::
Base
Test
{
{
public:
public:
CV_DrawingTest_C
()
:
CV_DrawingTest
(
"drawing_c"
)
{}
CV_DrawingTest_C
()
{}
protected:
protected:
virtual
void
draw
(
Mat
&
img
);
virtual
void
draw
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
...
@@ -400,15 +399,15 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img )
...
@@ -400,15 +399,15 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img )
float
err
=
(
float
)
norm
(
v
);
float
err
=
(
float
)
norm
(
v
);
if
(
err
!=
0
)
if
(
err
!=
0
)
{
{
ts
->
printf
(
CvTS
::
LOG
,
"CvLineIterator works incorrect"
);
ts
->
printf
(
ts
->
LOG
,
"CvLineIterator works incorrect"
);
return
CvTS
::
FAIL_INVALID_OUTPUT
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
)
;
}
}
CV_NEXT_LINE_POINT
(
it
);
CV_NEXT_LINE_POINT
(
it
);
}
}
return
CvTS
::
OK
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
return
0
;
}
}
CV_DrawingTest_CPP
drawing_test_cpp
;
TEST
(
Highgui_Drawing_CPP
,
regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
CV_DrawingTest_C
drawing_test_c
;
TEST
(
Highgui_Drawing_C
,
regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录