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
fdeec689
Commit
fdeec689
authored
Apr 18, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stitching module fixes
parent
033dd775
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
29 deletions
+46
-29
CMakeLists.txt
modules/stitching/CMakeLists.txt
+2
-1
matchers.hpp
...s/stitching/include/opencv2/stitching/detail/matchers.hpp
+4
-3
warpers.hpp
...es/stitching/include/opencv2/stitching/detail/warpers.hpp
+2
-4
warpers.hpp
modules/stitching/include/opencv2/stitching/warpers.hpp
+1
-1
blenders.cpp
modules/stitching/src/blenders.cpp
+6
-4
matchers.cpp
modules/stitching/src/matchers.cpp
+10
-9
precomp.hpp
modules/stitching/src/precomp.hpp
+17
-3
stitcher.cpp
modules/stitching/src/stitcher.cpp
+1
-1
warpers.cpp
modules/stitching/src/warpers.cpp
+1
-1
stitching_detailed.cpp
samples/cpp/stitching_detailed.cpp
+2
-2
No files found.
modules/stitching/CMakeLists.txt
View file @
fdeec689
set
(
the_description
"Images stitching"
)
ocv_define_module
(
stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect OPTIONAL opencv_gpu opencv_gpuarithm opencv_gpufilters opencv_nonfree
)
ocv_define_module
(
stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect
OPTIONAL opencv_gpu opencv_gpuarithm opencv_gpufilters opencv_gpufeatures2d opencv_nonfree
)
modules/stitching/include/opencv2/stitching/detail/matchers.hpp
View file @
fdeec689
...
...
@@ -47,8 +47,9 @@
#include "opencv2/features2d.hpp"
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
#include "opencv2/nonfree/gpu.hpp"
#ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/gpu.hpp"
#endif
namespace
cv
{
...
...
@@ -103,7 +104,7 @@ private:
};
#if
defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
#if
def HAVE_OPENCV_NONFREE
class
CV_EXPORTS
SurfFeaturesFinderGpu
:
public
FeaturesFinder
{
public
:
...
...
modules/stitching/include/opencv2/stitching/detail/warpers.hpp
View file @
fdeec689
...
...
@@ -44,11 +44,9 @@
#define __OPENCV_STITCHING_WARPERS_HPP__
#include "opencv2/core.hpp"
#include "opencv2/core/gpumat.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GPU
# include "opencv2/gpu.hpp"
#endif
namespace
cv
{
namespace
detail
{
...
...
@@ -329,7 +327,7 @@ public:
};
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
WARPING
class
CV_EXPORTS
PlaneWarperGpu
:
public
PlaneWarper
{
public
:
...
...
modules/stitching/include/opencv2/stitching/warpers.hpp
View file @
fdeec689
...
...
@@ -145,7 +145,7 @@ public:
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
WARPING
class
PlaneWarperGpu
:
public
WarperCreator
{
public
:
...
...
modules/stitching/src/blenders.cpp
View file @
fdeec689
...
...
@@ -187,12 +187,14 @@ Rect FeatherBlender::createWeightMaps(const std::vector<Mat> &masks, const std::
MultiBandBlender
::
MultiBandBlender
(
int
try_gpu
,
int
num_bands
,
int
weight_type
)
{
setNumBands
(
num_bands
);
#ifdef HAVE_OPENCV_GPU
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
can_use_gpu_
=
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
();
#else
(
void
)
try_gpu
;
(
void
)
try_gpu
;
can_use_gpu_
=
false
;
#endif
CV_Assert
(
weight_type
==
CV_32F
||
weight_type
==
CV_16S
);
weight_type_
=
weight_type
;
}
...
...
@@ -489,7 +491,7 @@ void createLaplacePyr(const Mat &img, int num_levels, std::vector<Mat> &pyr)
void
createLaplacePyrGpu
(
const
Mat
&
img
,
int
num_levels
,
std
::
vector
<
Mat
>
&
pyr
)
{
#if
def HAVE_OPENCV_GPU
#if
defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
pyr
.
resize
(
num_levels
+
1
);
std
::
vector
<
gpu
::
GpuMat
>
gpu_pyr
(
num_levels
+
1
);
...
...
@@ -529,7 +531,7 @@ void restoreImageFromLaplacePyr(std::vector<Mat> &pyr)
void
restoreImageFromLaplacePyrGpu
(
std
::
vector
<
Mat
>
&
pyr
)
{
#if
def HAVE_OPENCV_GPU
#if
defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
if
(
pyr
.
empty
())
return
;
...
...
modules/stitching/src/matchers.cpp
View file @
fdeec689
...
...
@@ -44,10 +44,7 @@
using
namespace
cv
;
using
namespace
cv
::
detail
;
#ifdef HAVE_OPENCV_GPU
using
namespace
cv
::
gpu
;
#endif
#ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree.hpp"
...
...
@@ -132,7 +129,7 @@ private:
float
match_conf_
;
};
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
FEATURES2D
class
GpuMatcher
:
public
FeaturesMatcher
{
public
:
...
...
@@ -207,7 +204,7 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat
LOG
(
"1->2 & 2->1 matches: "
<<
matches_info
.
matches
.
size
()
<<
endl
);
}
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
FEATURES2D
void
GpuMatcher
::
match
(
const
ImageFeatures
&
features1
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
{
matches_info
.
matches
.
clear
();
...
...
@@ -435,7 +432,7 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features)
}
}
#if
defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
#if
def HAVE_OPENCV_NONFREE
SurfFeaturesFinderGpu
::
SurfFeaturesFinderGpu
(
double
hess_thresh
,
int
num_octaves
,
int
num_layers
,
int
num_octaves_descr
,
int
num_layers_descr
)
{
...
...
@@ -536,14 +533,18 @@ void FeaturesMatcher::operator ()(const std::vector<ImageFeatures> &features, st
BestOf2NearestMatcher
::
BestOf2NearestMatcher
(
bool
try_use_gpu
,
float
match_conf
,
int
num_matches_thresh1
,
int
num_matches_thresh2
)
{
#ifdef HAVE_OPENCV_GPU
(
void
)
try_use_gpu
;
#ifdef HAVE_OPENCV_GPUFEATURES2D
if
(
try_use_gpu
&&
getCudaEnabledDeviceCount
()
>
0
)
{
impl_
=
new
GpuMatcher
(
match_conf
);
}
else
#else
(
void
)
try_use_gpu
;
#endif
{
impl_
=
new
CpuMatcher
(
match_conf
);
}
is_thread_safe_
=
impl_
->
isThreadSafe
();
num_matches_thresh1_
=
num_matches_thresh1
;
...
...
modules/stitching/src/precomp.hpp
View file @
fdeec689
...
...
@@ -66,11 +66,25 @@
#include "opencv2/imgproc.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
#ifdef HAVE_OPENCV_GPUARITHM
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUWARPING
# include "opencv2/gpuwarping.hpp"
#endif
#ifdef HAVE_OPENCV_GPUFEATURES2D
# include "opencv2/gpufeatures2d.hpp"
#endif
#ifdef HAVE_OPENCV_GPU
# include "opencv2/gpu.hpp"
# ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/gpu.hpp"
# endif
#endif
#ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/gpu.hpp"
#endif
#include "../../imgproc/src/gcgraph.hpp"
...
...
modules/stitching/src/stitcher.cpp
View file @
fdeec689
...
...
@@ -59,7 +59,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
#ifdef HAVE_OPENCV_GPU
if
(
try_use_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
{
#if
defined(HAVE_OPENCV_NONFREE)
#if
def HAVE_OPENCV_NONFREE
stitcher
.
setFeaturesFinder
(
new
detail
::
SurfFeaturesFinderGpu
());
#else
stitcher
.
setFeaturesFinder
(
new
detail
::
OrbFeaturesFinder
());
...
...
modules/stitching/src/warpers.cpp
View file @
fdeec689
...
...
@@ -210,7 +210,7 @@ void SphericalWarper::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_b
}
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
WARPING
Rect
PlaneWarperGpu
::
buildMaps
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
,
gpu
::
GpuMat
&
xmap
,
gpu
::
GpuMat
&
ymap
)
{
return
buildMaps
(
src_size
,
K
,
R
,
Mat
::
zeros
(
3
,
1
,
CV_32F
),
xmap
,
ymap
);
...
...
samples/cpp/stitching_detailed.cpp
View file @
fdeec689
...
...
@@ -356,7 +356,7 @@ int main(int argc, char* argv[])
Ptr
<
FeaturesFinder
>
finder
;
if
(
features_type
==
"surf"
)
{
#if
defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
#if
def HAVE_OPENCV_NONFREE
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
finder
=
new
SurfFeaturesFinderGpu
();
else
...
...
@@ -544,7 +544,7 @@ int main(int argc, char* argv[])
// Warp images and their masks
Ptr
<
WarperCreator
>
warper_creator
;
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPU
WARPING
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
{
if
(
warp_type
==
"plane"
)
warper_creator
=
new
cv
::
PlaneWarperGpu
();
...
...
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