renamed gpu namespace -> cuda
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace cv { namespace gpu {
|
||||
namespace cv { namespace cuda {
|
||||
|
||||
//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector //////////////
|
||||
|
||||
@@ -255,6 +255,6 @@ CV_EXPORTS void calcWobbleSuppressionMaps(
|
||||
int left, int idx, int right, Size size, const Mat &ml, const Mat &mr,
|
||||
GpuMat &mapx, GpuMat &mapy);
|
||||
|
||||
}} // namespace cv { namespace gpu {
|
||||
}} // namespace cv { namespace cuda {
|
||||
|
||||
#endif /* __OPENCV_GPU_HPP__ */
|
||||
|
||||
@@ -65,10 +65,10 @@ PERF_TEST_P(Count, Calib3D_ProjectPoints,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
const cv::gpu::GpuMat d_src(src);
|
||||
cv::gpu::GpuMat dst;
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::gpu::projectPoints(d_src, rvec, tvec, camera_mat, cv::Mat(), dst);
|
||||
TEST_CYCLE() cv::cuda::projectPoints(d_src, rvec, tvec, camera_mat, cv::Mat(), dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ PERF_TEST_P(Count, Calib3D_SolvePnPRansac,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
TEST_CYCLE() cv::gpu::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
|
||||
TEST_CYCLE() cv::cuda::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
|
||||
|
||||
GPU_SANITY_CHECK(rvec, 1e-3);
|
||||
GPU_SANITY_CHECK(tvec, 1e-3);
|
||||
|
||||
@@ -151,10 +151,10 @@ PERF_TEST_P(Image, DISABLED_Labeling_ConnectivityMask,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_image(image);
|
||||
cv::gpu::GpuMat mask;
|
||||
cv::cuda::GpuMat d_image(image);
|
||||
cv::cuda::GpuMat mask;
|
||||
|
||||
TEST_CYCLE() cv::gpu::connectivityMask(d_image, mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
TEST_CYCLE() cv::cuda::connectivityMask(d_image, mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
|
||||
GPU_SANITY_CHECK(mask);
|
||||
}
|
||||
@@ -174,12 +174,12 @@ PERF_TEST_P(Image, DISABLED_Labeling_ConnectedComponents,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_mask;
|
||||
cv::gpu::connectivityMask(cv::gpu::GpuMat(image), d_mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
cv::cuda::GpuMat d_mask;
|
||||
cv::cuda::connectivityMask(cv::cuda::GpuMat(image), d_mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
|
||||
cv::gpu::GpuMat components;
|
||||
cv::cuda::GpuMat components;
|
||||
|
||||
TEST_CYCLE() cv::gpu::labelComponents(d_mask, components);
|
||||
TEST_CYCLE() cv::cuda::labelComponents(d_mask, components);
|
||||
|
||||
GPU_SANITY_CHECK(components);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetTo,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat dst(size, type);
|
||||
cv::cuda::GpuMat dst(size, type);
|
||||
|
||||
TEST_CYCLE() dst.setTo(val);
|
||||
|
||||
@@ -102,8 +102,8 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetToMasked,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat dst(src);
|
||||
const cv::gpu::GpuMat d_mask(mask);
|
||||
cv::cuda::GpuMat dst(src);
|
||||
const cv::cuda::GpuMat d_mask(mask);
|
||||
|
||||
TEST_CYCLE() dst.setTo(val, d_mask);
|
||||
|
||||
@@ -139,9 +139,9 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_CopyToMasked,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
const cv::gpu::GpuMat d_src(src);
|
||||
const cv::gpu::GpuMat d_mask(mask);
|
||||
cv::gpu::GpuMat dst(d_src.size(), d_src.type(), cv::Scalar::all(0));
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
const cv::cuda::GpuMat d_mask(mask);
|
||||
cv::cuda::GpuMat dst(d_src.size(), d_src.type(), cv::Scalar::all(0));
|
||||
|
||||
TEST_CYCLE() d_src.copyTo(dst, d_mask);
|
||||
|
||||
@@ -179,8 +179,8 @@ PERF_TEST_P(Sz_2Depth, MatOp_ConvertTo,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
const cv::gpu::GpuMat d_src(src);
|
||||
cv::gpu::GpuMat dst;
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() d_src.convertTo(dst, depth2, a, b);
|
||||
|
||||
|
||||
@@ -68,11 +68,11 @@ PERF_TEST_P(Image, ObjDetect_HOG,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
const cv::gpu::GpuMat d_img(img);
|
||||
const cv::cuda::GpuMat d_img(img);
|
||||
std::vector<cv::Rect> gpu_found_locations;
|
||||
|
||||
cv::gpu::HOGDescriptor d_hog;
|
||||
d_hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
|
||||
cv::cuda::HOGDescriptor d_hog;
|
||||
d_hog.setSVMDetector(cv::cuda::HOGDescriptor::getDefaultPeopleDetector());
|
||||
|
||||
TEST_CYCLE() d_hog.detectMultiScale(d_img, gpu_found_locations);
|
||||
|
||||
@@ -83,7 +83,7 @@ PERF_TEST_P(Image, ObjDetect_HOG,
|
||||
std::vector<cv::Rect> cpu_found_locations;
|
||||
|
||||
cv::HOGDescriptor hog;
|
||||
hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
|
||||
hog.setSVMDetector(cv::cuda::HOGDescriptor::getDefaultPeopleDetector());
|
||||
|
||||
TEST_CYCLE() hog.detectMultiScale(img, cpu_found_locations);
|
||||
|
||||
@@ -105,11 +105,11 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_HaarClassifier,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::CascadeClassifier_GPU d_cascade;
|
||||
cv::cuda::CascadeClassifier_GPU d_cascade;
|
||||
ASSERT_TRUE(d_cascade.load(perf::TestBase::getDataPath(GetParam().second)));
|
||||
|
||||
const cv::gpu::GpuMat d_img(img);
|
||||
cv::gpu::GpuMat objects_buffer;
|
||||
const cv::cuda::GpuMat d_img(img);
|
||||
cv::cuda::GpuMat objects_buffer;
|
||||
int detections_num = 0;
|
||||
|
||||
TEST_CYCLE() detections_num = d_cascade.detectMultiScale(d_img, objects_buffer);
|
||||
@@ -144,11 +144,11 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_LBPClassifier,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::CascadeClassifier_GPU d_cascade;
|
||||
cv::cuda::CascadeClassifier_GPU d_cascade;
|
||||
ASSERT_TRUE(d_cascade.load(perf::TestBase::getDataPath(GetParam().second)));
|
||||
|
||||
const cv::gpu::GpuMat d_img(img);
|
||||
cv::gpu::GpuMat objects_buffer;
|
||||
const cv::cuda::GpuMat d_img(img);
|
||||
cv::cuda::GpuMat objects_buffer;
|
||||
int detections_num = 0;
|
||||
|
||||
TEST_CYCLE() detections_num = d_cascade.detectMultiScale(d_img, objects_buffer);
|
||||
|
||||
@@ -80,10 +80,10 @@ PERF_TEST_P(Image, HoughLinesP, testing::Values(std::string("im1_1280x800.jpg"))
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_image(image);
|
||||
cv::gpu::GpuMat d_lines;
|
||||
cv::cuda::GpuMat d_image(image);
|
||||
cv::cuda::GpuMat d_lines;
|
||||
|
||||
cv::Ptr<cv::gpu::HoughSegmentDetector> hough = cv::gpu::createHoughSegmentDetector(rho, theta, minLineLenght, maxLineGap);
|
||||
cv::Ptr<cv::cuda::HoughSegmentDetector> hough = cv::cuda::createHoughSegmentDetector(rho, theta, minLineLenght, maxLineGap);
|
||||
|
||||
hough->detect(d_image, d_lines);
|
||||
|
||||
@@ -144,11 +144,11 @@ PERF_TEST_P(Image_Depth, GoodFeaturesToTrack,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::Ptr<cv::gpu::CornersDetector> detector = cv::gpu::createGoodFeaturesToTrackDetector(src.type(), maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k);
|
||||
cv::Ptr<cv::cuda::CornersDetector> detector = cv::cuda::createGoodFeaturesToTrackDetector(src.type(), maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k);
|
||||
|
||||
cv::gpu::GpuMat d_src(src);
|
||||
cv::gpu::GpuMat d_mask(mask);
|
||||
cv::gpu::GpuMat d_pts;
|
||||
cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat d_mask(mask);
|
||||
cv::cuda::GpuMat d_pts;
|
||||
|
||||
detector->detect(d_src, d_pts, d_mask);
|
||||
|
||||
@@ -233,13 +233,13 @@ PERF_TEST_P(ImagePair_Depth_GraySource, OpticalFlowPyrLKSparse,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_src1(src1);
|
||||
cv::gpu::GpuMat d_src2(src2);
|
||||
cv::gpu::GpuMat d_pts(pts.reshape(2, 1));
|
||||
cv::gpu::GpuMat d_nextPts;
|
||||
cv::gpu::GpuMat d_status;
|
||||
cv::cuda::GpuMat d_src1(src1);
|
||||
cv::cuda::GpuMat d_src2(src2);
|
||||
cv::cuda::GpuMat d_pts(pts.reshape(2, 1));
|
||||
cv::cuda::GpuMat d_nextPts;
|
||||
cv::cuda::GpuMat d_status;
|
||||
|
||||
cv::gpu::PyrLKOpticalFlow d_pyrLK;
|
||||
cv::cuda::PyrLKOpticalFlow d_pyrLK;
|
||||
d_pyrLK.winSize = winSize;
|
||||
d_pyrLK.maxLevel = maxLevel;
|
||||
d_pyrLK.iters = criteria.maxCount;
|
||||
@@ -311,12 +311,12 @@ PERF_TEST_P(ImagePair_Depth, OpticalFlowFarneback,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_src1(src1);
|
||||
cv::gpu::GpuMat d_src2(src2);
|
||||
cv::gpu::GpuMat d_u(src1.size(), CV_32FC1, cv::Scalar::all(0));
|
||||
cv::gpu::GpuMat d_v(src1.size(), CV_32FC1, cv::Scalar::all(0));
|
||||
cv::cuda::GpuMat d_src1(src1);
|
||||
cv::cuda::GpuMat d_src2(src2);
|
||||
cv::cuda::GpuMat d_u(src1.size(), CV_32FC1, cv::Scalar::all(0));
|
||||
cv::cuda::GpuMat d_v(src1.size(), CV_32FC1, cv::Scalar::all(0));
|
||||
|
||||
cv::gpu::FarnebackOpticalFlow d_farneback;
|
||||
cv::cuda::FarnebackOpticalFlow d_farneback;
|
||||
d_farneback.pyrScale = pyrScale;
|
||||
d_farneback.numLevels = numLevels;
|
||||
d_farneback.winSize = winSize;
|
||||
@@ -398,15 +398,15 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, OpticalFlowBM,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_src1(src1);
|
||||
cv::gpu::GpuMat d_src2(src2);
|
||||
cv::gpu::GpuMat d_velx, d_vely, buf;
|
||||
cv::cuda::GpuMat d_src1(src1);
|
||||
cv::cuda::GpuMat d_src2(src2);
|
||||
cv::cuda::GpuMat d_velx, d_vely, buf;
|
||||
|
||||
cv::gpu::calcOpticalFlowBM(d_src1, d_src2, block_size, shift_size, max_range, false, d_velx, d_vely, buf);
|
||||
cv::cuda::calcOpticalFlowBM(d_src1, d_src2, block_size, shift_size, max_range, false, d_velx, d_vely, buf);
|
||||
|
||||
TEST_CYCLE_N(10)
|
||||
{
|
||||
cv::gpu::calcOpticalFlowBM(d_src1, d_src2, block_size, shift_size, max_range, false, d_velx, d_vely, buf);
|
||||
cv::cuda::calcOpticalFlowBM(d_src1, d_src2, block_size, shift_size, max_range, false, d_velx, d_vely, buf);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -449,11 +449,11 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, FastOpticalFlowBM,
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
{
|
||||
cv::gpu::GpuMat d_src1(src1);
|
||||
cv::gpu::GpuMat d_src2(src2);
|
||||
cv::gpu::GpuMat d_velx, d_vely;
|
||||
cv::cuda::GpuMat d_src1(src1);
|
||||
cv::cuda::GpuMat d_src2(src2);
|
||||
cv::cuda::GpuMat d_velx, d_vely;
|
||||
|
||||
cv::gpu::FastOpticalFlowBM fastBM;
|
||||
cv::cuda::FastOpticalFlowBM fastBM;
|
||||
|
||||
fastBM(d_src1, d_src2, d_velx, d_vely, max_range.width, block_size.width);
|
||||
|
||||
|
||||
@@ -43,19 +43,19 @@
|
||||
#include "precomp.hpp"
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
using namespace cv::cuda;
|
||||
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
|
||||
void cv::gpu::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
|
||||
void cv::gpu::projectPoints(const GpuMat&, const Mat&, const Mat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::projectPoints(const GpuMat&, const Mat&, const Mat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
|
||||
void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, std::vector<int>*) { throw_no_cuda(); }
|
||||
void cv::cuda::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, std::vector<int>*) { throw_no_cuda(); }
|
||||
|
||||
#else
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace transform_points
|
||||
{
|
||||
@@ -78,7 +78,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
}
|
||||
}}}
|
||||
|
||||
using namespace ::cv::gpu::cudev;
|
||||
using namespace ::cv::cuda::cudev;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gpu::transformPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec, GpuMat& dst, Stream& stream)
|
||||
void cv::cuda::transformPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec, GpuMat& dst, Stream& stream)
|
||||
{
|
||||
transformPointsCaller(src, rvec, tvec, dst, StreamAccessor::getStream(stream));
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gpu::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec, const Mat& camera_mat, const Mat& dist_coef, GpuMat& dst, Stream& stream)
|
||||
void cv::cuda::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec, const Mat& camera_mat, const Mat& dist_coef, GpuMat& dst, Stream& stream)
|
||||
{
|
||||
projectPointsCaller(src, rvec, tvec, camera_mat, dist_coef, dst, StreamAccessor::getStream(stream));
|
||||
}
|
||||
@@ -208,7 +208,7 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat,
|
||||
void cv::cuda::solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat,
|
||||
const Mat& dist_coef, Mat& rvec, Mat& tvec, bool use_extrinsic_guess,
|
||||
int num_iters, float max_dist, int min_inlier_count,
|
||||
std::vector<int>* inliers)
|
||||
@@ -252,7 +252,7 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam
|
||||
// Find the best hypothesis index
|
||||
Point best_idx;
|
||||
double best_score;
|
||||
gpu::minMaxLoc(d_hypothesis_scores, NULL, &best_score, NULL, &best_idx);
|
||||
cuda::minMaxLoc(d_hypothesis_scores, NULL, &best_score, NULL, &best_idx);
|
||||
int num_inliers = static_cast<int>(best_score);
|
||||
|
||||
// Extract the best hypothesis data
|
||||
|
||||
@@ -44,23 +44,23 @@
|
||||
#include "opencv2/objdetect/objdetect_c.h"
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
using namespace cv::cuda;
|
||||
|
||||
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_no_cuda(); }
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const String&) { throw_no_cuda(); }
|
||||
cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { throw_no_cuda(); }
|
||||
bool cv::gpu::CascadeClassifier_GPU::empty() const { throw_no_cuda(); return true; }
|
||||
bool cv::gpu::CascadeClassifier_GPU::load(const String&) { throw_no_cuda(); return true; }
|
||||
Size cv::gpu::CascadeClassifier_GPU::getClassifierSize() const { throw_no_cuda(); return Size();}
|
||||
void cv::gpu::CascadeClassifier_GPU::release() { throw_no_cuda(); }
|
||||
int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, double, int, Size) {throw_no_cuda(); return -1;}
|
||||
int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, Size, Size, double, int) {throw_no_cuda(); return -1;}
|
||||
cv::cuda::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_no_cuda(); }
|
||||
cv::cuda::CascadeClassifier_GPU::CascadeClassifier_GPU(const String&) { throw_no_cuda(); }
|
||||
cv::cuda::CascadeClassifier_GPU::~CascadeClassifier_GPU() { throw_no_cuda(); }
|
||||
bool cv::cuda::CascadeClassifier_GPU::empty() const { throw_no_cuda(); return true; }
|
||||
bool cv::cuda::CascadeClassifier_GPU::load(const String&) { throw_no_cuda(); return true; }
|
||||
Size cv::cuda::CascadeClassifier_GPU::getClassifierSize() const { throw_no_cuda(); return Size();}
|
||||
void cv::cuda::CascadeClassifier_GPU::release() { throw_no_cuda(); }
|
||||
int cv::cuda::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, double, int, Size) {throw_no_cuda(); return -1;}
|
||||
int cv::cuda::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, Size, Size, double, int) {throw_no_cuda(); return -1;}
|
||||
|
||||
#else
|
||||
|
||||
struct cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
struct cv::cuda::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
{
|
||||
public:
|
||||
CascadeClassifierImpl(){}
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
#ifndef HAVE_OPENCV_GPULEGACY
|
||||
|
||||
struct cv::gpu::CascadeClassifier_GPU::HaarCascade : cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
struct cv::cuda::CascadeClassifier_GPU::HaarCascade : cv::cuda::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
{
|
||||
public:
|
||||
HaarCascade()
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
|
||||
#else
|
||||
|
||||
struct cv::gpu::CascadeClassifier_GPU::HaarCascade : cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
struct cv::cuda::CascadeClassifier_GPU::HaarCascade : cv::cuda::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
{
|
||||
public:
|
||||
HaarCascade() : lastAllocatedFrameSize(-1, -1)
|
||||
@@ -203,7 +203,7 @@ private:
|
||||
|
||||
NCVStatus load(const String& classifierFile)
|
||||
{
|
||||
int devId = cv::gpu::getDevice();
|
||||
int devId = cv::cuda::getDevice();
|
||||
ncvAssertCUDAReturn(cudaGetDeviceProperties(&devProp, devId), NCV_CUDA_ERROR);
|
||||
|
||||
// Load the classifier from file (assuming its size is about 1 mb) using a simple allocator
|
||||
@@ -372,7 +372,7 @@ struct PyrLavel
|
||||
cv::Size sWindow;
|
||||
};
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace lbp
|
||||
{
|
||||
@@ -398,7 +398,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
}
|
||||
}}}
|
||||
|
||||
struct cv::gpu::CascadeClassifier_GPU::LbpCascade : cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
struct cv::cuda::CascadeClassifier_GPU::LbpCascade : cv::cuda::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
{
|
||||
public:
|
||||
struct Stage
|
||||
@@ -457,8 +457,8 @@ public:
|
||||
GpuMat buff = integralBuffer;
|
||||
|
||||
// generate integral for scale
|
||||
gpu::resize(image, src, level.sFrame, 0, 0, cv::INTER_LINEAR);
|
||||
gpu::integral(src, sint, buff);
|
||||
cuda::resize(image, src, level.sFrame, 0, 0, cv::INTER_LINEAR);
|
||||
cuda::integral(src, sint, buff);
|
||||
|
||||
// calculate job
|
||||
int totalWidth = level.workArea.width / step;
|
||||
@@ -515,7 +515,7 @@ private:
|
||||
roiSize.height = frame.height;
|
||||
|
||||
cudaDeviceProp prop;
|
||||
cudaSafeCall( cudaGetDeviceProperties(&prop, cv::gpu::getDevice()) );
|
||||
cudaSafeCall( cudaGetDeviceProperties(&prop, cv::cuda::getDevice()) );
|
||||
|
||||
Ncv32u bufSize;
|
||||
ncvSafeCall( nppiStIntegralGetSize_8u32u(roiSize, &bufSize, prop) );
|
||||
@@ -694,36 +694,36 @@ private:
|
||||
static const int integralFactor = 4;
|
||||
};
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU()
|
||||
cv::cuda::CascadeClassifier_GPU::CascadeClassifier_GPU()
|
||||
: findLargestObject(false), visualizeInPlace(false), impl(0) {}
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const String& filename)
|
||||
cv::cuda::CascadeClassifier_GPU::CascadeClassifier_GPU(const String& filename)
|
||||
: findLargestObject(false), visualizeInPlace(false), impl(0) { load(filename); }
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { release(); }
|
||||
cv::cuda::CascadeClassifier_GPU::~CascadeClassifier_GPU() { release(); }
|
||||
|
||||
void cv::gpu::CascadeClassifier_GPU::release() { if (impl) { delete impl; impl = 0; } }
|
||||
void cv::cuda::CascadeClassifier_GPU::release() { if (impl) { delete impl; impl = 0; } }
|
||||
|
||||
bool cv::gpu::CascadeClassifier_GPU::empty() const { return impl == 0; }
|
||||
bool cv::cuda::CascadeClassifier_GPU::empty() const { return impl == 0; }
|
||||
|
||||
Size cv::gpu::CascadeClassifier_GPU::getClassifierSize() const
|
||||
Size cv::cuda::CascadeClassifier_GPU::getClassifierSize() const
|
||||
{
|
||||
return this->empty() ? Size() : impl->getClassifierCvSize();
|
||||
}
|
||||
|
||||
int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat& image, GpuMat& objectsBuf, double scaleFactor, int minNeighbors, Size minSize)
|
||||
int cv::cuda::CascadeClassifier_GPU::detectMultiScale( const GpuMat& image, GpuMat& objectsBuf, double scaleFactor, int minNeighbors, Size minSize)
|
||||
{
|
||||
CV_Assert( !this->empty());
|
||||
return impl->process(image, objectsBuf, (float)scaleFactor, minNeighbors, findLargestObject, visualizeInPlace, minSize, cv::Size());
|
||||
}
|
||||
|
||||
int cv::gpu::CascadeClassifier_GPU::detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, Size maxObjectSize, Size minSize, double scaleFactor, int minNeighbors)
|
||||
int cv::cuda::CascadeClassifier_GPU::detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, Size maxObjectSize, Size minSize, double scaleFactor, int minNeighbors)
|
||||
{
|
||||
CV_Assert( !this->empty());
|
||||
return impl->process(image, objectsBuf, (float)scaleFactor, minNeighbors, findLargestObject, visualizeInPlace, minSize, maxObjectSize);
|
||||
}
|
||||
|
||||
bool cv::gpu::CascadeClassifier_GPU::load(const String& filename)
|
||||
bool cv::cuda::CascadeClassifier_GPU::load(const String& filename)
|
||||
{
|
||||
release();
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "opencv2/core/cuda/functional.hpp"
|
||||
#include "opencv2/core/cuda/reduce.hpp"
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
#define SOLVE_PNP_RANSAC_MAX_NUM_ITERS 200
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot1, rot + 3, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(crot2, rot + 6, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3));
|
||||
cv::gpu::cudev::transform(src, dst, TransformOp(), WithOutMask(), stream);
|
||||
cv::cuda::cudev::transform(src, dst, TransformOp(), WithOutMask(), stream);
|
||||
}
|
||||
} // namespace transform_points
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
cudaSafeCall(cudaMemcpyToSymbol(ctransl, transl, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(cproj0, proj, sizeof(float) * 3));
|
||||
cudaSafeCall(cudaMemcpyToSymbol(cproj1, proj + 3, sizeof(float) * 3));
|
||||
cv::gpu::cudev::transform(src, dst, ProjectOp(), WithOutMask(), stream);
|
||||
cv::cuda::cudev::transform(src, dst, ProjectOp(), WithOutMask(), stream);
|
||||
}
|
||||
} // namespace project_points
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
cudaSafeCall( cudaDeviceSynchronize() );
|
||||
}
|
||||
} // namespace solvepnp_ransac
|
||||
}}} // namespace cv { namespace gpu { namespace cudev
|
||||
}}} // namespace cv { namespace cuda { namespace cudev
|
||||
|
||||
|
||||
#endif /* CUDA_DISABLER */
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace ccl
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <thrust/functional.h>
|
||||
#include "opencv2/core/cuda/common.hpp"
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev { namespace globmotion {
|
||||
namespace cv { namespace cuda { namespace cudev { namespace globmotion {
|
||||
|
||||
__constant__ float cml[9];
|
||||
__constant__ float cmr[9];
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "opencv2/core/cuda/functional.hpp"
|
||||
#include "opencv2/core/cuda/warp_shuffle.hpp"
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
// Other values are not supported
|
||||
#define CELL_WIDTH 8
|
||||
@@ -808,7 +808,7 @@ namespace cv { namespace gpu { namespace cudev
|
||||
void resize_8UC1(const PtrStepSzb& src, PtrStepSzb dst) { resize_for_hog<uchar> (src, dst, resize8UC1_tex); }
|
||||
void resize_8UC4(const PtrStepSzb& src, PtrStepSzb dst) { resize_for_hog<uchar4>(src, dst, resize8UC4_tex); }
|
||||
} // namespace hog
|
||||
}}} // namespace cv { namespace gpu { namespace cudev
|
||||
}}} // namespace cv { namespace cuda { namespace cudev
|
||||
|
||||
|
||||
#endif /* CUDA_DISABLER */
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "opencv2/core/cuda/vec_traits.hpp"
|
||||
#include "opencv2/core/cuda/saturate_cast.hpp"
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace lbp
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "opencv2/core/cuda/common.hpp"
|
||||
#include "opencv2/core/cuda/emulation.hpp"
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev {
|
||||
namespace cv { namespace cuda { namespace cudev {
|
||||
|
||||
namespace lbp {
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@
|
||||
#include "precomp.hpp"
|
||||
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
using namespace cv::cuda;
|
||||
|
||||
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
|
||||
|
||||
void cv::gpu::compactPoints(GpuMat&, GpuMat&, const GpuMat&) { throw_no_cuda(); }
|
||||
void cv::gpu::calcWobbleSuppressionMaps(
|
||||
void cv::cuda::compactPoints(GpuMat&, GpuMat&, const GpuMat&) { throw_no_cuda(); }
|
||||
void cv::cuda::calcWobbleSuppressionMaps(
|
||||
int, int, int, Size, const Mat&, const Mat&, GpuMat&, GpuMat&) { throw_no_cuda(); }
|
||||
|
||||
#else
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev { namespace globmotion {
|
||||
namespace cv { namespace cuda { namespace cudev { namespace globmotion {
|
||||
|
||||
int compactPoints(int N, float *points0, float *points1, const uchar *mask);
|
||||
|
||||
@@ -63,14 +63,14 @@ namespace cv { namespace gpu { namespace cudev { namespace globmotion {
|
||||
|
||||
}}}}
|
||||
|
||||
void cv::gpu::compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask)
|
||||
void cv::cuda::compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask)
|
||||
{
|
||||
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 remaining = cv::gpu::cudev::globmotion::compactPoints(
|
||||
int remaining = cv::cuda::cudev::globmotion::compactPoints(
|
||||
npoints, (float*)points0.data, (float*)points1.data, mask.data);
|
||||
|
||||
points0 = points0.colRange(0, remaining);
|
||||
@@ -78,7 +78,7 @@ void cv::gpu::compactPoints(GpuMat &points0, GpuMat &points1, const GpuMat &mask
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::calcWobbleSuppressionMaps(
|
||||
void cv::cuda::calcWobbleSuppressionMaps(
|
||||
int left, int idx, int right, Size size, const Mat &ml, const Mat &mr,
|
||||
GpuMat &mapx, GpuMat &mapy)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ void cv::gpu::calcWobbleSuppressionMaps(
|
||||
mapx.create(size, CV_32F);
|
||||
mapy.create(size, CV_32F);
|
||||
|
||||
cv::gpu::cudev::globmotion::calcWobbleSuppressionMaps(
|
||||
cv::cuda::cudev::globmotion::calcWobbleSuppressionMaps(
|
||||
left, idx, right, size.width, size.height,
|
||||
ml.ptr<float>(), mr.ptr<float>(), mapx, mapy);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@
|
||||
|
||||
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|
||||
|
||||
void cv::gpu::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
void cv::gpu::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); }
|
||||
|
||||
void cv::gpu::connectivityMask(const GpuMat&, GpuMat&, const cv::Scalar&, const cv::Scalar&, Stream&) { throw_no_cuda(); }
|
||||
void cv::gpu::labelComponents(const GpuMat&, GpuMat&, int, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::connectivityMask(const GpuMat&, GpuMat&, const cv::Scalar&, const cv::Scalar&, Stream&) { throw_no_cuda(); }
|
||||
void cv::cuda::labelComponents(const GpuMat&, GpuMat&, int, Stream&) { throw_no_cuda(); }
|
||||
|
||||
#else /* !defined (HAVE_CUDA) */
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace ccl
|
||||
{
|
||||
@@ -68,7 +68,7 @@ static float4 scalarToCudaType(const cv::Scalar& in)
|
||||
return make_float4((float)in[0], (float)in[1], (float)in[2], (float)in[3]);
|
||||
}
|
||||
|
||||
void cv::gpu::connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& s)
|
||||
void cv::cuda::connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scalar& lo, const cv::Scalar& hi, Stream& s)
|
||||
{
|
||||
CV_Assert(!image.empty());
|
||||
|
||||
@@ -102,7 +102,7 @@ void cv::gpu::connectivityMask(const GpuMat& image, GpuMat& mask, const cv::Scal
|
||||
f(image, mask, culo, cuhi, stream);
|
||||
}
|
||||
|
||||
void cv::gpu::labelComponents(const GpuMat& mask, GpuMat& components, int flags, Stream& s)
|
||||
void cv::cuda::labelComponents(const GpuMat& mask, GpuMat& components, int flags, Stream& s)
|
||||
{
|
||||
CV_Assert(!mask.empty() && mask.type() == CV_8U);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, GpuMat& buf, Stream& s)
|
||||
void cv::cuda::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, GpuMat& buf, Stream& s)
|
||||
{
|
||||
#if (CUDA_VERSION < 5000)
|
||||
CV_Assert(terminals.type() == CV_32S);
|
||||
@@ -201,7 +201,7 @@ void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTrans
|
||||
cudaSafeCall( cudaDeviceSynchronize() );
|
||||
}
|
||||
|
||||
void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight,
|
||||
void cv::cuda::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& topLeft, GpuMat& topRight,
|
||||
GpuMat& bottom, GpuMat& bottomLeft, GpuMat& bottomRight, GpuMat& labels, GpuMat& buf, Stream& s)
|
||||
{
|
||||
#if (CUDA_VERSION < 5000)
|
||||
|
||||
@@ -44,25 +44,25 @@
|
||||
|
||||
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|
||||
|
||||
cv::gpu::HOGDescriptor::HOGDescriptor(Size, Size, Size, Size, int, double, double, bool, int) { throw_no_cuda(); }
|
||||
size_t cv::gpu::HOGDescriptor::getDescriptorSize() const { throw_no_cuda(); return 0; }
|
||||
size_t cv::gpu::HOGDescriptor::getBlockHistogramSize() const { throw_no_cuda(); return 0; }
|
||||
double cv::gpu::HOGDescriptor::getWinSigma() const { throw_no_cuda(); return 0; }
|
||||
bool cv::gpu::HOGDescriptor::checkDetectorSize() const { throw_no_cuda(); return false; }
|
||||
void cv::gpu::HOGDescriptor::setSVMDetector(const std::vector<float>&) { throw_no_cuda(); }
|
||||
void cv::gpu::HOGDescriptor::detect(const GpuMat&, std::vector<Point>&, double, Size, Size) { throw_no_cuda(); }
|
||||
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, double, int) { throw_no_cuda(); }
|
||||
void cv::gpu::HOGDescriptor::computeBlockHistograms(const GpuMat&) { throw_no_cuda(); }
|
||||
void cv::gpu::HOGDescriptor::getDescriptors(const GpuMat&, Size, GpuMat&, int) { throw_no_cuda(); }
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getDefaultPeopleDetector() { throw_no_cuda(); return std::vector<float>(); }
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector48x96() { throw_no_cuda(); return std::vector<float>(); }
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector64x128() { throw_no_cuda(); return std::vector<float>(); }
|
||||
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat&, std::vector<Point>&, double, Size, Size, std::vector<Point>&, std::vector<double>&) { throw_no_cuda(); }
|
||||
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, std::vector<HOGConfidence>&, int) { throw_no_cuda(); }
|
||||
cv::cuda::HOGDescriptor::HOGDescriptor(Size, Size, Size, Size, int, double, double, bool, int) { throw_no_cuda(); }
|
||||
size_t cv::cuda::HOGDescriptor::getDescriptorSize() const { throw_no_cuda(); return 0; }
|
||||
size_t cv::cuda::HOGDescriptor::getBlockHistogramSize() const { throw_no_cuda(); return 0; }
|
||||
double cv::cuda::HOGDescriptor::getWinSigma() const { throw_no_cuda(); return 0; }
|
||||
bool cv::cuda::HOGDescriptor::checkDetectorSize() const { throw_no_cuda(); return false; }
|
||||
void cv::cuda::HOGDescriptor::setSVMDetector(const std::vector<float>&) { throw_no_cuda(); }
|
||||
void cv::cuda::HOGDescriptor::detect(const GpuMat&, std::vector<Point>&, double, Size, Size) { throw_no_cuda(); }
|
||||
void cv::cuda::HOGDescriptor::detectMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, double, int) { throw_no_cuda(); }
|
||||
void cv::cuda::HOGDescriptor::computeBlockHistograms(const GpuMat&) { throw_no_cuda(); }
|
||||
void cv::cuda::HOGDescriptor::getDescriptors(const GpuMat&, Size, GpuMat&, int) { throw_no_cuda(); }
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getDefaultPeopleDetector() { throw_no_cuda(); return std::vector<float>(); }
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getPeopleDetector48x96() { throw_no_cuda(); return std::vector<float>(); }
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getPeopleDetector64x128() { throw_no_cuda(); return std::vector<float>(); }
|
||||
void cv::cuda::HOGDescriptor::computeConfidence(const GpuMat&, std::vector<Point>&, double, Size, Size, std::vector<Point>&, std::vector<double>&) { throw_no_cuda(); }
|
||||
void cv::cuda::HOGDescriptor::computeConfidenceMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, std::vector<HOGConfidence>&, int) { throw_no_cuda(); }
|
||||
|
||||
#else
|
||||
|
||||
namespace cv { namespace gpu { namespace cudev
|
||||
namespace cv { namespace cuda { namespace cudev
|
||||
{
|
||||
namespace hog
|
||||
{
|
||||
@@ -70,8 +70,8 @@ namespace cv { namespace gpu { namespace cudev
|
||||
int nblocks_win_x, int nblocks_win_y);
|
||||
|
||||
void compute_hists(int nbins, int block_stride_x, int blovck_stride_y,
|
||||
int height, int width, const cv::gpu::PtrStepSzf& grad,
|
||||
const cv::gpu::PtrStepSzb& qangle, float sigma, float* block_hists);
|
||||
int height, int width, const cv::cuda::PtrStepSzf& grad,
|
||||
const cv::cuda::PtrStepSzb& qangle, float sigma, float* block_hists);
|
||||
|
||||
void normalize_hists(int nbins, int block_stride_x, int block_stride_y,
|
||||
int height, int width, float* block_hists, float threshold);
|
||||
@@ -87,24 +87,24 @@ namespace cv { namespace gpu { namespace cudev
|
||||
|
||||
void extract_descrs_by_rows(int win_height, int win_width, int block_stride_y, int block_stride_x,
|
||||
int win_stride_y, int win_stride_x, int height, int width, float* block_hists,
|
||||
cv::gpu::PtrStepSzf descriptors);
|
||||
cv::cuda::PtrStepSzf descriptors);
|
||||
void extract_descrs_by_cols(int win_height, int win_width, int block_stride_y, int block_stride_x,
|
||||
int win_stride_y, int win_stride_x, int height, int width, float* block_hists,
|
||||
cv::gpu::PtrStepSzf descriptors);
|
||||
cv::cuda::PtrStepSzf descriptors);
|
||||
|
||||
void compute_gradients_8UC1(int nbins, int height, int width, const cv::gpu::PtrStepSzb& img,
|
||||
float angle_scale, cv::gpu::PtrStepSzf grad, cv::gpu::PtrStepSzb qangle, bool correct_gamma);
|
||||
void compute_gradients_8UC4(int nbins, int height, int width, const cv::gpu::PtrStepSzb& img,
|
||||
float angle_scale, cv::gpu::PtrStepSzf grad, cv::gpu::PtrStepSzb qangle, bool correct_gamma);
|
||||
void compute_gradients_8UC1(int nbins, int height, int width, const cv::cuda::PtrStepSzb& img,
|
||||
float angle_scale, cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle, bool correct_gamma);
|
||||
void compute_gradients_8UC4(int nbins, int height, int width, const cv::cuda::PtrStepSzb& img,
|
||||
float angle_scale, cv::cuda::PtrStepSzf grad, cv::cuda::PtrStepSzb qangle, bool correct_gamma);
|
||||
|
||||
void resize_8UC1(const cv::gpu::PtrStepSzb& src, cv::gpu::PtrStepSzb dst);
|
||||
void resize_8UC4(const cv::gpu::PtrStepSzb& src, cv::gpu::PtrStepSzb dst);
|
||||
void resize_8UC1(const cv::cuda::PtrStepSzb& src, cv::cuda::PtrStepSzb dst);
|
||||
void resize_8UC4(const cv::cuda::PtrStepSzb& src, cv::cuda::PtrStepSzb dst);
|
||||
}
|
||||
}}}
|
||||
|
||||
using namespace ::cv::gpu::cudev;
|
||||
using namespace ::cv::cuda::cudev;
|
||||
|
||||
cv::gpu::HOGDescriptor::HOGDescriptor(Size win_size_, Size block_size_, Size block_stride_, Size cell_size_,
|
||||
cv::cuda::HOGDescriptor::HOGDescriptor(Size win_size_, Size block_size_, Size block_stride_, Size cell_size_,
|
||||
int nbins_, double win_sigma_, double threshold_L2hys_, bool gamma_correction_, int nlevels_)
|
||||
: win_size(win_size_),
|
||||
block_size(block_size_),
|
||||
@@ -132,30 +132,30 @@ cv::gpu::HOGDescriptor::HOGDescriptor(Size win_size_, Size block_size_, Size blo
|
||||
hog::set_up_constants(nbins, block_stride.width, block_stride.height, blocks_per_win.width, blocks_per_win.height);
|
||||
}
|
||||
|
||||
size_t cv::gpu::HOGDescriptor::getDescriptorSize() const
|
||||
size_t cv::cuda::HOGDescriptor::getDescriptorSize() const
|
||||
{
|
||||
return numPartsWithin(win_size, block_size, block_stride).area() * getBlockHistogramSize();
|
||||
}
|
||||
|
||||
size_t cv::gpu::HOGDescriptor::getBlockHistogramSize() const
|
||||
size_t cv::cuda::HOGDescriptor::getBlockHistogramSize() const
|
||||
{
|
||||
Size cells_per_block = Size(block_size.width / cell_size.width, block_size.height / cell_size.height);
|
||||
return (size_t)(nbins * cells_per_block.area());
|
||||
}
|
||||
|
||||
double cv::gpu::HOGDescriptor::getWinSigma() const
|
||||
double cv::cuda::HOGDescriptor::getWinSigma() const
|
||||
{
|
||||
return win_sigma >= 0 ? win_sigma : (block_size.width + block_size.height) / 8.0;
|
||||
}
|
||||
|
||||
bool cv::gpu::HOGDescriptor::checkDetectorSize() const
|
||||
bool cv::cuda::HOGDescriptor::checkDetectorSize() const
|
||||
{
|
||||
size_t detector_size = detector.rows * detector.cols;
|
||||
size_t descriptor_size = getDescriptorSize();
|
||||
return detector_size == 0 || detector_size == descriptor_size || detector_size == descriptor_size + 1;
|
||||
}
|
||||
|
||||
void cv::gpu::HOGDescriptor::setSVMDetector(const std::vector<float>& _detector)
|
||||
void cv::cuda::HOGDescriptor::setSVMDetector(const std::vector<float>& _detector)
|
||||
{
|
||||
std::vector<float> detector_reordered(_detector.size());
|
||||
|
||||
@@ -179,7 +179,7 @@ void cv::gpu::HOGDescriptor::setSVMDetector(const std::vector<float>& _detector)
|
||||
CV_Assert(checkDetectorSize());
|
||||
}
|
||||
|
||||
cv::gpu::GpuMat cv::gpu::HOGDescriptor::getBuffer(const Size& sz, int type, GpuMat& buf)
|
||||
cv::cuda::GpuMat cv::cuda::HOGDescriptor::getBuffer(const Size& sz, int type, GpuMat& buf)
|
||||
{
|
||||
if (buf.empty() || buf.type() != type)
|
||||
buf.create(sz, type);
|
||||
@@ -190,13 +190,13 @@ cv::gpu::GpuMat cv::gpu::HOGDescriptor::getBuffer(const Size& sz, int type, GpuM
|
||||
return buf(Rect(Point(0,0), sz));
|
||||
}
|
||||
|
||||
cv::gpu::GpuMat cv::gpu::HOGDescriptor::getBuffer(int rows, int cols, int type, GpuMat& buf)
|
||||
cv::cuda::GpuMat cv::cuda::HOGDescriptor::getBuffer(int rows, int cols, int type, GpuMat& buf)
|
||||
{
|
||||
return getBuffer(Size(cols, rows), type, buf);
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::HOGDescriptor::computeGradient(const GpuMat& img, GpuMat& _grad, GpuMat& _qangle)
|
||||
void cv::cuda::HOGDescriptor::computeGradient(const GpuMat& img, GpuMat& _grad, GpuMat& _qangle)
|
||||
{
|
||||
CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4);
|
||||
|
||||
@@ -219,7 +219,7 @@ void cv::gpu::HOGDescriptor::computeGradient(const GpuMat& img, GpuMat& _grad, G
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::HOGDescriptor::computeBlockHistograms(const GpuMat& img)
|
||||
void cv::cuda::HOGDescriptor::computeBlockHistograms(const GpuMat& img)
|
||||
{
|
||||
computeGradient(img, grad, qangle);
|
||||
|
||||
@@ -237,7 +237,7 @@ void cv::gpu::HOGDescriptor::computeBlockHistograms(const GpuMat& img)
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride, GpuMat& descriptors, int descr_format)
|
||||
void cv::cuda::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride, GpuMat& descriptors, int descr_format)
|
||||
{
|
||||
CV_Assert(win_stride.width % block_stride.width == 0 && win_stride.height % block_stride.height == 0);
|
||||
|
||||
@@ -264,7 +264,7 @@ void cv::gpu::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride,
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat& img, std::vector<Point>& hits, double hit_threshold,
|
||||
void cv::cuda::HOGDescriptor::computeConfidence(const GpuMat& img, std::vector<Point>& hits, double hit_threshold,
|
||||
Size win_stride, Size padding, std::vector<Point>& locations, std::vector<double>& confidences)
|
||||
{
|
||||
CV_Assert(padding == Size(0, 0));
|
||||
@@ -307,7 +307,7 @@ void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat& img, std::vector<Po
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, std::vector<Rect>& found_locations,
|
||||
void cv::cuda::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, std::vector<Rect>& found_locations,
|
||||
double hit_threshold, Size win_stride, Size padding,
|
||||
std::vector<HOGConfidence> &conf_out, int group_threshold)
|
||||
{
|
||||
@@ -359,7 +359,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, std:
|
||||
}
|
||||
|
||||
|
||||
void cv::gpu::HOGDescriptor::detect(const GpuMat& img, std::vector<Point>& hits, double hit_threshold, Size win_stride, Size padding)
|
||||
void cv::cuda::HOGDescriptor::detect(const GpuMat& img, std::vector<Point>& hits, double hit_threshold, Size win_stride, Size padding)
|
||||
{
|
||||
CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4);
|
||||
CV_Assert(padding == Size(0, 0));
|
||||
@@ -396,7 +396,7 @@ void cv::gpu::HOGDescriptor::detect(const GpuMat& img, std::vector<Point>& hits,
|
||||
|
||||
|
||||
|
||||
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, std::vector<Rect>& found_locations, double hit_threshold,
|
||||
void cv::cuda::HOGDescriptor::detectMultiScale(const GpuMat& img, std::vector<Rect>& found_locations, double hit_threshold,
|
||||
Size win_stride, Size padding, double scale0, int group_threshold)
|
||||
{
|
||||
|
||||
@@ -450,22 +450,22 @@ void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, std::vector<Rec
|
||||
groupRectangles(found_locations, group_threshold, 0.2/*magic number copied from CPU version*/);
|
||||
}
|
||||
|
||||
int cv::gpu::HOGDescriptor::numPartsWithin(int size, int part_size, int stride)
|
||||
int cv::cuda::HOGDescriptor::numPartsWithin(int size, int part_size, int stride)
|
||||
{
|
||||
return (size - part_size + stride) / stride;
|
||||
}
|
||||
|
||||
cv::Size cv::gpu::HOGDescriptor::numPartsWithin(cv::Size size, cv::Size part_size, cv::Size stride)
|
||||
cv::Size cv::cuda::HOGDescriptor::numPartsWithin(cv::Size size, cv::Size part_size, cv::Size stride)
|
||||
{
|
||||
return Size(numPartsWithin(size.width, part_size.width, stride.width), numPartsWithin(size.height, part_size.height, stride.height));
|
||||
}
|
||||
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getDefaultPeopleDetector()
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getDefaultPeopleDetector()
|
||||
{
|
||||
return getPeopleDetector64x128();
|
||||
}
|
||||
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector48x96()
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getPeopleDetector48x96()
|
||||
{
|
||||
static const float detector[] = {
|
||||
0.294350f, -0.098796f, -0.129522f, 0.078753f, 0.387527f, 0.261529f,
|
||||
@@ -805,7 +805,7 @@ std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector48x96()
|
||||
|
||||
|
||||
|
||||
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector64x128()
|
||||
std::vector<float> cv::cuda::HOGDescriptor::getPeopleDetector64x128()
|
||||
{
|
||||
static const float detector[] = {
|
||||
0.05359386f, -0.14721455f, -0.05532170f, 0.05077307f,
|
||||
|
||||
@@ -49,15 +49,15 @@ using namespace cvtest;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// transformPoints
|
||||
|
||||
struct TransformPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct TransformPoints : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GetParam();
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -67,8 +67,8 @@ GPU_TEST_P(TransformPoints, Accuracy)
|
||||
cv::Mat rvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
|
||||
cv::Mat tvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
|
||||
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::gpu::transformPoints(loadMat(src), rvec, tvec, dst);
|
||||
cv::cuda::GpuMat dst;
|
||||
cv::cuda::transformPoints(loadMat(src), rvec, tvec, dst);
|
||||
|
||||
ASSERT_EQ(src.size(), dst.size());
|
||||
ASSERT_EQ(src.type(), dst.type());
|
||||
@@ -97,15 +97,15 @@ INSTANTIATE_TEST_CASE_P(GPU_Calib3D, TransformPoints, ALL_DEVICES);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ProjectPoints
|
||||
|
||||
struct ProjectPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct ProjectPoints : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GetParam();
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -120,8 +120,8 @@ GPU_TEST_P(ProjectPoints, Accuracy)
|
||||
camera_mat.at<float>(2, 0) = 0.f;
|
||||
camera_mat.at<float>(2, 1) = 0.f;
|
||||
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::gpu::projectPoints(loadMat(src), rvec, tvec, camera_mat, cv::Mat(), dst);
|
||||
cv::cuda::GpuMat dst;
|
||||
cv::cuda::projectPoints(loadMat(src), rvec, tvec, camera_mat, cv::Mat(), dst);
|
||||
|
||||
ASSERT_EQ(1, dst.rows);
|
||||
ASSERT_EQ(MatType(CV_32FC2), MatType(dst.type()));
|
||||
@@ -147,15 +147,15 @@ INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ProjectPoints, ALL_DEVICES);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// SolvePnPRansac
|
||||
|
||||
struct SolvePnPRansac : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct SolvePnPRansac : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GetParam();
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -177,7 +177,7 @@ GPU_TEST_P(SolvePnPRansac, Accuracy)
|
||||
|
||||
cv::Mat rvec, tvec;
|
||||
std::vector<int> inliers;
|
||||
cv::gpu::solvePnPRansac(object, cv::Mat(1, (int)image_vec.size(), CV_32FC2, &image_vec[0]),
|
||||
cv::cuda::solvePnPRansac(object, cv::Mat(1, (int)image_vec.size(), CV_32FC2, &image_vec[0]),
|
||||
camera_mat, cv::Mat(1, 8, CV_32F, cv::Scalar::all(0)),
|
||||
rvec, tvec, false, 200, 2.f, 100, &inliers);
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
struct CompactPoints : testing::TestWithParam<gpu::DeviceInfo>
|
||||
struct CompactPoints : testing::TestWithParam<cuda::DeviceInfo>
|
||||
{
|
||||
virtual void SetUp() { gpu::setDevice(GetParam().deviceID()); }
|
||||
virtual void SetUp() { cuda::setDevice(GetParam().deviceID()); }
|
||||
};
|
||||
|
||||
GPU_TEST_P(CompactPoints, CanCompactizeSmallInput)
|
||||
@@ -69,8 +69,8 @@ GPU_TEST_P(CompactPoints, CanCompactizeSmallInput)
|
||||
mask.at<uchar>(0,1) = 0;
|
||||
mask.at<uchar>(0,2) = 1;
|
||||
|
||||
gpu::GpuMat dsrc0(src0), dsrc1(src1), dmask(mask);
|
||||
gpu::compactPoints(dsrc0, dsrc1, dmask);
|
||||
cuda::GpuMat dsrc0(src0), dsrc1(src1), dmask(mask);
|
||||
cuda::compactPoints(dsrc0, dsrc1, dmask);
|
||||
|
||||
dsrc0.download(src0);
|
||||
dsrc1.download(src1);
|
||||
|
||||
@@ -49,9 +49,9 @@ using namespace cvtest;
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// SetTo
|
||||
|
||||
PARAM_TEST_CASE(SetTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
PARAM_TEST_CASE(SetTo, cv::cuda::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
cv::Size size;
|
||||
int type;
|
||||
bool useRoi;
|
||||
@@ -63,7 +63,7 @@ PARAM_TEST_CASE(SetTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
type = GET_PARAM(2);
|
||||
useRoi = GET_PARAM(3);
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ GPU_TEST_P(SetTo, Zero)
|
||||
{
|
||||
cv::Scalar zero = cv::Scalar::all(0);
|
||||
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(zero);
|
||||
|
||||
EXPECT_MAT_NEAR(cv::Mat::zeros(size, type), mat, 0.0);
|
||||
@@ -81,11 +81,11 @@ GPU_TEST_P(SetTo, SameVal)
|
||||
{
|
||||
cv::Scalar val = cv::Scalar::all(randomDouble(0.0, 255.0));
|
||||
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(val);
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -95,7 +95,7 @@ GPU_TEST_P(SetTo, SameVal)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(val);
|
||||
|
||||
EXPECT_MAT_NEAR(cv::Mat(size, type, val), mat, 0.0);
|
||||
@@ -106,11 +106,11 @@ GPU_TEST_P(SetTo, DifferentVal)
|
||||
{
|
||||
cv::Scalar val = randomScalar(0.0, 255.0);
|
||||
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(val);
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -120,7 +120,7 @@ GPU_TEST_P(SetTo, DifferentVal)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(val);
|
||||
|
||||
EXPECT_MAT_NEAR(cv::Mat(size, type, val), mat, 0.0);
|
||||
@@ -133,11 +133,11 @@ GPU_TEST_P(SetTo, Masked)
|
||||
cv::Mat mat_gold = randomMat(size, type);
|
||||
cv::Mat mask = randomMat(size, CV_8UC1, 0.0, 2.0);
|
||||
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat mat = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat mat = createMat(size, type, useRoi);
|
||||
mat.setTo(val, loadMat(mask));
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -147,7 +147,7 @@ GPU_TEST_P(SetTo, Masked)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat mat = loadMat(mat_gold, useRoi);
|
||||
cv::cuda::GpuMat mat = loadMat(mat_gold, useRoi);
|
||||
mat.setTo(val, loadMat(mask, useRoi));
|
||||
|
||||
mat_gold.setTo(val, mask);
|
||||
@@ -165,9 +165,9 @@ INSTANTIATE_TEST_CASE_P(GPU_GpuMat, SetTo, testing::Combine(
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// CopyTo
|
||||
|
||||
PARAM_TEST_CASE(CopyTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
PARAM_TEST_CASE(CopyTo, cv::cuda::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
cv::Size size;
|
||||
int type;
|
||||
bool useRoi;
|
||||
@@ -180,7 +180,7 @@ PARAM_TEST_CASE(CopyTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
type = GET_PARAM(2);
|
||||
useRoi = GET_PARAM(3);
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -188,8 +188,8 @@ GPU_TEST_P(CopyTo, WithOutMask)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
|
||||
cv::gpu::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::gpu::GpuMat dst = createMat(size, type, useRoi);
|
||||
cv::cuda::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::cuda::GpuMat dst = createMat(size, type, useRoi);
|
||||
d_src.copyTo(dst);
|
||||
|
||||
EXPECT_MAT_NEAR(src, dst, 0.0);
|
||||
@@ -200,12 +200,12 @@ GPU_TEST_P(CopyTo, Masked)
|
||||
cv::Mat src = randomMat(size, type);
|
||||
cv::Mat mask = randomMat(size, CV_8UC1, 0.0, 2.0);
|
||||
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if (CV_MAT_DEPTH(type) == CV_64F && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src);
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::cuda::GpuMat d_src = loadMat(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
d_src.copyTo(dst, loadMat(mask, useRoi));
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -215,8 +215,8 @@ GPU_TEST_P(CopyTo, Masked)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::gpu::GpuMat dst = loadMat(cv::Mat::zeros(size, type), useRoi);
|
||||
cv::cuda::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::cuda::GpuMat dst = loadMat(cv::Mat::zeros(size, type), useRoi);
|
||||
d_src.copyTo(dst, loadMat(mask, useRoi));
|
||||
|
||||
cv::Mat dst_gold = cv::Mat::zeros(size, type);
|
||||
@@ -235,9 +235,9 @@ INSTANTIATE_TEST_CASE_P(GPU_GpuMat, CopyTo, testing::Combine(
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ConvertTo
|
||||
|
||||
PARAM_TEST_CASE(ConvertTo, cv::gpu::DeviceInfo, cv::Size, MatDepth, MatDepth, UseRoi)
|
||||
PARAM_TEST_CASE(ConvertTo, cv::cuda::DeviceInfo, cv::Size, MatDepth, MatDepth, UseRoi)
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
cv::Size size;
|
||||
int depth1;
|
||||
int depth2;
|
||||
@@ -251,7 +251,7 @@ PARAM_TEST_CASE(ConvertTo, cv::gpu::DeviceInfo, cv::Size, MatDepth, MatDepth, Us
|
||||
depth2 = GET_PARAM(3);
|
||||
useRoi = GET_PARAM(4);
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -259,12 +259,12 @@ GPU_TEST_P(ConvertTo, WithOutScaling)
|
||||
{
|
||||
cv::Mat src = randomMat(size, depth1);
|
||||
|
||||
if ((depth1 == CV_64F || depth2 == CV_64F) && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if ((depth1 == CV_64F || depth2 == CV_64F) && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src);
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::cuda::GpuMat d_src = loadMat(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
d_src.convertTo(dst, depth2);
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -274,8 +274,8 @@ GPU_TEST_P(ConvertTo, WithOutScaling)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::gpu::GpuMat dst = createMat(size, depth2, useRoi);
|
||||
cv::cuda::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::cuda::GpuMat dst = createMat(size, depth2, useRoi);
|
||||
d_src.convertTo(dst, depth2);
|
||||
|
||||
cv::Mat dst_gold;
|
||||
@@ -291,12 +291,12 @@ GPU_TEST_P(ConvertTo, WithScaling)
|
||||
double a = randomDouble(0.0, 1.0);
|
||||
double b = randomDouble(-10.0, 10.0);
|
||||
|
||||
if ((depth1 == CV_64F || depth2 == CV_64F) && !supportFeature(devInfo, cv::gpu::NATIVE_DOUBLE))
|
||||
if ((depth1 == CV_64F || depth2 == CV_64F) && !supportFeature(devInfo, cv::cuda::NATIVE_DOUBLE))
|
||||
{
|
||||
try
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src);
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::cuda::GpuMat d_src = loadMat(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
d_src.convertTo(dst, depth2, a, b);
|
||||
}
|
||||
catch (const cv::Exception& e)
|
||||
@@ -306,8 +306,8 @@ GPU_TEST_P(ConvertTo, WithScaling)
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::gpu::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::gpu::GpuMat dst = createMat(size, depth2, useRoi);
|
||||
cv::cuda::GpuMat d_src = loadMat(src, useRoi);
|
||||
cv::cuda::GpuMat dst = createMat(size, depth2, useRoi);
|
||||
d_src.convertTo(dst, depth2, a, b);
|
||||
|
||||
cv::Mat dst_gold;
|
||||
@@ -327,29 +327,29 @@ INSTANTIATE_TEST_CASE_P(GPU_GpuMat, ConvertTo, testing::Combine(
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ensureSizeIsEnough
|
||||
|
||||
struct EnsureSizeIsEnough : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct EnsureSizeIsEnough : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
virtual void SetUp()
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo = GetParam();
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::DeviceInfo devInfo = GetParam();
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(EnsureSizeIsEnough, BufferReuse)
|
||||
{
|
||||
cv::gpu::GpuMat buffer(100, 100, CV_8U);
|
||||
cv::gpu::GpuMat old = buffer;
|
||||
cv::cuda::GpuMat buffer(100, 100, CV_8U);
|
||||
cv::cuda::GpuMat old = buffer;
|
||||
|
||||
// don't reallocate memory
|
||||
cv::gpu::ensureSizeIsEnough(10, 20, CV_8U, buffer);
|
||||
cv::cuda::ensureSizeIsEnough(10, 20, CV_8U, buffer);
|
||||
EXPECT_EQ(10, buffer.rows);
|
||||
EXPECT_EQ(20, buffer.cols);
|
||||
EXPECT_EQ(CV_8UC1, buffer.type());
|
||||
EXPECT_EQ(reinterpret_cast<intptr_t>(old.data), reinterpret_cast<intptr_t>(buffer.data));
|
||||
|
||||
// don't reallocate memory
|
||||
cv::gpu::ensureSizeIsEnough(20, 30, CV_8U, buffer);
|
||||
cv::cuda::ensureSizeIsEnough(20, 30, CV_8U, buffer);
|
||||
EXPECT_EQ(20, buffer.rows);
|
||||
EXPECT_EQ(30, buffer.cols);
|
||||
EXPECT_EQ(CV_8UC1, buffer.type());
|
||||
|
||||
@@ -151,14 +151,14 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
struct Labeling : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct Labeling : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GetParam();
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
|
||||
cv::Mat loat_image()
|
||||
@@ -179,15 +179,15 @@ GPU_TEST_P(Labeling, DISABLED_ConnectedComponents)
|
||||
GreedyLabeling host(image);
|
||||
host(host._labels);
|
||||
|
||||
cv::gpu::GpuMat mask;
|
||||
cv::cuda::GpuMat mask;
|
||||
mask.create(image.rows, image.cols, CV_8UC1);
|
||||
|
||||
cv::gpu::GpuMat components;
|
||||
cv::cuda::GpuMat components;
|
||||
components.create(image.rows, image.cols, CV_32SC1);
|
||||
|
||||
cv::gpu::connectivityMask(cv::gpu::GpuMat(image), mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
cv::cuda::connectivityMask(cv::cuda::GpuMat(image), mask, cv::Scalar::all(0), cv::Scalar::all(2));
|
||||
|
||||
cv::gpu::labelComponents(mask, components);
|
||||
cv::cuda::labelComponents(mask, components);
|
||||
|
||||
host.checkCorrectness(cv::Mat(components));
|
||||
}
|
||||
|
||||
@@ -48,9 +48,9 @@ using namespace cvtest;
|
||||
|
||||
//#define DUMP
|
||||
|
||||
struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
|
||||
struct HOG : testing::TestWithParam<cv::cuda::DeviceInfo>, cv::cuda::HOGDescriptor
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
#ifdef DUMP
|
||||
std::ofstream f;
|
||||
@@ -68,7 +68,7 @@ struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
|
||||
{
|
||||
devInfo = GetParam();
|
||||
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
|
||||
#ifdef DUMP
|
||||
@@ -127,7 +127,7 @@ struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
|
||||
void testDetect(const cv::Mat& img)
|
||||
{
|
||||
gamma_correction = false;
|
||||
setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
|
||||
setSVMDetector(cv::cuda::HOGDescriptor::getDefaultPeopleDetector());
|
||||
|
||||
std::vector<cv::Point> locations;
|
||||
|
||||
@@ -212,10 +212,10 @@ GPU_TEST_P(HOG, GetDescriptors)
|
||||
cv::Mat img;
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
|
||||
cv::gpu::GpuMat d_img(img);
|
||||
cv::cuda::GpuMat d_img(img);
|
||||
|
||||
// Convert train images into feature vectors (train table)
|
||||
cv::gpu::GpuMat descriptors, descriptors_by_cols;
|
||||
cv::cuda::GpuMat descriptors, descriptors_by_cols;
|
||||
getDescriptors(d_img, win_size, descriptors, DESCR_FORMAT_ROW_BY_ROW);
|
||||
getDescriptors(d_img, win_size, descriptors_by_cols, DESCR_FORMAT_COL_BY_COL);
|
||||
|
||||
@@ -251,38 +251,38 @@ GPU_TEST_P(HOG, GetDescriptors)
|
||||
img_rgb = readImage("hog/positive1.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
// Everything is fine with interpolation for left top subimage
|
||||
ASSERT_EQ(0.0, cv::norm((cv::Mat)block_hists, (cv::Mat)descriptors.rowRange(0, 1)));
|
||||
|
||||
img_rgb = readImage("hog/positive2.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(1, 2)));
|
||||
|
||||
img_rgb = readImage("hog/negative1.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(2, 3)));
|
||||
|
||||
img_rgb = readImage("hog/negative2.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(3, 4)));
|
||||
|
||||
img_rgb = readImage("hog/positive3.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(4, 5)));
|
||||
|
||||
img_rgb = readImage("hog/negative3.png");
|
||||
ASSERT_TRUE(!img_rgb.empty());
|
||||
cv::cvtColor(img_rgb, img, cv::COLOR_BGR2BGRA);
|
||||
computeBlockHistograms(cv::gpu::GpuMat(img));
|
||||
computeBlockHistograms(cv::cuda::GpuMat(img));
|
||||
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(5, 6)));
|
||||
}
|
||||
|
||||
@@ -290,15 +290,15 @@ INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, HOG, ALL_DEVICES);
|
||||
|
||||
//============== caltech hog tests =====================//
|
||||
|
||||
struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::gpu::DeviceInfo, std::string> >
|
||||
struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::cuda::DeviceInfo, std::string> >
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
cv::Mat img;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GET_PARAM(0);
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
|
||||
img = readImage(GET_PARAM(1), cv::IMREAD_GRAYSCALE);
|
||||
ASSERT_FALSE(img.empty());
|
||||
@@ -307,11 +307,11 @@ struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::gpu::Device
|
||||
|
||||
GPU_TEST_P(CalTech, HOG)
|
||||
{
|
||||
cv::gpu::GpuMat d_img(img);
|
||||
cv::cuda::GpuMat d_img(img);
|
||||
cv::Mat markedImage(img.clone());
|
||||
|
||||
cv::gpu::HOGDescriptor d_hog;
|
||||
d_hog.setSVMDetector(cv::gpu::HOGDescriptor::getDefaultPeopleDetector());
|
||||
cv::cuda::HOGDescriptor d_hog;
|
||||
d_hog.setSVMDetector(cv::cuda::HOGDescriptor::getDefaultPeopleDetector());
|
||||
d_hog.nlevels = d_hog.nlevels + 32;
|
||||
|
||||
std::vector<cv::Rect> found_locations;
|
||||
@@ -341,20 +341,20 @@ INSTANTIATE_TEST_CASE_P(detect, CalTech, testing::Combine(ALL_DEVICES,
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// LBP classifier
|
||||
|
||||
PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
|
||||
PARAM_TEST_CASE(LBP_Read_classifier, cv::cuda::DeviceInfo, int)
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GET_PARAM(0);
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(LBP_Read_classifier, Accuracy)
|
||||
{
|
||||
cv::gpu::CascadeClassifier_GPU classifier;
|
||||
cv::cuda::CascadeClassifier_GPU classifier;
|
||||
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";
|
||||
ASSERT_TRUE(classifier.load(classifierXmlPath));
|
||||
}
|
||||
@@ -363,14 +363,14 @@ INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,
|
||||
testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
|
||||
|
||||
|
||||
PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)
|
||||
PARAM_TEST_CASE(LBP_classify, cv::cuda::DeviceInfo, int)
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo;
|
||||
cv::cuda::DeviceInfo devInfo;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
devInfo = GET_PARAM(0);
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -396,11 +396,11 @@ GPU_TEST_P(LBP_classify, Accuracy)
|
||||
for (; it != rects.end(); ++it)
|
||||
cv::rectangle(markedImage, *it, cv::Scalar(255, 0, 0));
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU gpuClassifier;
|
||||
cv::cuda::CascadeClassifier_GPU gpuClassifier;
|
||||
ASSERT_TRUE(gpuClassifier.load(classifierXmlPath));
|
||||
|
||||
cv::gpu::GpuMat gpu_rects;
|
||||
cv::gpu::GpuMat tested(grey);
|
||||
cv::cuda::GpuMat gpu_rects;
|
||||
cv::cuda::GpuMat tested(grey);
|
||||
int count = gpuClassifier.detectMultiScale(tested, gpu_rects);
|
||||
|
||||
#if defined (LOG_CASCADE_STATISTIC)
|
||||
|
||||
@@ -104,7 +104,7 @@ GPU_TEST_P(Buffer, ConstructorFromMat)
|
||||
GPU_TEST_P(Buffer, ConstructorFromGpuMat)
|
||||
{
|
||||
cv::Mat gold = randomMat(size, type);
|
||||
cv::gpu::GpuMat d_gold(gold);
|
||||
cv::cuda::GpuMat d_gold(gold);
|
||||
|
||||
cv::ogl::Buffer buf(d_gold, cv::ogl::Buffer::ARRAY_BUFFER);
|
||||
|
||||
@@ -152,7 +152,7 @@ GPU_TEST_P(Buffer, CopyFromMat)
|
||||
GPU_TEST_P(Buffer, CopyFromGpuMat)
|
||||
{
|
||||
cv::Mat gold = randomMat(size, type);
|
||||
cv::gpu::GpuMat d_gold(gold);
|
||||
cv::cuda::GpuMat d_gold(gold);
|
||||
|
||||
cv::ogl::Buffer buf;
|
||||
buf.copyFrom(d_gold, cv::ogl::Buffer::ARRAY_BUFFER, true);
|
||||
@@ -185,7 +185,7 @@ GPU_TEST_P(Buffer, CopyToGpuMat)
|
||||
|
||||
cv::ogl::Buffer buf(gold, cv::ogl::Buffer::ARRAY_BUFFER, true);
|
||||
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::cuda::GpuMat dst;
|
||||
buf.copyTo(dst);
|
||||
|
||||
EXPECT_MAT_NEAR(gold, dst, 0);
|
||||
@@ -261,7 +261,7 @@ GPU_TEST_P(Buffer, MapDevice)
|
||||
|
||||
cv::ogl::Buffer buf(gold, cv::ogl::Buffer::ARRAY_BUFFER, true);
|
||||
|
||||
cv::gpu::GpuMat dst = buf.mapDevice();
|
||||
cv::cuda::GpuMat dst = buf.mapDevice();
|
||||
|
||||
EXPECT_MAT_NEAR(gold, dst, 0);
|
||||
|
||||
@@ -335,7 +335,7 @@ GPU_TEST_P(Texture2D, ConstructorFromMat)
|
||||
GPU_TEST_P(Texture2D, ConstructorFromGpuMat)
|
||||
{
|
||||
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
|
||||
cv::gpu::GpuMat d_gold(gold);
|
||||
cv::cuda::GpuMat d_gold(gold);
|
||||
|
||||
cv::ogl::Texture2D tex(d_gold, true);
|
||||
|
||||
@@ -395,7 +395,7 @@ GPU_TEST_P(Texture2D, CopyFromMat)
|
||||
GPU_TEST_P(Texture2D, CopyFromGpuMat)
|
||||
{
|
||||
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
|
||||
cv::gpu::GpuMat d_gold(gold);
|
||||
cv::cuda::GpuMat d_gold(gold);
|
||||
|
||||
cv::ogl::Texture2D tex;
|
||||
tex.copyFrom(d_gold, true);
|
||||
@@ -426,7 +426,7 @@ GPU_TEST_P(Texture2D, CopyToGpuMat)
|
||||
|
||||
cv::ogl::Texture2D tex(gold, true);
|
||||
|
||||
cv::gpu::GpuMat dst;
|
||||
cv::cuda::GpuMat dst;
|
||||
tex.copyTo(dst, depth);
|
||||
|
||||
EXPECT_MAT_NEAR(gold, dst, 1e-2);
|
||||
|
||||
@@ -50,20 +50,20 @@
|
||||
|
||||
using namespace cvtest;
|
||||
|
||||
struct Async : testing::TestWithParam<cv::gpu::DeviceInfo>
|
||||
struct Async : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
{
|
||||
cv::gpu::CudaMem src;
|
||||
cv::gpu::GpuMat d_src;
|
||||
cv::cuda::CudaMem src;
|
||||
cv::cuda::GpuMat d_src;
|
||||
|
||||
cv::gpu::CudaMem dst;
|
||||
cv::gpu::GpuMat d_dst;
|
||||
cv::cuda::CudaMem dst;
|
||||
cv::cuda::GpuMat d_dst;
|
||||
|
||||
virtual void SetUp()
|
||||
{
|
||||
cv::gpu::DeviceInfo devInfo = GetParam();
|
||||
cv::gpu::setDevice(devInfo.deviceID());
|
||||
cv::cuda::DeviceInfo devInfo = GetParam();
|
||||
cv::cuda::setDevice(devInfo.deviceID());
|
||||
|
||||
src = cv::gpu::CudaMem(cv::gpu::CudaMem::PAGE_LOCKED);
|
||||
src = cv::cuda::CudaMem(cv::cuda::CudaMem::PAGE_LOCKED);
|
||||
|
||||
cv::Mat m = randomMat(cv::Size(128, 128), CV_8UC1);
|
||||
m.copyTo(src);
|
||||
@@ -76,8 +76,8 @@ void checkMemSet(int status, void* userData)
|
||||
|
||||
Async* test = reinterpret_cast<Async*>(userData);
|
||||
|
||||
cv::gpu::CudaMem src = test->src;
|
||||
cv::gpu::CudaMem dst = test->dst;
|
||||
cv::cuda::CudaMem src = test->src;
|
||||
cv::cuda::CudaMem dst = test->dst;
|
||||
|
||||
cv::Mat dst_gold = cv::Mat::zeros(src.size(), src.type());
|
||||
|
||||
@@ -86,7 +86,7 @@ void checkMemSet(int status, void* userData)
|
||||
|
||||
GPU_TEST_P(Async, MemSet)
|
||||
{
|
||||
cv::gpu::Stream stream;
|
||||
cv::cuda::Stream stream;
|
||||
|
||||
d_dst.upload(src);
|
||||
|
||||
@@ -105,8 +105,8 @@ void checkConvert(int status, void* userData)
|
||||
|
||||
Async* test = reinterpret_cast<Async*>(userData);
|
||||
|
||||
cv::gpu::CudaMem src = test->src;
|
||||
cv::gpu::CudaMem dst = test->dst;
|
||||
cv::cuda::CudaMem src = test->src;
|
||||
cv::cuda::CudaMem dst = test->dst;
|
||||
|
||||
cv::Mat dst_gold;
|
||||
src.createMatHeader().convertTo(dst_gold, CV_32S);
|
||||
@@ -116,7 +116,7 @@ void checkConvert(int status, void* userData)
|
||||
|
||||
GPU_TEST_P(Async, Convert)
|
||||
{
|
||||
cv::gpu::Stream stream;
|
||||
cv::cuda::Stream stream;
|
||||
|
||||
d_src.upload(src, stream);
|
||||
d_src.convertTo(d_dst, CV_32S, stream);
|
||||
|
||||
Reference in New Issue
Block a user