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
cd1ffd16
Commit
cd1ffd16
authored
Feb 03, 2014
by
Roman Donchenko
Committed by
OpenCV Buildbot
Feb 03, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2261 from jet47:stitching-cuda-android
parents
a1ad1f08
214cbabc
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
207 additions
and
54 deletions
+207
-54
CMakeLists.txt
modules/nonfree/CMakeLists.txt
+3
-4
gpu.hpp
modules/nonfree/include/opencv2/nonfree/gpu.hpp
+1
-7
perf_gpu.cpp
modules/nonfree/perf/perf_gpu.cpp
+3
-1
surf.cu
modules/nonfree/src/cuda/surf.cu
+1
-1
precomp.hpp
modules/nonfree/src/precomp.hpp
+1
-1
surf_gpu.cpp
modules/nonfree/src/surf_gpu.cpp
+1
-5
test_gpu.cpp
modules/nonfree/test/test_gpu.cpp
+3
-1
CMakeLists.txt
modules/stitching/CMakeLists.txt
+3
-3
matchers.hpp
...s/stitching/include/opencv2/stitching/detail/matchers.hpp
+3
-2
seam_finders.hpp
...itching/include/opencv2/stitching/detail/seam_finders.hpp
+1
-3
warpers.hpp
...es/stitching/include/opencv2/stitching/detail/warpers.hpp
+1
-6
warpers.hpp
modules/stitching/include/opencv2/stitching/warpers.hpp
+0
-2
blenders.cpp
modules/stitching/src/blenders.cpp
+5
-3
matchers.cpp
modules/stitching/src/matchers.cpp
+27
-7
precomp.hpp
modules/stitching/src/precomp.hpp
+1
-1
seam_finders.cpp
modules/stitching/src/seam_finders.cpp
+57
-1
stitcher.cpp
modules/stitching/src/stitcher.cpp
+1
-1
warpers.cpp
modules/stitching/src/warpers.cpp
+91
-1
stitching_detailed.cpp
samples/cpp/stitching_detailed.cpp
+4
-4
No files found.
modules/nonfree/CMakeLists.txt
View file @
cd1ffd16
...
...
@@ -4,9 +4,9 @@ endif()
set
(
the_description
"Functionality with possible limitations on the use"
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef
)
if
(
ENABLE_DYNAMIC_CUDA
)
set
(
HAVE_CUDA FALSE
)
if
(
ENABLE_DYNAMIC_CUDA
)
add_definitions
(
-DDYNAMIC_CUDA_SUPPORT
)
ocv_define_module
(
nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_ocl
)
else
()
ocv_define_module
(
nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_gpu opencv_ocl
)
endif
()
\ No newline at end of file
endif
()
modules/nonfree/include/opencv2/nonfree/gpu.hpp
View file @
cd1ffd16
...
...
@@ -43,11 +43,7 @@
#ifndef __OPENCV_NONFREE_GPU_HPP__
#define __OPENCV_NONFREE_GPU_HPP__
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/core/gpumat.hpp"
namespace
cv
{
namespace
gpu
{
...
...
@@ -129,6 +125,4 @@ public:
}
// namespace cv
#endif // defined(HAVE_OPENCV_GPU)
#endif // __OPENCV_NONFREE_GPU_HPP__
modules/nonfree/perf/perf_gpu.cpp
View file @
cd1ffd16
...
...
@@ -42,7 +42,9 @@
#include "perf_precomp.hpp"
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
#include "cvconfig.h"
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) && !defined(DYNAMIC_CUDA_SUPPORT)
#include "opencv2/ts/gpu_perf.hpp"
...
...
modules/nonfree/src/cuda/surf.cu
View file @
cd1ffd16
...
...
@@ -42,7 +42,7 @@
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
#include "opencv2/gpu/device/common.hpp"
#include "opencv2/gpu/device/limits.hpp"
...
...
modules/nonfree/src/precomp.hpp
View file @
cd1ffd16
...
...
@@ -51,7 +51,7 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/internal.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
#include "opencv2/nonfree/gpu.hpp"
#if defined(HAVE_CUDA)
...
...
modules/nonfree/src/surf_gpu.cpp
View file @
cd1ffd16
...
...
@@ -42,12 +42,10 @@
#include "precomp.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
using
namespace
cv
;
using
namespace
cv
::
gpu
;
#if !defined (HAVE_CUDA)
#if !defined (HAVE_CUDA)
|| !defined(HAVE_OPENCV_GPU) || defined(DYNAMIC_CUDA_SUPPORT)
cv
::
gpu
::
SURF_GPU
::
SURF_GPU
()
{
throw_nogpu
();
}
cv
::
gpu
::
SURF_GPU
::
SURF_GPU
(
double
,
int
,
int
,
bool
,
float
,
bool
)
{
throw_nogpu
();
}
...
...
@@ -421,5 +419,3 @@ void cv::gpu::SURF_GPU::releaseMemory()
}
#endif // !defined (HAVE_CUDA)
#endif // defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
modules/nonfree/test/test_gpu.cpp
View file @
cd1ffd16
...
...
@@ -42,7 +42,9 @@
#include "test_precomp.hpp"
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
#include "cvconfig.h"
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) && !defined(DYNAMIC_CUDA_SUPPORT)
using
namespace
cvtest
;
...
...
modules/stitching/CMakeLists.txt
View file @
cd1ffd16
set
(
the_description
"Images stitching"
)
if
(
ENABLE_DYNAMIC_CUDA
)
if
(
ENABLE_DYNAMIC_CUDA
)
add_definitions
(
-DDYNAMIC_CUDA_SUPPORT
)
ocv_define_module
(
stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect OPTIONAL opencv_nonfree
)
else
()
ocv_define_module
(
stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect OPTIONAL opencv_gpu opencv_nonfree
)
endif
()
\ No newline at end of file
endif
()
modules/stitching/include/opencv2/stitching/detail/matchers.hpp
View file @
cd1ffd16
...
...
@@ -44,11 +44,12 @@
#define __OPENCV_STITCHING_MATCHERS_HPP__
#include "opencv2/core/core.hpp"
#include "opencv2/core/gpumat.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_NONFREE)
&& defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
#if defined(HAVE_OPENCV_NONFREE)
#include "opencv2/nonfree/gpu.hpp"
#endif
...
...
@@ -104,7 +105,7 @@ private:
};
#if defined(HAVE_OPENCV_NONFREE)
&& defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
#if defined(HAVE_OPENCV_NONFREE)
class
CV_EXPORTS
SurfFeaturesFinderGpu
:
public
FeaturesFinder
{
public
:
...
...
modules/stitching/include/opencv2/stitching/detail/seam_finders.hpp
View file @
cd1ffd16
...
...
@@ -45,7 +45,7 @@
#include <set>
#include "opencv2/core/core.hpp"
#include "opencv2/
opencv_modules
.hpp"
#include "opencv2/
core/gpumat
.hpp"
namespace
cv
{
namespace
detail
{
...
...
@@ -227,7 +227,6 @@ private:
};
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
class
CV_EXPORTS
GraphCutSeamFinderGpu
:
public
GraphCutSeamFinderBase
,
public
PairwiseSeamFinder
{
public
:
...
...
@@ -251,7 +250,6 @@ private:
float
terminal_cost_
;
float
bad_region_penalty_
;
};
#endif
}
// namespace detail
}
// namespace cv
...
...
modules/stitching/include/opencv2/stitching/detail/warpers.hpp
View file @
cd1ffd16
...
...
@@ -44,11 +44,8 @@
#define __OPENCV_STITCHING_WARPERS_HPP__
#include "opencv2/core/core.hpp"
#include "opencv2/core/gpumat.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
# include "opencv2/gpu/gpu.hpp"
#endif
namespace
cv
{
namespace
detail
{
...
...
@@ -331,7 +328,6 @@ public:
};
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
class
CV_EXPORTS
PlaneWarperGpu
:
public
PlaneWarper
{
public
:
...
...
@@ -448,7 +444,6 @@ public:
private
:
gpu
::
GpuMat
d_xmap_
,
d_ymap_
,
d_src_
,
d_dst_
;
};
#endif
struct
SphericalPortraitProjector
:
ProjectorBase
...
...
modules/stitching/include/opencv2/stitching/warpers.hpp
View file @
cd1ffd16
...
...
@@ -145,7 +145,6 @@ public:
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
class
PlaneWarperGpu
:
public
WarperCreator
{
public
:
...
...
@@ -165,7 +164,6 @@ class SphericalWarperGpu: public WarperCreator
public
:
Ptr
<
detail
::
RotationWarper
>
create
(
float
scale
)
const
{
return
new
detail
::
SphericalWarperGpu
(
scale
);
}
};
#endif
}
// namespace cv
...
...
modules/stitching/src/blenders.cpp
View file @
cd1ffd16
...
...
@@ -189,7 +189,7 @@ Rect FeatherBlender::createWeightMaps(const vector<Mat> &masks, const vector<Poi
MultiBandBlender
::
MultiBandBlender
(
int
try_gpu
,
int
num_bands
,
int
weight_type
)
{
setNumBands
(
num_bands
);
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
can_use_gpu_
=
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
();
#else
(
void
)
try_gpu
;
...
...
@@ -491,7 +491,7 @@ void createLaplacePyr(const Mat &img, int num_levels, vector<Mat> &pyr)
void
createLaplacePyrGpu
(
const
Mat
&
img
,
int
num_levels
,
vector
<
Mat
>
&
pyr
)
{
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
pyr
.
resize
(
num_levels
+
1
);
vector
<
gpu
::
GpuMat
>
gpu_pyr
(
num_levels
+
1
);
...
...
@@ -512,6 +512,7 @@ void createLaplacePyrGpu(const Mat &img, int num_levels, vector<Mat> &pyr)
(
void
)
img
;
(
void
)
num_levels
;
(
void
)
pyr
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
#endif
}
...
...
@@ -531,7 +532,7 @@ void restoreImageFromLaplacePyr(vector<Mat> &pyr)
void
restoreImageFromLaplacePyrGpu
(
vector
<
Mat
>
&
pyr
)
{
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
if
(
pyr
.
empty
())
return
;
...
...
@@ -549,6 +550,7 @@ void restoreImageFromLaplacePyrGpu(vector<Mat> &pyr)
gpu_pyr
[
0
].
download
(
pyr
[
0
]);
#else
(
void
)
pyr
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
#endif
}
...
...
modules/stitching/src/matchers.cpp
View file @
cd1ffd16
...
...
@@ -45,10 +45,7 @@
using
namespace
std
;
using
namespace
cv
;
using
namespace
cv
::
detail
;
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
using
namespace
cv
::
gpu
;
#endif
#ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree/nonfree.hpp"
...
...
@@ -129,7 +126,7 @@ private:
float
match_conf_
;
};
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
class
GpuMatcher
:
public
FeaturesMatcher
{
public
:
...
...
@@ -204,7 +201,7 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat
LOG
(
"1->2 & 2->1 matches: "
<<
matches_info
.
matches
.
size
()
<<
endl
);
}
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
void
GpuMatcher
::
match
(
const
ImageFeatures
&
features1
,
const
ImageFeatures
&
features2
,
MatchesInfo
&
matches_info
)
{
matches_info
.
matches
.
clear
();
...
...
@@ -432,7 +429,7 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features)
}
}
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
SurfFeaturesFinderGpu
::
SurfFeaturesFinderGpu
(
double
hess_thresh
,
int
num_octaves
,
int
num_layers
,
int
num_octaves_descr
,
int
num_layers_descr
)
{
...
...
@@ -478,6 +475,29 @@ void SurfFeaturesFinderGpu::collectGarbage()
keypoints_
.
release
();
descriptors_
.
release
();
}
#elif defined(HAVE_OPENCV_NONFREE)
SurfFeaturesFinderGpu
::
SurfFeaturesFinderGpu
(
double
hess_thresh
,
int
num_octaves
,
int
num_layers
,
int
num_octaves_descr
,
int
num_layers_descr
)
{
(
void
)
hess_thresh
;
(
void
)
num_octaves
;
(
void
)
num_layers
;
(
void
)
num_octaves_descr
;
(
void
)
num_layers_descr
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
void
SurfFeaturesFinderGpu
::
find
(
const
Mat
&
image
,
ImageFeatures
&
features
)
{
(
void
)
image
;
(
void
)
features
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
void
SurfFeaturesFinderGpu
::
collectGarbage
()
{
}
#endif
...
...
@@ -533,7 +553,7 @@ void FeaturesMatcher::operator ()(const vector<ImageFeatures> &features, vector<
BestOf2NearestMatcher
::
BestOf2NearestMatcher
(
bool
try_use_gpu
,
float
match_conf
,
int
num_matches_thresh1
,
int
num_matches_thresh2
)
{
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
if
(
try_use_gpu
&&
getCudaEnabledDeviceCount
()
>
0
)
impl_
=
new
GpuMatcher
(
match_conf
);
else
...
...
modules/stitching/src/precomp.hpp
View file @
cd1ffd16
...
...
@@ -68,7 +68,7 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
#include "opencv2/gpu/gpu.hpp"
#ifdef HAVE_OPENCV_NONFREE
...
...
modules/stitching/src/seam_finders.cpp
View file @
cd1ffd16
...
...
@@ -1318,7 +1318,7 @@ void GraphCutSeamFinder::find(const vector<Mat> &src, const vector<Point> &corne
}
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
void
GraphCutSeamFinderGpu
::
find
(
const
vector
<
Mat
>
&
src
,
const
vector
<
Point
>
&
corners
,
vector
<
Mat
>
&
masks
)
{
...
...
@@ -1642,6 +1642,62 @@ void GraphCutSeamFinderGpu::setGraphWeightsColorGrad(
}
}
}
#else
void
GraphCutSeamFinderGpu
::
find
(
const
vector
<
Mat
>
&
src
,
const
vector
<
Point
>
&
corners
,
vector
<
Mat
>
&
masks
)
{
(
void
)
src
;
(
void
)
corners
;
(
void
)
masks
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
void
GraphCutSeamFinderGpu
::
findInPair
(
size_t
first
,
size_t
second
,
Rect
roi
)
{
(
void
)
first
;
(
void
)
second
;
(
void
)
roi
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
void
GraphCutSeamFinderGpu
::
setGraphWeightsColor
(
const
Mat
&
img1
,
const
Mat
&
img2
,
const
Mat
&
mask1
,
const
Mat
&
mask2
,
Mat
&
terminals
,
Mat
&
leftT
,
Mat
&
rightT
,
Mat
&
top
,
Mat
&
bottom
)
{
(
void
)
img1
;
(
void
)
img2
;
(
void
)
mask1
;
(
void
)
mask2
;
(
void
)
terminals
;
(
void
)
leftT
;
(
void
)
rightT
;
(
void
)
top
;
(
void
)
bottom
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
void
GraphCutSeamFinderGpu
::
setGraphWeightsColorGrad
(
const
Mat
&
img1
,
const
Mat
&
img2
,
const
Mat
&
dx1
,
const
Mat
&
dx2
,
const
Mat
&
dy1
,
const
Mat
&
dy2
,
const
Mat
&
mask1
,
const
Mat
&
mask2
,
Mat
&
terminals
,
Mat
&
leftT
,
Mat
&
rightT
,
Mat
&
top
,
Mat
&
bottom
)
{
(
void
)
img1
;
(
void
)
img2
;
(
void
)
dx1
;
(
void
)
dx2
;
(
void
)
dy1
;
(
void
)
dy2
;
(
void
)
mask1
;
(
void
)
mask2
;
(
void
)
terminals
;
(
void
)
leftT
;
(
void
)
rightT
;
(
void
)
top
;
(
void
)
bottom
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
}
#endif
}
// namespace detail
...
...
modules/stitching/src/stitcher.cpp
View file @
cd1ffd16
...
...
@@ -58,7 +58,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
stitcher
.
setFeaturesMatcher
(
new
detail
::
BestOf2NearestMatcher
(
try_use_gpu
));
stitcher
.
setBundleAdjuster
(
new
detail
::
BundleAdjusterRay
());
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
if
(
try_use_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
{
#if defined(HAVE_OPENCV_NONFREE)
...
...
modules/stitching/src/warpers.cpp
View file @
cd1ffd16
...
...
@@ -212,7 +212,7 @@ void SphericalWarper::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_b
}
#if defined(HAVE_OPENCV_GPU) && !defined(
ANDROID
)
#if defined(HAVE_OPENCV_GPU) && !defined(
DYNAMIC_CUDA_SUPPORT
)
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
);
...
...
@@ -294,6 +294,96 @@ Point CylindricalWarperGpu::warp(const gpu::GpuMat &src, const Mat &K, const Mat
gpu
::
remap
(
src
,
dst
,
d_xmap_
,
d_ymap_
,
interp_mode
,
border_mode
);
return
dst_roi
.
tl
();
}
#else
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
);
}
Rect
PlaneWarperGpu
::
buildMaps
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
,
const
Mat
&
T
,
gpu
::
GpuMat
&
xmap
,
gpu
::
GpuMat
&
ymap
)
{
(
void
)
src_size
;
(
void
)
K
;
(
void
)
R
;
(
void
)
T
;
(
void
)
xmap
;
(
void
)
ymap
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Rect
();
}
Point
PlaneWarperGpu
::
warp
(
const
gpu
::
GpuMat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
int
interp_mode
,
int
border_mode
,
gpu
::
GpuMat
&
dst
)
{
return
warp
(
src
,
K
,
R
,
Mat
::
zeros
(
3
,
1
,
CV_32F
),
interp_mode
,
border_mode
,
dst
);
}
Point
PlaneWarperGpu
::
warp
(
const
gpu
::
GpuMat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
const
Mat
&
T
,
int
interp_mode
,
int
border_mode
,
gpu
::
GpuMat
&
dst
)
{
(
void
)
src
;
(
void
)
K
;
(
void
)
R
;
(
void
)
T
;
(
void
)
interp_mode
;
(
void
)
border_mode
;
(
void
)
dst
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Point
();
}
Rect
SphericalWarperGpu
::
buildMaps
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
,
gpu
::
GpuMat
&
xmap
,
gpu
::
GpuMat
&
ymap
)
{
(
void
)
src_size
;
(
void
)
K
;
(
void
)
R
;
(
void
)
xmap
;
(
void
)
ymap
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Rect
();
}
Point
SphericalWarperGpu
::
warp
(
const
gpu
::
GpuMat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
int
interp_mode
,
int
border_mode
,
gpu
::
GpuMat
&
dst
)
{
(
void
)
src
;
(
void
)
K
;
(
void
)
R
;
(
void
)
interp_mode
;
(
void
)
border_mode
;
(
void
)
dst
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Point
();
}
Rect
CylindricalWarperGpu
::
buildMaps
(
Size
src_size
,
const
Mat
&
K
,
const
Mat
&
R
,
gpu
::
GpuMat
&
xmap
,
gpu
::
GpuMat
&
ymap
)
{
(
void
)
src_size
;
(
void
)
K
;
(
void
)
R
;
(
void
)
xmap
;
(
void
)
ymap
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Rect
();
}
Point
CylindricalWarperGpu
::
warp
(
const
gpu
::
GpuMat
&
src
,
const
Mat
&
K
,
const
Mat
&
R
,
int
interp_mode
,
int
border_mode
,
gpu
::
GpuMat
&
dst
)
{
(
void
)
src
;
(
void
)
K
;
(
void
)
R
;
(
void
)
interp_mode
;
(
void
)
border_mode
;
(
void
)
dst
;
CV_Error
(
CV_StsNotImplemented
,
"CUDA optimization is unavailable"
);
return
Point
();
}
#endif
void
SphericalPortraitWarper
::
detectResultRoi
(
Size
src_size
,
Point
&
dst_tl
,
Point
&
dst_br
)
...
...
samples/cpp/stitching_detailed.cpp
View file @
cd1ffd16
...
...
@@ -355,7 +355,7 @@ int main(int argc, char* argv[])
Ptr
<
FeaturesFinder
>
finder
;
if
(
features_type
==
"surf"
)
{
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
&& !defined(ANDROID)
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
finder
=
new
SurfFeaturesFinderGpu
();
else
...
...
@@ -543,7 +543,7 @@ int main(int argc, char* argv[])
// Warp images and their masks
Ptr
<
WarperCreator
>
warper_creator
;
#if defined(HAVE_OPENCV_GPU)
&& !defined(ANDROID)
#if defined(HAVE_OPENCV_GPU)
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
{
if
(
warp_type
==
"plane"
)
warper_creator
=
new
cv
::
PlaneWarperGpu
();
...
...
@@ -608,7 +608,7 @@ int main(int argc, char* argv[])
seam_finder
=
new
detail
::
VoronoiSeamFinder
();
else
if
(
seam_find_type
==
"gc_color"
)
{
#if defined(HAVE_OPENCV_GPU)
&& !defined(ANDROID)
#if defined(HAVE_OPENCV_GPU)
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
seam_finder
=
new
detail
::
GraphCutSeamFinderGpu
(
GraphCutSeamFinderBase
::
COST_COLOR
);
else
...
...
@@ -617,7 +617,7 @@ int main(int argc, char* argv[])
}
else
if
(
seam_find_type
==
"gc_colorgrad"
)
{
#if defined(HAVE_OPENCV_GPU)
&& !defined(ANDROID)
#if defined(HAVE_OPENCV_GPU)
if
(
try_gpu
&&
gpu
::
getCudaEnabledDeviceCount
()
>
0
)
seam_finder
=
new
detail
::
GraphCutSeamFinderGpu
(
GraphCutSeamFinderBase
::
COST_COLOR_GRAD
);
else
...
...
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