Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
b720eddd
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,发现更多精彩内容 >>
提交
b720eddd
编写于
10月 27, 2011
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tegra-optimized features matching for Stitching
上级
5afb4452
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
74 addition
and
10 deletion
+74
-10
modules/stitching/CMakeLists.txt
modules/stitching/CMakeLists.txt
+0
-1
modules/stitching/perf/perf_stich.cpp
modules/stitching/perf/perf_stich.cpp
+59
-4
modules/stitching/src/matchers.cpp
modules/stitching/src/matchers.cpp
+7
-2
modules/stitching/src/precomp.hpp
modules/stitching/src/precomp.hpp
+8
-3
未找到文件。
modules/stitching/CMakeLists.txt
浏览文件 @
b720eddd
include_directories
(
"
${
OpenCV_SOURCE_DIR
}
/modules/imgproc/src"
)
# For gcgraph.hpp
if
(
ANDROID
)
define_opencv_module
(
stitching opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_flann opencv_objdetect
)
else
()
...
...
modules/stitching/perf/perf_stich.cpp
浏览文件 @
b720eddd
#include "perf_precomp.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/flann/flann.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
#define SURF_MATCH_CONFIDENCE 0.65f
#define ORB_MATCH_CONFIDENCE 0.3f
#define WORK_MEGAPIX 0.6
typedef
TestBaseWithParam
<
String
>
stitch
;
typedef
TestBaseWithParam
<
String
>
match
;
PERF_TEST_P
(
stitch
,
a123
,
testing
::
Values
(
"surf"
,
"orb"
))
{
...
...
@@ -23,8 +29,8 @@ PERF_TEST_P( stitch, a123, testing::Values("surf", "orb"))
:
(
detail
::
FeaturesFinder
*
)
new
detail
::
SurfFeaturesFinder
();
Ptr
<
detail
::
FeaturesMatcher
>
featuresMatcher
=
GetParam
()
==
"orb"
?
new
detail
::
BestOf2NearestMatcher
(
false
,
0.3
f
)
:
new
detail
::
BestOf2NearestMatcher
(
false
,
0.65
f
);
?
new
detail
::
BestOf2NearestMatcher
(
false
,
ORB_MATCH_CONFIDENCE
)
:
new
detail
::
BestOf2NearestMatcher
(
false
,
SURF_MATCH_CONFIDENCE
);
declare
.
time
(
30
*
20
).
iterations
(
50
);
...
...
@@ -33,6 +39,8 @@ PERF_TEST_P( stitch, a123, testing::Values("surf", "orb"))
Stitcher
stitcher
=
Stitcher
::
createDefault
();
stitcher
.
setFeaturesFinder
(
featuresFinder
);
stitcher
.
setFeaturesMatcher
(
featuresMatcher
);
stitcher
.
setWarper
(
new
CylindricalWarper
());
stitcher
.
setRegistrationResol
(
WORK_MEGAPIX
);
startTimer
();
status
=
stitcher
.
stitch
(
imgs
,
pano
);
...
...
@@ -54,8 +62,8 @@ PERF_TEST_P( stitch, b12, testing::Values("surf", "orb"))
:
(
detail
::
FeaturesFinder
*
)
new
detail
::
SurfFeaturesFinder
();
Ptr
<
detail
::
FeaturesMatcher
>
featuresMatcher
=
GetParam
()
==
"orb"
?
new
detail
::
BestOf2NearestMatcher
(
false
,
0.3
f
)
:
new
detail
::
BestOf2NearestMatcher
(
false
,
0.65
f
);
?
new
detail
::
BestOf2NearestMatcher
(
false
,
ORB_MATCH_CONFIDENCE
)
:
new
detail
::
BestOf2NearestMatcher
(
false
,
SURF_MATCH_CONFIDENCE
);
declare
.
time
(
30
*
20
).
iterations
(
50
);
...
...
@@ -64,9 +72,56 @@ PERF_TEST_P( stitch, b12, testing::Values("surf", "orb"))
Stitcher
stitcher
=
Stitcher
::
createDefault
();
stitcher
.
setFeaturesFinder
(
featuresFinder
);
stitcher
.
setFeaturesMatcher
(
featuresMatcher
);
stitcher
.
setWarper
(
new
CylindricalWarper
());
stitcher
.
setRegistrationResol
(
WORK_MEGAPIX
);
startTimer
();
status
=
stitcher
.
stitch
(
imgs
,
pano
);
stopTimer
();
}
}
PERF_TEST_P
(
match
,
bestOf2Nearest
,
testing
::
Values
(
"surf"
,
"orb"
))
{
Mat
img1
,
img1_full
=
imread
(
getDataPath
(
"stitching/b1.jpg"
)
);
Mat
img2
,
img2_full
=
imread
(
getDataPath
(
"stitching/b2.jpg"
)
);
float
scale1
=
std
::
min
(
1.0
,
sqrt
(
WORK_MEGAPIX
*
1e6
/
img1_full
.
total
()));
float
scale2
=
std
::
min
(
1.0
,
sqrt
(
WORK_MEGAPIX
*
1e6
/
img2_full
.
total
()));
resize
(
img1_full
,
img1
,
Size
(),
scale1
,
scale1
);
resize
(
img2_full
,
img2
,
Size
(),
scale2
,
scale2
);
Ptr
<
detail
::
FeaturesFinder
>
finder
;
Ptr
<
detail
::
FeaturesMatcher
>
matcher
;
if
(
GetParam
()
==
"surf"
)
{
finder
=
new
detail
::
SurfFeaturesFinder
();
matcher
=
new
detail
::
BestOf2NearestMatcher
(
false
,
SURF_MATCH_CONFIDENCE
);
}
else
if
(
GetParam
()
==
"orb"
)
{
finder
=
new
detail
::
OrbFeaturesFinder
();
matcher
=
new
detail
::
BestOf2NearestMatcher
(
false
,
ORB_MATCH_CONFIDENCE
);
}
else
{
FAIL
()
<<
"Unknown 2D features type: "
<<
GetParam
();
}
detail
::
ImageFeatures
features1
,
features2
;
(
*
finder
)(
img1
,
features1
);
(
*
finder
)(
img2
,
features2
);
detail
::
MatchesInfo
pairwise_matches
;
declare
.
in
(
features1
.
descriptors
,
features2
.
descriptors
)
.
iterations
(
100
);
while
(
next
())
{
cvflann
::
seed_random
(
42
);
//for predictive FlannBasedMatcher
startTimer
();
(
*
matcher
)(
features1
,
features2
,
pairwise_matches
);
stopTimer
();
matcher
->
collectGarbage
();
}
}
modules/stitching/src/matchers.cpp
浏览文件 @
b720eddd
...
...
@@ -147,11 +147,16 @@ private:
void
CpuMatcher
::
match
(
const
ImageFeatures
&
features1
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
{
matches_info
.
matches
.
clear
();
CV_Assert
(
features1
.
descriptors
.
type
()
==
features2
.
descriptors
.
type
());
CV_Assert
(
features2
.
descriptors
.
depth
()
==
CV_8U
||
features2
.
descriptors
.
depth
()
==
CV_32F
);
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
tegra
::
match2nearest
(
features1
,
features2
,
matches_info
,
match_conf_
))
return
;
#endif
matches_info
.
matches
.
clear
();
Ptr
<
flann
::
IndexParams
>
indexParams
=
new
flann
::
KDTreeIndexParams
();
Ptr
<
flann
::
SearchParams
>
searchParams
=
new
flann
::
SearchParams
();
...
...
modules/stitching/src/precomp.hpp
浏览文件 @
b720eddd
...
...
@@ -54,6 +54,8 @@
#include <functional>
#include <sstream>
#include <cmath>
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "opencv2/stitching/stitcher.hpp"
#include "opencv2/stitching/detail/autocalib.hpp"
#include "opencv2/stitching/detail/blenders.hpp"
...
...
@@ -64,14 +66,17 @@
#include "opencv2/stitching/detail/seam_finders.hpp"
#include "opencv2/stitching/detail/util.hpp"
#include "opencv2/stitching/detail/warpers.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#ifndef ANDROID
# include "opencv2/gpu/gpu.hpp"
#endif
#include "gcgraph.hpp"
#include "modules/imgproc/src/gcgraph.hpp"
#ifdef HAVE_TEGRA_OPTIMIZATION
# include "opencv2/stitching/stitching_tegra.hpp"
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录