exclude compactPoints and calcWobbleSuppressionMaps from compilation

if they are not needed
pull/3638/head
Vladislav Vinogradov 10 years ago
parent 6ebc95470b
commit c9e07bbc95
  1. 49
      modules/videostab/src/global_motion.cpp
  2. 59
      modules/videostab/src/wobble_suppression.cpp

@ -49,34 +49,31 @@
#include "opencv2/core/private.cuda.hpp" #include "opencv2/core/private.cuda.hpp"
#if !defined HAVE_CUDA || defined(CUDA_DISABLER) #if defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW)
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace cv { namespace cuda { namespace cv { namespace cuda {
static void compactPoints(GpuMat&, GpuMat&, const GpuMat&) { throw_no_cuda(); } static void compactPoints(GpuMat&, GpuMat&, const GpuMat&) { throw_no_cuda(); }
}} }}
#else
#else namespace cv { namespace cuda { namespace device { namespace globmotion {
int compactPoints(int N, float *points0, float *points1, const uchar *mask);
namespace cv { namespace cuda { namespace device { namespace globmotion { }}}}
int compactPoints(int N, float *points0, float *points1, const uchar *mask); namespace cv { namespace cuda {
}}}} static void compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask)
{
namespace cv { namespace cuda { CV_Assert(points0.rows == 1 && points1.rows == 1 && mask.rows == 1);
static void compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask) CV_Assert(points0.type() == CV_32FC2 && points1.type() == CV_32FC2 && mask.type() == CV_8U);
{ CV_Assert(points0.cols == mask.cols && points1.cols == mask.cols);
CV_Assert(points0.rows == 1 && points1.rows == 1 && mask.rows == 1);
CV_Assert(points0.type() == CV_32FC2 && points1.type() == CV_32FC2 && mask.type() == CV_8U);
CV_Assert(points0.cols == mask.cols && points1.cols == mask.cols);
int npoints = points0.cols; int npoints = points0.cols;
int remaining = cv::cuda::device::globmotion::compactPoints( int remaining = cv::cuda::device::globmotion::compactPoints(
npoints, (float*)points0.data, (float*)points1.data, mask.data); npoints, (float*)points0.data, (float*)points1.data, mask.data);
points0 = points0.colRange(0, remaining);
points1 = points1.colRange(0, remaining);
}
}}
points0 = points0.colRange(0, remaining);
points1 = points1.colRange(0, remaining);
}
}}
#endif
#endif #endif
namespace cv namespace cv

@ -50,37 +50,34 @@
# include "opencv2/cudawarping.hpp" # include "opencv2/cudawarping.hpp"
#endif #endif
#if !defined HAVE_CUDA || defined(CUDA_DISABLER) #if defined(HAVE_OPENCV_CUDAWARPING)
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
namespace cv { namespace cuda { namespace cv { namespace cuda {
static void calcWobbleSuppressionMaps(int, int, int, Size, const Mat&, const Mat&, GpuMat&, GpuMat&) { throw_no_cuda(); } static void calcWobbleSuppressionMaps(int, int, int, Size, const Mat&, const Mat&, GpuMat&, GpuMat&) { throw_no_cuda(); }
}} }}
#else
#else namespace cv { namespace cuda { namespace device { namespace globmotion {
void calcWobbleSuppressionMaps(
namespace cv { namespace cuda { namespace device { namespace globmotion { int left, int idx, int right, int width, int height,
void calcWobbleSuppressionMaps( const float *ml, const float *mr, PtrStepSzf mapx, PtrStepSzf mapy);
int left, int idx, int right, int width, int height, }}}}
const float *ml, const float *mr, PtrStepSzf mapx, PtrStepSzf mapy); namespace cv { namespace cuda {
}}}} static void calcWobbleSuppressionMaps(
int left, int idx, int right, Size size, const Mat &ml, const Mat &mr,
namespace cv { namespace cuda { GpuMat &mapx, GpuMat &mapy)
static void calcWobbleSuppressionMaps( {
int left, int idx, int right, Size size, const Mat &ml, const Mat &mr, CV_Assert(ml.size() == Size(3, 3) && ml.type() == CV_32F && ml.isContinuous());
GpuMat &mapx, GpuMat &mapy) CV_Assert(mr.size() == Size(3, 3) && mr.type() == CV_32F && mr.isContinuous());
{
CV_Assert(ml.size() == Size(3, 3) && ml.type() == CV_32F && ml.isContinuous()); mapx.create(size, CV_32F);
CV_Assert(mr.size() == Size(3, 3) && mr.type() == CV_32F && mr.isContinuous()); mapy.create(size, CV_32F);
mapx.create(size, CV_32F); cv::cuda::device::globmotion::calcWobbleSuppressionMaps(
mapy.create(size, CV_32F); left, idx, right, size.width, size.height,
ml.ptr<float>(), mr.ptr<float>(), mapx, mapy);
cv::cuda::device::globmotion::calcWobbleSuppressionMaps( }
left, idx, right, size.width, size.height, }}
ml.ptr<float>(), mr.ptr<float>(), mapx, mapy); #endif
}
}}
#endif #endif
namespace cv namespace cv

Loading…
Cancel
Save