Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
a7d053f1
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,发现更多精彩内容 >>
提交
a7d053f1
编写于
9月 26, 2011
作者:
A
Alexey Spizhevoy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added handling of ROI in stitching features matchers
上级
b053a3b4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
1 deletion
+51
-1
modules/stitching/include/opencv2/stitching/detail/matchers.hpp
...s/stitching/include/opencv2/stitching/detail/matchers.hpp
+1
-0
modules/stitching/include/opencv2/stitching/stitcher.hpp
modules/stitching/include/opencv2/stitching/stitcher.hpp
+2
-0
modules/stitching/src/matchers.cpp
modules/stitching/src/matchers.cpp
+37
-0
modules/stitching/src/stitcher.cpp
modules/stitching/src/stitcher.cpp
+11
-1
未找到文件。
modules/stitching/include/opencv2/stitching/detail/matchers.hpp
浏览文件 @
a7d053f1
...
...
@@ -67,6 +67,7 @@ class CV_EXPORTS FeaturesFinder
public:
virtual
~
FeaturesFinder
()
{}
void
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
);
void
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
,
const
std
::
vector
<
cv
::
Rect
>
&
rois
);
virtual
void
collectGarbage
()
{}
protected:
...
...
modules/stitching/include/opencv2/stitching/stitcher.hpp
浏览文件 @
a7d053f1
...
...
@@ -66,6 +66,7 @@ public:
// Stitches the biggest found pano. Returns status code.
Status
stitch
(
InputArray
imgs
,
OutputArray
pano
);
Status
stitch
(
InputArray
imgs
,
const
std
::
vector
<
std
::
vector
<
cv
::
Rect
>
>
&
rois
,
OutputArray
pano
);
double
registrationResol
()
const
{
return
registr_resol_
;
}
void
setRegistrationResol
(
double
resol_mpx
)
{
registr_resol_
=
resol_mpx
;
}
...
...
@@ -147,6 +148,7 @@ private:
Ptr
<
detail
::
Blender
>
blender_
;
std
::
vector
<
cv
::
Mat
>
imgs_
;
std
::
vector
<
std
::
vector
<
cv
::
Rect
>
>
rois_
;
std
::
vector
<
cv
::
Size
>
full_img_sizes_
;
std
::
vector
<
detail
::
ImageFeatures
>
features_
;
std
::
vector
<
detail
::
MatchesInfo
>
pairwise_matches_
;
...
...
modules/stitching/src/matchers.cpp
浏览文件 @
a7d053f1
...
...
@@ -249,10 +249,47 @@ namespace detail {
void
FeaturesFinder
::
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
)
{
find
(
image
,
features
);
cout
<<
features
.
descriptors
.
cols
<<
" "
<<
features
.
descriptors
.
rows
<<
" "
<<
features
.
descriptors
.
type
()
<<
endl
;
features
.
img_size
=
image
.
size
();
}
// TODO add tests for this function
void
FeaturesFinder
::
operator
()(
const
Mat
&
image
,
ImageFeatures
&
features
,
const
vector
<
Rect
>
&
rois
)
{
vector
<
ImageFeatures
>
roi_features
;
size_t
total_kps_count
=
0
;
int
total_descriptors_width
=
0
;
for
(
size_t
i
=
0
;
i
<
rois
.
size
();
++
i
)
{
find
(
image
(
rois
[
i
]),
roi_features
[
i
]);
total_kps_count
+=
roi_features
[
i
].
keypoints
.
size
();
total_descriptors_width
+=
roi_features
[
i
].
descriptors
.
cols
;
}
features
.
img_size
=
image
.
size
();
features
.
keypoints
.
resize
(
total_kps_count
);
features
.
descriptors
.
create
(
1
,
total_descriptors_width
,
roi_features
[
0
].
descriptors
.
type
());
int
kp_idx
=
0
;
int
descr_offset
=
0
;
for
(
size_t
i
=
0
;
i
<
rois
.
size
();
++
i
)
{
for
(
size_t
j
=
0
;
j
<
features
.
keypoints
.
size
();
++
j
,
++
kp_idx
)
{
features
.
keypoints
[
kp_idx
]
=
roi_features
[
i
].
keypoints
[
j
];
features
.
keypoints
[
kp_idx
].
pt
.
x
+=
(
float
)
rois
[
i
].
x
;
features
.
keypoints
[
kp_idx
].
pt
.
y
+=
(
float
)
rois
[
i
].
y
;
}
Mat
subdescr
=
features
.
descriptors
.
colRange
(
descr_offset
,
descr_offset
+
roi_features
[
i
].
descriptors
.
cols
);
roi_features
[
i
].
descriptors
.
copyTo
(
subdescr
);
descr_offset
+=
roi_features
[
i
].
descriptors
.
cols
;
}
}
SurfFeaturesFinder
::
SurfFeaturesFinder
(
double
hess_thresh
,
int
num_octaves
,
int
num_layers
,
int
num_octaves_descr
,
int
num_layers_descr
)
{
...
...
modules/stitching/src/stitcher.cpp
浏览文件 @
a7d053f1
...
...
@@ -100,6 +100,13 @@ Stitcher::Status Stitcher::stitch(InputArray imgs, OutputArray pano)
}
Stitcher
::
Status
Stitcher
::
stitch
(
InputArray
imgs
,
const
vector
<
vector
<
Rect
>
>
&
rois
,
OutputArray
pano
)
{
rois_
=
rois
;
return
stitch
(
imgs
,
pano
);
}
Stitcher
::
Status
Stitcher
::
matchImages
()
{
if
((
int
)
imgs_
.
size
()
<
2
)
...
...
@@ -148,7 +155,10 @@ Stitcher::Status Stitcher::matchImages()
is_seam_scale_set
=
true
;
}
(
*
features_finder_
)(
img
,
features_
[
i
]);
if
(
rois_
.
empty
())
(
*
features_finder_
)(
img
,
features_
[
i
]);
else
(
*
features_finder_
)(
img
,
features_
[
i
],
rois_
[
i
]);
features_
[
i
].
img_idx
=
i
;
LOGLN
(
"Features in image #"
<<
i
+
1
<<
": "
<<
features_
[
i
].
keypoints
.
size
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录