Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
c820438b
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,发现更多精彩内容 >>
提交
c820438b
编写于
4月 01, 2011
作者:
M
Maria Dimashova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
restored several tests on features2d after moving on google tests
上级
253d8c68
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
95 addition
and
41 deletion
+95
-41
modules/features2d/test/test_features2d.cpp
modules/features2d/test/test_features2d.cpp
+95
-41
未找到文件。
modules/features2d/test/test_features2d.cpp
浏览文件 @
c820438b
...
...
@@ -56,8 +56,8 @@ const string IMAGE_FILENAME = "tsukuba.png";
class
CV_FeatureDetectorTest
:
public
cvtest
::
BaseTest
{
public:
CV_FeatureDetectorTest
(
const
Ptr
<
FeatureDetector
>&
_fdetector
)
:
fdetector
(
_fdetector
)
{}
CV_FeatureDetectorTest
(
const
string
&
_name
,
const
Ptr
<
FeatureDetector
>&
_fdetector
)
:
name
(
_name
),
fdetector
(
_fdetector
)
{}
protected:
bool
isSimilarKeypoints
(
const
KeyPoint
&
p1
,
const
KeyPoint
&
p2
);
...
...
@@ -68,6 +68,7 @@ protected:
virtual
void
run
(
int
);
string
name
;
Ptr
<
FeatureDetector
>
fdetector
;
};
...
...
@@ -288,9 +289,9 @@ public:
typedef
typename
Distance
::
ValueType
ValueType
;
typedef
typename
Distance
::
ResultType
DistanceType
;
CV_DescriptorExtractorTest
(
DistanceType
_maxDist
,
const
Ptr
<
DescriptorExtractor
>&
_dextractor
,
float
_prevTime
,
CV_DescriptorExtractorTest
(
const
string
_name
,
DistanceType
_maxDist
,
const
Ptr
<
DescriptorExtractor
>&
_dextractor
,
float
_prevTime
,
Distance
d
=
Distance
()
)
:
maxDist
(
_maxDist
),
prevTime
(
_prevTime
),
dextractor
(
_dextractor
),
distance
(
d
)
{}
name
(
_name
),
maxDist
(
_maxDist
),
prevTime
(
_prevTime
),
dextractor
(
_dextractor
),
distance
(
d
)
{}
protected:
virtual
void
createDescriptorExtractor
()
{}
...
...
@@ -476,6 +477,7 @@ protected:
const
DistanceType
maxDist
;
const
float
prevTime
;
string
name
;
Ptr
<
DescriptorExtractor
>
dextractor
;
Distance
distance
;
...
...
@@ -506,8 +508,8 @@ protected:
class
CV_DescriptorMatcherTest
:
public
cvtest
::
BaseTest
{
public:
CV_DescriptorMatcherTest
(
const
Ptr
<
DescriptorMatcher
>&
_dmatcher
,
float
_badPart
)
:
badPart
(
_badPart
),
dmatcher
(
_dmatcher
)
CV_DescriptorMatcherTest
(
const
string
&
_name
,
const
Ptr
<
DescriptorMatcher
>&
_dmatcher
,
float
_badPart
)
:
name
(
_name
),
badPart
(
_badPart
),
dmatcher
(
_dmatcher
)
{}
protected:
static
const
int
dim
=
500
;
...
...
@@ -523,7 +525,9 @@ protected:
void
knnMatchTest
(
const
Mat
&
query
,
const
Mat
&
train
);
void
radiusMatchTest
(
const
Mat
&
query
,
const
Mat
&
train
);
string
name
;
Ptr
<
DescriptorMatcher
>
dmatcher
;
private:
CV_DescriptorMatcherTest
&
operator
=
(
const
CV_DescriptorMatcherTest
&
)
{
return
*
this
;
}
};
...
...
@@ -953,86 +957,136 @@ void CV_DescriptorMatcherTest::run( int )
* Tests registrations *
\****************************************************************************************/
/****************************************************************************************\
* Tests registrations *
\****************************************************************************************/
/*
* Detectors
* "detector-fast, detector-gftt, detector-harris, detector-mser, detector-sift, detector-star, detector-surf, detector-grid-fast, detector-pyramid-fast"
*/
/*CV_FeatureDetectorTest fastTest( "detector-fast", FeatureDetector::create("FAST") );
CV_FeatureDetectorTest gfttTest( "detector-gftt", FeatureDetector::create("GFTT") );
CV_FeatureDetectorTest harrisTest( "detector-harris", FeatureDetector::create("HARRIS") );
CV_FeatureDetectorTest mserTest( "detector-mser", FeatureDetector::create("MSER") );
CV_FeatureDetectorTest siftTest( "detector-sift", FeatureDetector::create("SIFT") );
CV_FeatureDetectorTest starTest( "detector-star", FeatureDetector::create("STAR") );
CV_FeatureDetectorTest surfTest( "detector-surf", FeatureDetector::create("SURF") );
CV_FeatureDetectorTest gridFastfTest( "detector-grid-fast", FeatureDetector::create("GridFAST") );
CV_FeatureDetectorTest pyramidFastTest( "detector-pyramid-fast", FeatureDetector::create("PyramidFAST") );*/
TEST
(
Features2d_Detector_FAST
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-fast"
,
FeatureDetector
::
create
(
"FAST"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_GFTT
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-gftt"
,
FeatureDetector
::
create
(
"GFTT"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_Harris
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-harris"
,
FeatureDetector
::
create
(
"HARRIS"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_MSER
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-mser"
,
FeatureDetector
::
create
(
"MSER"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_SIFT
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-sift"
,
FeatureDetector
::
create
(
"SIFT"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_STAR
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-star"
,
FeatureDetector
::
create
(
"STAR"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_SURF
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-surf"
,
FeatureDetector
::
create
(
"SURF"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_GridFAST
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-grid-fast"
,
FeatureDetector
::
create
(
"GridFAST"
)
);
test
.
safe_run
();
}
TEST
(
Features2d_Detector_PyramidFAST
,
regression
)
{
CV_FeatureDetectorTest
test
(
"detector-pyramid-fast"
,
FeatureDetector
::
create
(
"PyramidFAST"
)
);
test
.
safe_run
();
}
/*
* Descriptors
* "descriptor-sift, descriptor-surf, descriptor-calonder-uchar, descriptor-calonder-float, descriptor-brief, descriptor-opponent-sift, descriptor-opponent-surf"
*/
TEST
(
Features2d_Descriptor_SIFT
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_SIFT
,
regression
)
{
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
0.03
f
,
DescriptorExtractor
::
create
(
"SIFT"
),
8.06652
f
);
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
"descriptor-sift"
,
0.03
f
,
DescriptorExtractor
::
create
(
"SIFT"
),
8.06652
f
);
test
.
safe_run
();
}
TEST
(
Features2d_Descriptor_SURF
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_SURF
,
regression
)
{
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
0.035
f
,
DescriptorExtractor
::
create
(
"SURF"
),
0.147372
f
);
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
"descriptor-surf"
,
0.035
f
,
DescriptorExtractor
::
create
(
"SURF"
),
0.147372
f
);
test
.
safe_run
();
}
TEST
(
Features2d_Descriptor_BRIEF
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_BRIEF
,
regression
)
{
CV_DescriptorExtractorTest
<
Hamming
>
test
(
1
,
DescriptorExtractor
::
create
(
"BRIEF"
),
0.00527548
f
);
CV_DescriptorExtractorTest
<
Hamming
>
test
(
"descriptor-brief"
,
1
,
DescriptorExtractor
::
create
(
"BRIEF"
),
0.00527548
f
);
test
.
safe_run
();
}
TEST
(
Features2d_Descriptor_OpponentSIFT
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_OpponentSIFT
,
regression
)
{
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
0.18
f
,
DescriptorExtractor
::
create
(
"OpponentSIFT"
),
8.06652
f
);
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
"descriptor-opponent-sift"
,
0.18
f
,
DescriptorExtractor
::
create
(
"OpponentSIFT"
),
8.06652
f
);
test
.
safe_run
();
}
TEST
(
Features2d_Descriptor_OpponentSURF
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_OpponentSURF
,
regression
)
{
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
0.18
f
,
DescriptorExtractor
::
create
(
"OpponentSURF"
),
0.147372
f
);
CV_DescriptorExtractorTest
<
L2
<
float
>
>
test
(
"descriptor-opponent-surf"
,
0.18
f
,
DescriptorExtractor
::
create
(
"OpponentSURF"
),
0.147372
f
);
test
.
safe_run
();
}
#if CV_SSE2
TEST
(
Features2d_Descriptor_Calonder_uchar
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_Calonder_uchar
,
regression
)
{
CV_CalonderDescriptorExtractorTest
<
uchar
,
L2
<
uchar
>
>
test
(
std
::
numeric_limits
<
float
>::
epsilon
()
+
1
,
0.0132175
f
);
CV_CalonderDescriptorExtractorTest
<
uchar
,
L2
<
uchar
>
>
test
(
"descriptor-calonder-uchar"
,
std
::
numeric_limits
<
float
>::
epsilon
()
+
1
,
0.0132175
f
);
test
.
safe_run
();
}
TEST
(
Features2d_Descriptor_Calonder_float
,
regression
)
TEST
(
Features2d_Descriptor
Extractor
_Calonder_float
,
regression
)
{
CV_CalonderDescriptorExtractorTest
<
float
,
L2
<
float
>
>
test
(
std
::
numeric_limits
<
float
>::
epsilon
(),
0.0221308
f
);
CV_CalonderDescriptorExtractorTest
<
float
,
L2
<
float
>
>
test
(
"descriptor-calonder-float"
,
std
::
numeric_limits
<
float
>::
epsilon
(),
0.0221308
f
);
test
.
safe_run
();
}
#endif // CV_SSE2
/*
* Matchers
* "descriptor-matcher-brute-force, descriptor-matcher-flann-based"
*/
TEST
(
Features2d_DescriptorMatcher_BruteForce
_L2
,
accuracy
)
TEST
(
Features2d_DescriptorMatcher_BruteForce
,
regression
)
{
CV_DescriptorMatcherTest
test
(
new
BruteForceMatcher
<
L2
<
float
>
>
,
0.01
f
);
CV_DescriptorMatcherTest
test
(
"descriptor-matcher-brute-force"
,
new
BruteForceMatcher
<
L2
<
float
>
>
,
0.01
f
);
test
.
safe_run
();
}
TEST
(
Features2d_DescriptorMatcher_F
LANN
,
accuracy
)
TEST
(
Features2d_DescriptorMatcher_F
lannBased
,
regression
)
{
CV_DescriptorMatcherTest
test
(
new
FlannBasedMatcher
,
0.04
f
);
CV_DescriptorMatcherTest
test
(
"descriptor-matcher-flann-based"
,
new
FlannBasedMatcher
,
0.04
f
);
test
.
safe_run
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录