Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
cd28d5d8
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,发现更多精彩内容 >>
提交
cd28d5d8
编写于
8月 16, 2010
作者:
M
Maria Dimashova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
1ac097ce
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
63 addition
and
82 deletion
+63
-82
modules/features2d/include/opencv2/features2d/features2d.hpp
modules/features2d/include/opencv2/features2d/features2d.hpp
+3
-81
modules/features2d/src/descriptors.cpp
modules/features2d/src/descriptors.cpp
+60
-1
未找到文件。
modules/features2d/include/opencv2/features2d/features2d.hpp
浏览文件 @
cd28d5d8
...
...
@@ -1583,7 +1583,7 @@ struct CV_EXPORTS L1
/*
* Struct for matching: match index and distance between descriptors
*/
struct
DMatch
struct
CV_EXPORTS
DMatch
{
int
indexTrain
;
int
indexQuery
;
...
...
@@ -1683,25 +1683,6 @@ public:
void
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
vector
<
DMatch
>
>&
matches
,
float
threshold
)
const
;
/*
* Find the best keypoint matches for small view changes.
*
* This function will only match descriptors whose keypoints have close enough
* image coordinates.
*
* keypoints_1 The first set of keypoints.
* descriptors_1 The first set of descriptors.
* keypoints_2 The second set of keypoints.
* descriptors_2 The second set of descriptors.
* maxDeltaX The maximum horizontal displacement.
* maxDeltaY The maximum vertical displacement.
* matches The matches between both sets.
*/
/*void matchWindowed( const vector<KeyPoint>& keypoints_1, const Mat& descriptors_1,
const vector<KeyPoint>& keypoints_2, const Mat& descriptors_2,
float maxDeltaX, float maxDeltaY, vector<Match>& matches) const;*/
virtual
void
clear
();
protected:
...
...
@@ -1728,64 +1709,6 @@ protected:
}
};
inline
void
DescriptorMatcher
::
add
(
const
Mat
&
descriptors
)
{
if
(
train
.
empty
()
)
{
train
=
descriptors
;
}
else
{
// merge train and descriptors
Mat
m
(
train
.
rows
+
descriptors
.
rows
,
train
.
cols
,
CV_32F
);
Mat
m1
=
m
.
rowRange
(
0
,
train
.
rows
);
train
.
copyTo
(
m1
);
Mat
m2
=
m
.
rowRange
(
train
.
rows
+
1
,
m
.
rows
);
descriptors
.
copyTo
(
m2
);
train
=
m
;
}
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
int
>&
matches
)
const
{
matchImpl
(
query
,
Mat
(),
matches
);
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
int
>&
matches
)
const
{
matchImpl
(
query
,
mask
,
matches
);
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
DMatch
>&
matches
)
const
{
matchImpl
(
query
,
Mat
(),
matches
);
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
DMatch
>&
matches
)
const
{
matchImpl
(
query
,
mask
,
matches
);
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
vector
<
DMatch
>
>&
matches
,
float
threshold
)
const
{
matchImpl
(
query
,
Mat
(),
matches
,
threshold
);
}
inline
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
vector
<
DMatch
>
>&
matches
,
float
threshold
)
const
{
matchImpl
(
query
,
mask
,
matches
,
threshold
);
}
inline
void
DescriptorMatcher
::
clear
()
{
train
.
release
();
}
/*
* Brute-force descriptor matcher.
*
...
...
@@ -1912,7 +1835,6 @@ void BruteForceMatcher<Distance>::matchImpl( const Mat& query, const Mat& mask,
template
<
>
void
BruteForceMatcher
<
L2
<
float
>
>::
matchImpl
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
DMatch
>&
matches
)
const
;
//void BruteForceMatcher<L2<float> >::matchImpl( const Mat& query, const Mat& mask, vector<int>& matches ) const;
CV_EXPORTS
Ptr
<
DescriptorMatcher
>
createDescriptorMatcher
(
const
string
&
descriptorMatcherType
);
...
...
@@ -2129,7 +2051,7 @@ public:
virtual
void
classify
(
const
Mat
&
image
,
vector
<
KeyPoint
>&
keypoints
);
virtual
void
clear
();
virtual
void
clear
();
virtual
void
read
(
const
FileNode
&
fn
);
...
...
@@ -2160,7 +2082,7 @@ public:
VectorDescriptorMatch
(
const
Ptr
<
DescriptorExtractor
>&
_extractor
,
const
Ptr
<
DescriptorMatcher
>&
_matcher
)
:
extractor
(
_extractor
),
matcher
(
_matcher
)
{}
~
VectorDescriptorMatch
()
{}
virtual
~
VectorDescriptorMatch
()
{}
// Builds flann index
void
index
();
...
...
modules/features2d/src/descriptors.cpp
浏览文件 @
cd28d5d8
...
...
@@ -427,8 +427,67 @@ Ptr<DescriptorMatcher> createDescriptorMatcher( const string& descriptorMatcherT
}
/****************************************************************************************\
*
BruteForceMatcher L2 specialization
*
*
DescriptorMatcher
*
\****************************************************************************************/
void
DescriptorMatcher
::
add
(
const
Mat
&
descriptors
)
{
if
(
train
.
empty
()
)
{
train
=
descriptors
;
}
else
{
// merge train and descriptors
Mat
m
(
train
.
rows
+
descriptors
.
rows
,
train
.
cols
,
CV_32F
);
Mat
m1
=
m
.
rowRange
(
0
,
train
.
rows
);
train
.
copyTo
(
m1
);
Mat
m2
=
m
.
rowRange
(
train
.
rows
+
1
,
m
.
rows
);
descriptors
.
copyTo
(
m2
);
train
=
m
;
}
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
int
>&
matches
)
const
{
matchImpl
(
query
,
Mat
(),
matches
);
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
int
>&
matches
)
const
{
matchImpl
(
query
,
mask
,
matches
);
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
DMatch
>&
matches
)
const
{
matchImpl
(
query
,
Mat
(),
matches
);
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
DMatch
>&
matches
)
const
{
matchImpl
(
query
,
mask
,
matches
);
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
vector
<
vector
<
DMatch
>
>&
matches
,
float
threshold
)
const
{
matchImpl
(
query
,
Mat
(),
matches
,
threshold
);
}
void
DescriptorMatcher
::
match
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
vector
<
DMatch
>
>&
matches
,
float
threshold
)
const
{
matchImpl
(
query
,
mask
,
matches
,
threshold
);
}
void
DescriptorMatcher
::
clear
()
{
train
.
release
();
}
/*
* BruteForceMatcher L2 specialization
*/
template
<
>
void
BruteForceMatcher
<
L2
<
float
>
>::
matchImpl
(
const
Mat
&
query
,
const
Mat
&
mask
,
vector
<
DMatch
>&
matches
)
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录