Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c5357cc1
Commit
c5357cc1
authored
Sep 30, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added fix for removing too similar images into the stitching module
parent
3d3efe7c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
matchers.cpp
modules/stitching/src/matchers.cpp
+7
-7
motion_estimators.cpp
modules/stitching/src/motion_estimators.cpp
+4
-3
No files found.
modules/stitching/src/matchers.cpp
View file @
c5357cc1
...
...
@@ -427,12 +427,6 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea
{
(
*
impl_
)(
features1
,
features2
,
matches_info
);
//Mat out;
//drawMatches(features1.img, features1.keypoints, features2.img, features2.keypoints, matches_info.matches, out);
//stringstream ss;
//ss << features1.img_idx << features2.img_idx << ".png";
//imwrite(ss.str(), out);
// Check if it makes sense to find homography
if
(
matches_info
.
matches
.
size
()
<
static_cast
<
size_t
>
(
num_matches_thresh1_
))
return
;
...
...
@@ -466,7 +460,13 @@ void BestOf2NearestMatcher::match(const ImageFeatures &features1, const ImageFea
if
(
matches_info
.
inliers_mask
[
i
])
matches_info
.
num_inliers
++
;
matches_info
.
confidence
=
matches_info
.
num_inliers
/
(
8
+
0.3
*
matches_info
.
matches
.
size
());
// These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching
// using Invariant Features"
matches_info
.
confidence
=
matches_info
.
num_inliers
/
(
8
+
0.3
*
matches_info
.
matches
.
size
());
// Set zero confidence to remove matches between too close images, as they don't provide
// additional information anyway. The threshold was set experimentally.
matches_info
.
confidence
=
matches_info
.
confidence
>
3.
?
0.
:
matches_info
.
confidence
;
// Check if we should try to refine motion
if
(
matches_info
.
num_inliers
<
num_matches_thresh2_
)
...
...
modules/stitching/src/motion_estimators.cpp
View file @
c5357cc1
...
...
@@ -748,11 +748,12 @@ vector<int> leaveBiggestComponent(vector<ImageFeatures> &features, vector<Match
if
(
static_cast
<
int
>
(
features_subset
.
size
())
==
num_images
)
return
indices
;
LOG
(
"Removed some images, because can't match them: ("
);
LOG
(
indices_removed
[
0
]
+
1
);
LOG
(
"Removed some images, because can't match them
or there are too similar images
: ("
);
LOG
(
indices_removed
[
0
]
+
1
);
for
(
size_t
i
=
1
;
i
<
indices_removed
.
size
();
++
i
)
LOG
(
", "
<<
indices_removed
[
i
]
+
1
);
LOGLN
(
"). Try to decrease --match_conf value."
);
LOGLN
(
")."
);
LOGLN
(
"Try to decrease --match_conf value and/or check if you're stitching duplicates."
);
features
=
features_subset
;
pairwise_matches
=
pairwise_matches_subset
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment