Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ff9a0815
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
ff9a0815
编写于
2月 18, 2014
作者:
A
Andrey Pavlenko
提交者:
OpenCV Buildbot
2月 18, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2352 from ilya-lavrenov:flann
上级
24098128
6ad7b649
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
82 addition
and
72 deletion
+82
-72
modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst
...atures2d/doc/common_interfaces_of_descriptor_matchers.rst
+10
-10
modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst
.../doc/common_interfaces_of_generic_descriptor_matchers.rst
+12
-12
modules/features2d/include/opencv2/features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+19
-19
modules/features2d/src/matchers.cpp
modules/features2d/src/matchers.cpp
+29
-19
modules/features2d/src/mser.cpp
modules/features2d/src/mser.cpp
+4
-4
modules/legacy/include/opencv2/legacy.hpp
modules/legacy/include/opencv2/legacy.hpp
+4
-4
modules/legacy/src/oneway.cpp
modules/legacy/src/oneway.cpp
+2
-2
modules/legacy/src/planardetect.cpp
modules/legacy/src/planardetect.cpp
+2
-2
未找到文件。
modules/features2d/doc/common_interfaces_of_descriptor_matchers.rst
浏览文件 @
ff9a0815
...
...
@@ -28,7 +28,7 @@ with an image set. ::
public:
virtual ~DescriptorMatcher();
virtual void add( InputArray descriptors );
virtual void add( InputArray
OfArrays
descriptors );
const vector<Mat>& getTrainDescriptors() const;
virtual void clear();
...
...
@@ -44,20 +44,20 @@ with an image set. ::
vector<DMatch>& matches, InputArray mask=noArray() ) const;
void knnMatch( InputArray queryDescriptors, InputArray trainDescriptors,
vector<vector<DMatch> >& matches, int k,
InputArray mask=
Mat
(), bool compactResult=false ) const;
InputArray mask=
noArray
(), bool compactResult=false ) const;
void radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors,
vector<vector<DMatch> >& matches, float maxDistance,
InputArray mask=
Mat
(), bool compactResult=false ) const;
InputArray mask=
noArray
(), bool compactResult=false ) const;
/*
* Group of methods to match descriptors from one image to an image set.
*/
void match( InputArray queryDescriptors, vector<DMatch>& matches,
const vector<Mat>&
masks=noArray() );
InputArrayOfArrays
masks=noArray() );
void knnMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches,
int k,
const vector<Mat>& masks=vector<Mat>
(),
int k,
InputArrayOfArrays masks=noArray
(),
bool compactResult=false );
void radiusMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches,
float maxDistance,
const vector<Mat>& masks=vector<Mat>
(),
float maxDistance,
InputArrayOfArrays masks=noArray
(),
bool compactResult=false );
virtual void read( const FileNode& );
...
...
@@ -133,7 +133,7 @@ Finds the best match for each descriptor from a query set.
.. ocv:function:: void DescriptorMatcher::match( InputArray queryDescriptors, InputArray trainDescriptors, vector<DMatch>& matches, InputArray mask=noArray() ) const
.. ocv:function:: void DescriptorMatcher::match(InputArray queryDescriptors, vector<DMatch>& matches,
const vector<Mat>& masks=vector<Mat>
() )
.. ocv:function:: void DescriptorMatcher::match(InputArray queryDescriptors, vector<DMatch>& matches,
InputArrayOfArrays masks=noArray
() )
:param queryDescriptors: Query set of descriptors.
...
...
@@ -155,7 +155,7 @@ Finds the k best matches for each descriptor from a query set.
.. ocv:function:: void DescriptorMatcher::knnMatch(InputArray queryDescriptors, InputArray trainDescriptors, vector<vector<DMatch> >& matches, int k, InputArray mask=noArray(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::knnMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, int k,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false )
.. ocv:function:: void DescriptorMatcher::knnMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, int k,
InputArrayOfArrays masks=noArray
(), bool compactResult=false )
:param queryDescriptors: Query set of descriptors.
...
...
@@ -181,7 +181,7 @@ For each query descriptor, finds the training descriptors not farther than the s
.. ocv:function:: void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors, vector<vector<DMatch> >& matches, float maxDistance, InputArray mask=noArray(), bool compactResult=false ) const
.. ocv:function:: void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false )
.. ocv:function:: void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, vector<vector<DMatch> >& matches, float maxDistance,
InputArrayOfArrays masks=noArray
(), bool compactResult=false )
:param queryDescriptors: Query set of descriptors.
...
...
@@ -265,7 +265,7 @@ Flann-based descriptor matcher. This matcher trains :ocv:class:`flann::Index_` o
const Ptr<flann::IndexParams>& indexParams=new flann::KDTreeIndexParams(),
const Ptr<flann::SearchParams>& searchParams=new flann::SearchParams() );
virtual void add(
const vector<Mat>&
descriptors );
virtual void add(
InputArrayOfArrays
descriptors );
virtual void clear();
virtual void train();
...
...
modules/features2d/doc/common_interfaces_of_generic_descriptor_matchers.rst
浏览文件 @
ff9a0815
...
...
@@ -52,26 +52,26 @@ Abstract interface for extracting and matching a keypoint descriptor. There are
*/
void match( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
InputArray trainImage, vector<KeyPoint>& trainKeypoints,
vector<DMatch>& matches,
const Mat& mask=Mat
() ) const;
vector<DMatch>& matches,
InputArray mask=noArray
() ) const;
void knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
InputArray trainImage, vector<KeyPoint>& trainKeypoints,
vector<vector<DMatch> >& matches, int k,
const Mat& mask=Mat
(), bool compactResult=false ) const;
InputArray mask=noArray
(), bool compactResult=false ) const;
void radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
InputArray trainImage, vector<KeyPoint>& trainKeypoints,
vector<vector<DMatch> >& matches, float maxDistance,
const Mat& mask=Mat
(), bool compactResult=false ) const;
InputArray mask=noArray
(), bool compactResult=false ) const;
/*
* Group of methods to match keypoints from one image to an image set.
*/
void match( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
vector<DMatch>& matches,
const vector<Mat>& masks=vector<Mat>
() );
vector<DMatch>& matches,
InputArrayOfArrays masks=noArray
() );
void knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
vector<vector<DMatch> >& matches, int k,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false );
InputArrayOfArrays masks=noArray
(), bool compactResult=false );
void radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints,
vector<vector<DMatch> >& matches, float maxDistance,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false );
InputArrayOfArrays masks=noArray
(), bool compactResult=false );
virtual void read( const FileNode& );
virtual void write( FileStorage& ) const;
...
...
@@ -170,9 +170,9 @@ GenericDescriptorMatcher::match
-----------------------------------
Finds the best match in the training set for each keypoint from the query set.
.. ocv:function:: void GenericDescriptorMatcher::match(InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<DMatch>& matches,
const Mat& mask=Mat
() ) const
.. ocv:function:: void GenericDescriptorMatcher::match(InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<DMatch>& matches,
InputArray mask=noArray
() ) const
.. ocv:function:: void GenericDescriptorMatcher::match( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<DMatch>& matches,
const vector<Mat>& masks=vector<Mat>
() )
.. ocv:function:: void GenericDescriptorMatcher::match( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<DMatch>& matches,
InputArrayOfArrays masks=noArray
() )
:param queryImage: Query image.
...
...
@@ -196,9 +196,9 @@ GenericDescriptorMatcher::knnMatch
--------------------------------------
Finds the ``k`` best matches for each query keypoint.
.. ocv:function:: void GenericDescriptorMatcher::knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<vector<DMatch> >& matches, int k,
const Mat& mask=Mat
(), bool compactResult=false ) const
.. ocv:function:: void GenericDescriptorMatcher::knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<vector<DMatch> >& matches, int k,
InputArray mask=noArray
(), bool compactResult=false ) const
.. ocv:function:: void GenericDescriptorMatcher::knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<vector<DMatch> >& matches, int k,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false )
.. ocv:function:: void GenericDescriptorMatcher::knnMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<vector<DMatch> >& matches, int k,
InputArrayOfArrays masks=noArray
(), bool compactResult=false )
The methods are extended variants of ``GenericDescriptorMatch::match``. The parameters are similar, and the semantics is similar to ``DescriptorMatcher::knnMatch``. But this class does not require explicitly computed keypoint descriptors.
...
...
@@ -208,9 +208,9 @@ GenericDescriptorMatcher::radiusMatch
-----------------------------------------
For each query keypoint, finds the training keypoints not farther than the specified distance.
.. ocv:function:: void GenericDescriptorMatcher::radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<vector<DMatch> >& matches, float maxDistance,
const Mat& mask=Mat
(), bool compactResult=false ) const
.. ocv:function:: void GenericDescriptorMatcher::radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, InputArray trainImage, vector<KeyPoint>& trainKeypoints, vector<vector<DMatch> >& matches, float maxDistance,
InputArray mask=noArray
(), bool compactResult=false ) const
.. ocv:function:: void GenericDescriptorMatcher::radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<vector<DMatch> >& matches, float maxDistance,
const vector<Mat>& masks=vector<Mat>
(), bool compactResult=false )
.. ocv:function:: void GenericDescriptorMatcher::radiusMatch( InputArray queryImage, vector<KeyPoint>& queryKeypoints, vector<vector<DMatch> >& matches, float maxDistance,
InputArrayOfArrays masks=noArray
(), bool compactResult=false )
The methods are similar to ``DescriptorMatcher::radius``. But this class does not require explicitly computed keypoint descriptors.
...
...
modules/features2d/include/opencv2/features2d.hpp
浏览文件 @
ff9a0815
...
...
@@ -465,8 +465,8 @@ public:
double
_min_margin
=
0.003
,
int
_edge_blur_size
=
5
);
//! the operator that extracts the MSERs from the image or the specific part of it
CV_WRAP_AS
(
detect
)
void
operator
()(
const
Mat
&
image
,
CV_OUT
std
::
vector
<
std
::
vector
<
Point
>
>&
msers
,
const
Mat
&
mask
=
Mat
()
)
const
;
CV_WRAP_AS
(
detect
)
void
operator
()(
InputArray
image
,
CV_OUT
std
::
vector
<
std
::
vector
<
Point
>
>&
msers
,
InputArray
mask
=
noArray
()
)
const
;
AlgorithmInfo
*
info
()
const
;
protected:
...
...
@@ -1053,11 +1053,11 @@ public:
* See description of similar methods for matching image pair above.
*/
CV_WRAP
void
match
(
InputArray
queryDescriptors
,
CV_OUT
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
);
InputArrayOfArrays
masks
=
noArray
()
);
CV_WRAP
void
knnMatch
(
InputArray
queryDescriptors
,
CV_OUT
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
InputArrayOfArrays
masks
=
noArray
(),
bool
compactResult
=
false
);
void
radiusMatch
(
InputArray
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
InputArrayOfArrays
masks
=
noArray
(),
bool
compactResult
=
false
);
// Reads matcher object from a file node
virtual
void
read
(
const
FileNode
&
);
...
...
@@ -1106,11 +1106,11 @@ protected:
virtual
void
radiusMatchImpl
(
InputArray
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
InputArrayOfArrays
masks
=
noArray
(),
bool
compactResult
=
false
)
=
0
;
static
bool
isPossibleMatch
(
const
Mat
&
mask
,
int
queryIdx
,
int
trainIdx
);
static
bool
isMaskedOut
(
const
std
::
vector
<
Mat
>&
masks
,
int
queryIdx
);
static
bool
isPossibleMatch
(
InputArray
mask
,
int
queryIdx
,
int
trainIdx
);
static
bool
isMaskedOut
(
InputArrayOfArrays
masks
,
int
queryIdx
);
static
Mat
clone_op
(
Mat
m
)
{
return
m
.
clone
();
}
void
checkMasks
(
const
std
::
vector
<
Mat
>&
masks
,
int
queryDescriptorsCount
)
const
;
void
checkMasks
(
InputArrayOfArrays
masks
,
int
queryDescriptorsCount
)
const
;
// Collection of descriptors from train images.
std
::
vector
<
Mat
>
trainDescCollection
;
...
...
@@ -1157,7 +1157,7 @@ public:
CV_WRAP
FlannBasedMatcher
(
const
Ptr
<
flann
::
IndexParams
>&
indexParams
=
makePtr
<
flann
::
KDTreeIndexParams
>
(),
const
Ptr
<
flann
::
SearchParams
>&
searchParams
=
makePtr
<
flann
::
SearchParams
>
()
);
virtual
void
add
(
const
std
::
vector
<
Mat
>&
descriptors
);
virtual
void
add
(
InputArrayOfArrays
descriptors
);
virtual
void
clear
();
// Reads matcher object from a file node
...
...
@@ -1256,7 +1256,7 @@ public:
// Find one best match for each query descriptor (if mask is empty).
void
match
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
DMatch
>&
matches
,
const
Mat
&
mask
=
Mat
()
)
const
;
std
::
vector
<
DMatch
>&
matches
,
InputArray
mask
=
noArray
()
)
const
;
// Find k best matches for each query keypoint (in increasing order of distances).
// compactResult is used when mask is not empty. If compactResult is false matches
// vector will have the same size as queryDescriptors rows.
...
...
@@ -1264,24 +1264,24 @@ public:
void
knnMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
Mat
&
mask
=
Mat
(),
bool
compactResult
=
false
)
const
;
InputArray
mask
=
noArray
(),
bool
compactResult
=
false
)
const
;
// Find best matches for each query descriptor which have distance less than maxDistance (in increasing order of distances).
void
radiusMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
Mat
&
mask
=
Mat
(),
bool
compactResult
=
false
)
const
;
InputArray
mask
=
noArray
(),
bool
compactResult
=
false
)
const
;
/*
* Group of methods to match keypoints from one image to image set.
* See description of similar methods for matching image pair above.
*/
void
match
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
);
std
::
vector
<
DMatch
>&
matches
,
InputArrayOfArrays
masks
=
noArray
()
);
void
knnMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
InputArrayOfArrays
masks
=
noArray
(),
bool
compactResult
=
false
);
void
radiusMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
InputArrayOfArrays
masks
=
noArray
(),
bool
compactResult
=
false
);
// Reads matcher object from a file node
virtual
void
read
(
const
FileNode
&
fn
);
...
...
@@ -1305,10 +1305,10 @@ protected:
// after calling train().
virtual
void
knnMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
=
0
;
InputArrayOfArrays
masks
,
bool
compactResult
)
=
0
;
virtual
void
radiusMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
=
0
;
InputArrayOfArrays
masks
,
bool
compactResult
)
=
0
;
/*
* A storage for sets of keypoints together with corresponding images and class IDs
*/
...
...
@@ -1383,10 +1383,10 @@ public:
protected:
virtual
void
knnMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
virtual
void
radiusMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
Ptr
<
DescriptorExtractor
>
extractor
;
Ptr
<
DescriptorMatcher
>
matcher
;
...
...
modules/features2d/src/matchers.cpp
浏览文件 @
ff9a0815
...
...
@@ -791,15 +791,18 @@ void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray tra
tempMatcher
->
radiusMatch
(
queryDescriptors
,
matches
,
maxDistance
,
std
::
vector
<
Mat
>
(
1
,
mask
.
getMat
()),
compactResult
);
}
void
DescriptorMatcher
::
match
(
InputArray
queryDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
)
void
DescriptorMatcher
::
match
(
InputArray
queryDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
InputArrayOfArrays
masks
)
{
std
::
vector
<
std
::
vector
<
DMatch
>
>
knnMatches
;
knnMatch
(
queryDescriptors
,
knnMatches
,
1
,
masks
,
true
/*compactResult*/
);
convertMatches
(
knnMatches
,
matches
);
}
void
DescriptorMatcher
::
checkMasks
(
const
std
::
vector
<
Mat
>&
masks
,
int
queryDescriptorsCount
)
const
void
DescriptorMatcher
::
checkMasks
(
InputArrayOfArrays
_
masks
,
int
queryDescriptorsCount
)
const
{
std
::
vector
<
Mat
>
masks
;
_masks
.
getMatVector
(
masks
);
if
(
isMaskSupported
()
&&
!
masks
.
empty
()
)
{
// Check masks
...
...
@@ -819,7 +822,7 @@ void DescriptorMatcher::checkMasks( const std::vector<Mat>& masks, int queryDesc
}
void
DescriptorMatcher
::
knnMatch
(
InputArray
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
if
(
empty
()
||
queryDescriptors
.
empty
()
)
return
;
...
...
@@ -833,7 +836,7 @@ void DescriptorMatcher::knnMatch( InputArray queryDescriptors, std::vector<std::
}
void
DescriptorMatcher
::
radiusMatch
(
InputArray
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
matches
.
clear
();
if
(
empty
()
||
queryDescriptors
.
empty
()
)
...
...
@@ -853,13 +856,17 @@ void DescriptorMatcher::read( const FileNode& )
void
DescriptorMatcher
::
write
(
FileStorage
&
)
const
{}
bool
DescriptorMatcher
::
isPossibleMatch
(
const
Mat
&
mask
,
int
queryIdx
,
int
trainIdx
)
bool
DescriptorMatcher
::
isPossibleMatch
(
InputArray
_
mask
,
int
queryIdx
,
int
trainIdx
)
{
Mat
mask
=
_mask
.
getMat
();
return
mask
.
empty
()
||
mask
.
at
<
uchar
>
(
queryIdx
,
trainIdx
);
}
bool
DescriptorMatcher
::
isMaskedOut
(
const
std
::
vector
<
Mat
>&
masks
,
int
queryIdx
)
bool
DescriptorMatcher
::
isMaskedOut
(
InputArrayOfArrays
_
masks
,
int
queryIdx
)
{
std
::
vector
<
Mat
>
masks
;
_masks
.
getMatVector
(
masks
);
size_t
outCount
=
0
;
for
(
size_t
i
=
0
;
i
<
masks
.
size
();
i
++
)
{
...
...
@@ -1199,9 +1206,12 @@ FlannBasedMatcher::FlannBasedMatcher( const Ptr<flann::IndexParams>& _indexParam
CV_Assert
(
_searchParams
);
}
void
FlannBasedMatcher
::
add
(
const
std
::
vector
<
Mat
>&
descriptors
)
void
FlannBasedMatcher
::
add
(
InputArrayOfArrays
_
descriptors
)
{
DescriptorMatcher
::
add
(
descriptors
);
DescriptorMatcher
::
add
(
_descriptors
);
std
::
vector
<
Mat
>
descriptors
;
_descriptors
.
getMatVector
(
descriptors
);
for
(
size_t
i
=
0
;
i
<
descriptors
.
size
();
i
++
)
{
addedDescCount
+=
descriptors
[
i
].
rows
;
...
...
@@ -1676,43 +1686,43 @@ void GenericDescriptorMatcher::classify( InputArray queryImage, std::vector<KeyP
void
GenericDescriptorMatcher
::
match
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
_trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
DMatch
>&
matches
,
const
Mat
&
mask
)
const
std
::
vector
<
DMatch
>&
matches
,
InputArray
mask
)
const
{
Mat
trainImage
=
_trainImage
.
getMat
();
Ptr
<
GenericDescriptorMatcher
>
tempMatcher
=
clone
(
true
);
std
::
vector
<
std
::
vector
<
KeyPoint
>
>
vecTrainPoints
(
1
,
trainKeypoints
);
tempMatcher
->
add
(
std
::
vector
<
Mat
>
(
1
,
trainImage
),
vecTrainPoints
);
tempMatcher
->
match
(
queryImage
,
queryKeypoints
,
matches
,
std
::
vector
<
Mat
>
(
1
,
mask
)
);
tempMatcher
->
match
(
queryImage
,
queryKeypoints
,
matches
,
std
::
vector
<
Mat
>
(
1
,
mask
.
getMat
()
)
);
vecTrainPoints
[
0
].
swap
(
trainKeypoints
);
}
void
GenericDescriptorMatcher
::
knnMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
_trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
Mat
&
mask
,
bool
compactResult
)
const
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
InputArray
mask
,
bool
compactResult
)
const
{
Mat
trainImage
=
_trainImage
.
getMat
();
Ptr
<
GenericDescriptorMatcher
>
tempMatcher
=
clone
(
true
);
std
::
vector
<
std
::
vector
<
KeyPoint
>
>
vecTrainPoints
(
1
,
trainKeypoints
);
tempMatcher
->
add
(
std
::
vector
<
Mat
>
(
1
,
trainImage
),
vecTrainPoints
);
tempMatcher
->
knnMatch
(
queryImage
,
queryKeypoints
,
matches
,
knn
,
std
::
vector
<
Mat
>
(
1
,
mask
),
compactResult
);
tempMatcher
->
knnMatch
(
queryImage
,
queryKeypoints
,
matches
,
knn
,
std
::
vector
<
Mat
>
(
1
,
mask
.
getMat
()
),
compactResult
);
vecTrainPoints
[
0
].
swap
(
trainKeypoints
);
}
void
GenericDescriptorMatcher
::
radiusMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
InputArray
_trainImage
,
std
::
vector
<
KeyPoint
>&
trainKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
Mat
&
mask
,
bool
compactResult
)
const
InputArray
mask
,
bool
compactResult
)
const
{
Mat
trainImage
=
_trainImage
.
getMat
();
Ptr
<
GenericDescriptorMatcher
>
tempMatcher
=
clone
(
true
);
std
::
vector
<
std
::
vector
<
KeyPoint
>
>
vecTrainPoints
(
1
,
trainKeypoints
);
tempMatcher
->
add
(
std
::
vector
<
Mat
>
(
1
,
trainImage
),
vecTrainPoints
);
tempMatcher
->
radiusMatch
(
queryImage
,
queryKeypoints
,
matches
,
maxDistance
,
std
::
vector
<
Mat
>
(
1
,
mask
),
compactResult
);
tempMatcher
->
radiusMatch
(
queryImage
,
queryKeypoints
,
matches
,
maxDistance
,
std
::
vector
<
Mat
>
(
1
,
mask
.
getMat
()
),
compactResult
);
vecTrainPoints
[
0
].
swap
(
trainKeypoints
);
}
void
GenericDescriptorMatcher
::
match
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
)
std
::
vector
<
DMatch
>&
matches
,
InputArrayOfArrays
masks
)
{
std
::
vector
<
std
::
vector
<
DMatch
>
>
knnMatches
;
knnMatch
(
queryImage
,
queryKeypoints
,
knnMatches
,
1
,
masks
,
false
);
...
...
@@ -1721,7 +1731,7 @@ void GenericDescriptorMatcher::match( InputArray queryImage, std::vector<KeyPoin
void
GenericDescriptorMatcher
::
knnMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
matches
.
clear
();
...
...
@@ -1737,7 +1747,7 @@ void GenericDescriptorMatcher::knnMatch( InputArray queryImage, std::vector<KeyP
void
GenericDescriptorMatcher
::
radiusMatch
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
matches
.
clear
();
...
...
@@ -1828,7 +1838,7 @@ bool VectorDescriptorMatcher::isMaskSupported()
void
VectorDescriptorMatcher
::
knnMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
Mat
queryDescriptors
;
extractor
->
compute
(
queryImage
,
queryKeypoints
,
queryDescriptors
);
...
...
@@ -1837,7 +1847,7 @@ void VectorDescriptorMatcher::knnMatchImpl( InputArray queryImage, std::vector<K
void
VectorDescriptorMatcher
::
radiusMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
)
InputArrayOfArrays
masks
,
bool
compactResult
)
{
Mat
queryDescriptors
;
extractor
->
compute
(
queryImage
,
queryKeypoints
,
queryDescriptors
);
...
...
modules/features2d/src/mser.cpp
浏览文件 @
ff9a0815
...
...
@@ -1266,11 +1266,11 @@ MSER::MSER( int _delta, int _min_area, int _max_area,
{
}
void
MSER
::
operator
()(
const
Mat
&
image
,
std
::
vector
<
std
::
vector
<
Point
>
>&
dstcontours
,
const
Mat
&
mask
)
const
void
MSER
::
operator
()(
InputArray
image
,
std
::
vector
<
std
::
vector
<
Point
>
>&
dstcontours
,
InputArray
mask
)
const
{
CvMat
_image
=
image
,
_mask
,
*
pmask
=
0
;
if
(
mask
.
data
)
pmask
=
&
(
_mask
=
mask
);
CvMat
_image
=
image
.
getMat
()
,
_mask
,
*
pmask
=
0
;
if
(
!
mask
.
empty
()
)
pmask
=
&
(
_mask
=
mask
.
getMat
()
);
MemStorage
storage
(
cvCreateMemStorage
(
0
));
Seq
<
CvSeq
*>
contours
;
extractMSER
(
&
_image
,
pmask
,
&
contours
.
seq
,
storage
,
...
...
modules/legacy/include/opencv2/legacy.hpp
浏览文件 @
ff9a0815
...
...
@@ -2674,10 +2674,10 @@ protected:
// loaded with DescriptorOneWay::Initialize, kd tree is used for finding minimum distances.
virtual
void
knnMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
virtual
void
radiusMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
Ptr
<
OneWayDescriptorBase
>
base
;
Params
params
;
...
...
@@ -2737,10 +2737,10 @@ public:
protected:
virtual
void
knnMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
virtual
void
radiusMatchImpl
(
InputArray
queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
,
bool
compactResult
);
InputArrayOfArrays
masks
,
bool
compactResult
);
void
trainFernClassifier
();
void
calcBestProbAndMatchIdx
(
const
Mat
&
image
,
const
Point2f
&
pt
,
...
...
modules/legacy/src/oneway.cpp
浏览文件 @
ff9a0815
...
...
@@ -2234,7 +2234,7 @@ namespace cv{
void
OneWayDescriptorMatcher
::
knnMatchImpl
(
InputArray
_queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
std
::
vector
<
Mat
>&
/*masks*/
,
bool
/*compactResult*/
)
InputArrayOfArrays
/*masks*/
,
bool
/*compactResult*/
)
{
Mat
queryImage
=
_queryImage
.
getMat
();
train
();
...
...
@@ -2254,7 +2254,7 @@ namespace cv{
void
OneWayDescriptorMatcher
::
radiusMatchImpl
(
InputArray
_queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
/*masks*/
,
bool
/*compactResult*/
)
InputArrayOfArrays
/*masks*/
,
bool
/*compactResult*/
)
{
Mat
queryImage
=
_queryImage
.
getMat
();
...
...
modules/legacy/src/planardetect.cpp
浏览文件 @
ff9a0815
...
...
@@ -1299,7 +1299,7 @@ void FernDescriptorMatcher::calcBestProbAndMatchIdx( const Mat& image, const Poi
void
FernDescriptorMatcher
::
knnMatchImpl
(
InputArray
_queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
knn
,
const
std
::
vector
<
Mat
>&
/*masks*/
,
bool
/*compactResult*/
)
InputArrayOfArrays
/*masks*/
,
bool
/*compactResult*/
)
{
Mat
queryImage
=
_queryImage
.
getMat
();
...
...
@@ -1337,7 +1337,7 @@ void FernDescriptorMatcher::knnMatchImpl( InputArray _queryImage, std::vector<Ke
void
FernDescriptorMatcher
::
radiusMatchImpl
(
InputArray
_queryImage
,
std
::
vector
<
KeyPoint
>&
queryKeypoints
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
/*masks*/
,
bool
/*compactResult*/
)
InputArrayOfArrays
/*masks*/
,
bool
/*compactResult*/
)
{
Mat
queryImage
=
_queryImage
.
getMat
();
train
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录