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
58b7c344
Commit
58b7c344
authored
May 06, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored opencv_stitching
parent
29b917a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
84 deletions
+88
-84
CMakeLists.txt
modules/stitching/CMakeLists.txt
+1
-7
matchers.cpp
modules/stitching/matchers.cpp
+0
-0
matchers.hpp
modules/stitching/matchers.hpp
+85
-0
motion_estimators.cpp
modules/stitching/motion_estimators.cpp
+0
-0
motion_estimators.hpp
modules/stitching/motion_estimators.hpp
+1
-76
seam_finders.hpp
modules/stitching/seam_finders.hpp
+1
-1
No files found.
modules/stitching/CMakeLists.txt
View file @
58b7c344
...
...
@@ -18,13 +18,7 @@ include_directories(
set
(
stitching_libs opencv_core opencv_imgproc opencv_highgui opencv_features2d opencv_calib3d opencv_gpu
)
set
(
stitching_files blenders.hpp blenders.cpp
focal_estimators.hpp focal_estimators.cpp
motion_estimators.hpp motion_estimators.cpp
seam_finders.hpp seam_finders.cpp
util.hpp util.cpp util_inl.hpp
warpers.hpp warpers.cpp warpers_inl.hpp
main.cpp
)
FILE
(
GLOB stitching_files
"*.hpp"
"*.cpp"
)
set
(
the_target opencv_stitching
)
add_executable
(
${
the_target
}
${
stitching_files
}
)
...
...
modules/stitching/matchers.cpp
0 → 100644
View file @
58b7c344
This diff is collapsed.
Click to expand it.
modules/stitching/matchers.hpp
0 → 100644
View file @
58b7c344
#ifndef __OPENCV_MATCHERS_HPP__
#define __OPENCV_MATCHERS_HPP__
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
struct
ImageFeatures
{
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
cv
::
Mat
descriptors
;
};
class
FeaturesFinder
{
public
:
virtual
~
FeaturesFinder
()
{}
void
operator
()(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
)
{
find
(
images
,
features
);
}
protected
:
virtual
void
find
(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
)
=
0
;
};
class
SurfFeaturesFinder
:
public
FeaturesFinder
{
public
:
explicit
SurfFeaturesFinder
(
bool
gpu_hint
=
true
,
double
hess_thresh
=
500.0
,
int
num_octaves
=
3
,
int
num_layers
=
4
,
int
num_octaves_descr
=
4
,
int
num_layers_descr
=
2
);
protected
:
void
find
(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
);
cv
::
Ptr
<
FeaturesFinder
>
impl_
;
};
struct
MatchesInfo
{
MatchesInfo
();
MatchesInfo
(
const
MatchesInfo
&
other
);
const
MatchesInfo
&
operator
=
(
const
MatchesInfo
&
other
);
int
src_img_idx
,
dst_img_idx
;
// Optional images indices
std
::
vector
<
cv
::
DMatch
>
matches
;
std
::
vector
<
uchar
>
inliers_mask
;
int
num_inliers
;
// Number of geometrically consistent matches
cv
::
Mat
H
;
// Homography
};
class
FeaturesMatcher
{
public
:
virtual
~
FeaturesMatcher
()
{}
void
operator
()(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
{
match
(
img1
,
features1
,
img2
,
features2
,
matches_info
);
}
void
operator
()(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
const
std
::
vector
<
ImageFeatures
>
&
features
,
std
::
vector
<
MatchesInfo
>
&
pairwise_matches
);
protected
:
virtual
void
match
(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
=
0
;
};
class
BestOf2NearestMatcher
:
public
FeaturesMatcher
{
public
:
explicit
BestOf2NearestMatcher
(
bool
gpu_hint
=
true
,
float
match_conf
=
0.55
f
,
int
num_matches_thresh1
=
5
,
int
num_matches_thresh2
=
5
);
protected
:
void
match
(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
);
int
num_matches_thresh1_
;
int
num_matches_thresh2_
;
cv
::
Ptr
<
FeaturesMatcher
>
impl_
;
};
#endif // __OPENCV_MATCHERS_HPP__
\ No newline at end of file
modules/stitching/motion_estimators.cpp
View file @
58b7c344
This diff is collapsed.
Click to expand it.
modules/stitching/motion_estimators.hpp
View file @
58b7c344
...
...
@@ -3,84 +3,9 @@
#include <vector>
#include <opencv2/core/core.hpp>
#include
<opencv2/features2d/features2d.hpp>
#include
"matchers.hpp"
#include "util.hpp"
struct
ImageFeatures
{
std
::
vector
<
cv
::
KeyPoint
>
keypoints
;
cv
::
Mat
descriptors
;
};
class
FeaturesFinder
{
public
:
virtual
~
FeaturesFinder
()
{}
void
operator
()(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
)
{
find
(
images
,
features
);
}
protected
:
virtual
void
find
(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
)
=
0
;
};
class
SurfFeaturesFinder
:
public
FeaturesFinder
{
public
:
explicit
SurfFeaturesFinder
(
bool
gpu_hint
=
true
);
protected
:
void
find
(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
std
::
vector
<
ImageFeatures
>
&
features
);
cv
::
Ptr
<
FeaturesFinder
>
impl_
;
};
struct
MatchesInfo
{
MatchesInfo
();
MatchesInfo
(
const
MatchesInfo
&
other
);
const
MatchesInfo
&
operator
=
(
const
MatchesInfo
&
other
);
int
src_img_idx
,
dst_img_idx
;
// Optional images indices
std
::
vector
<
cv
::
DMatch
>
matches
;
std
::
vector
<
uchar
>
inliers_mask
;
int
num_inliers
;
// Number of geometrically consistent matches
cv
::
Mat
H
;
// Homography
};
class
FeaturesMatcher
{
public
:
virtual
~
FeaturesMatcher
()
{}
void
operator
()(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
{
match
(
img1
,
features1
,
img2
,
features2
,
matches_info
);
}
void
operator
()(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
const
std
::
vector
<
ImageFeatures
>
&
features
,
std
::
vector
<
MatchesInfo
>
&
pairwise_matches
);
protected
:
virtual
void
match
(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
=
0
;
};
class
BestOf2NearestMatcher
:
public
FeaturesMatcher
{
public
:
explicit
BestOf2NearestMatcher
(
bool
gpu_hint
=
true
,
float
match_conf
=
0.55
f
,
int
num_matches_thresh1
=
5
,
int
num_matches_thresh2
=
5
);
protected
:
void
match
(
const
cv
::
Mat
&
img1
,
const
ImageFeatures
&
features1
,
const
cv
::
Mat
&
img2
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
);
int
num_matches_thresh1_
;
int
num_matches_thresh2_
;
cv
::
Ptr
<
FeaturesMatcher
>
impl_
;
};
struct
CameraParams
{
CameraParams
();
...
...
modules/stitching/seam_finders.hpp
View file @
58b7c344
...
...
@@ -52,7 +52,7 @@ class GraphCutSeamFinder : public PairwiseSeamFinder
{
public
:
// TODO add COST_COLOR_GRAD support
enum
{
COST_COLOR
/*, COST_COLOR_GRAD*/
};
enum
{
COST_COLOR
};
GraphCutSeamFinder
(
int
cost_type
=
COST_COLOR
,
float
terminal_cost
=
10000.
f
,
float
bad_region_penalty
=
1000.
f
);
...
...
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