Commit 9c13b84e authored by marina.kolpakova's avatar marina.kolpakova

fixed unused warnings

parent 66eb96d7
...@@ -1607,6 +1607,7 @@ GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, MatDepth, NormType) ...@@ -1607,6 +1607,7 @@ GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, MatDepth, NormType)
{ {
dst = cv::gpu::norm(src, normType, buf); dst = cv::gpu::norm(src, normType, buf);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, Norm, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, Norm, testing::Combine(
...@@ -1642,6 +1643,7 @@ GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType) ...@@ -1642,6 +1643,7 @@ GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType)
{ {
dst = cv::gpu::norm(src1, src2, normType); dst = cv::gpu::norm(src1, src2, normType);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, NormDiff, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, NormDiff, testing::Combine(
...@@ -1829,6 +1831,7 @@ GPU_PERF_TEST(CountNonZero, cv::gpu::DeviceInfo, cv::Size, MatDepth) ...@@ -1829,6 +1831,7 @@ GPU_PERF_TEST(CountNonZero, cv::gpu::DeviceInfo, cv::Size, MatDepth)
{ {
dst = cv::gpu::countNonZero(src, buf); dst = cv::gpu::countNonZero(src, buf);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, CountNonZero, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, CountNonZero, testing::Combine(
......
...@@ -1229,6 +1229,7 @@ GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, MatDepth, NormType) ...@@ -1229,6 +1229,7 @@ GPU_PERF_TEST(Norm, cv::gpu::DeviceInfo, cv::Size, MatDepth, NormType)
{ {
dst = cv::norm(src, normType); dst = cv::norm(src, normType);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, Norm, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, Norm, testing::Combine(
...@@ -1259,6 +1260,7 @@ GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType) ...@@ -1259,6 +1260,7 @@ GPU_PERF_TEST(NormDiff, cv::gpu::DeviceInfo, cv::Size, NormType)
{ {
dst = cv::norm(src1, src2, normType); dst = cv::norm(src1, src2, normType);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, NormDiff, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, NormDiff, testing::Combine(
...@@ -1338,6 +1340,7 @@ GPU_PERF_TEST(CountNonZero, cv::gpu::DeviceInfo, cv::Size, MatDepth) ...@@ -1338,6 +1340,7 @@ GPU_PERF_TEST(CountNonZero, cv::gpu::DeviceInfo, cv::Size, MatDepth)
{ {
dst = cv::countNonZero(src); dst = cv::countNonZero(src);
} }
(void)dst;
} }
INSTANTIATE_TEST_CASE_P(Core, CountNonZero, testing::Combine( INSTANTIATE_TEST_CASE_P(Core, CountNonZero, testing::Combine(
......
...@@ -56,14 +56,14 @@ void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat ...@@ -56,14 +56,14 @@ void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat
#else #else
namespace cv { namespace gpu { namespace device namespace cv { namespace gpu { namespace device
{ {
namespace transform_points namespace transform_points
{ {
void call(const DevMem2D_<float3> src, const float* rot, const float* transl, DevMem2D_<float3> dst, cudaStream_t stream); void call(const DevMem2D_<float3> src, const float* rot, const float* transl, DevMem2D_<float3> dst, cudaStream_t stream);
} }
namespace project_points namespace project_points
{ {
void call(const DevMem2D_<float3> src, const float* rot, const float* transl, const float* proj, DevMem2D_<float2> dst, cudaStream_t stream); void call(const DevMem2D_<float3> src, const float* rot, const float* transl, const float* proj, DevMem2D_<float2> dst, cudaStream_t stream);
} }
...@@ -154,11 +154,11 @@ namespace ...@@ -154,11 +154,11 @@ namespace
class TransformHypothesesGenerator class TransformHypothesesGenerator
{ {
public: public:
TransformHypothesesGenerator(const Mat& object_, const Mat& image_, const Mat& dist_coef_, TransformHypothesesGenerator(const Mat& object_, const Mat& image_, const Mat& dist_coef_,
const Mat& camera_mat_, int num_points_, int subset_size_, const Mat& camera_mat_, int num_points_, int subset_size_,
Mat rot_matrices_, Mat transl_vectors_) Mat rot_matrices_, Mat transl_vectors_)
: object(&object_), image(&image_), dist_coef(&dist_coef_), camera_mat(&camera_mat_), : object(&object_), image(&image_), dist_coef(&dist_coef_), camera_mat(&camera_mat_),
num_points(num_points_), subset_size(subset_size_), rot_matrices(rot_matrices_), num_points(num_points_), subset_size(subset_size_), rot_matrices(rot_matrices_),
transl_vectors(transl_vectors_) {} transl_vectors(transl_vectors_) {}
void operator()(const BlockedRange& range) const void operator()(const BlockedRange& range) const
...@@ -211,9 +211,10 @@ namespace ...@@ -211,9 +211,10 @@ namespace
void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat, void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat,
const Mat& dist_coef, Mat& rvec, Mat& tvec, bool use_extrinsic_guess, const Mat& dist_coef, Mat& rvec, Mat& tvec, bool use_extrinsic_guess,
int num_iters, float max_dist, int min_inlier_count, int num_iters, float max_dist, int min_inlier_count,
vector<int>* inliers) vector<int>* inliers)
{ {
(void)min_inlier_count;
CV_Assert(object.rows == 1 && object.cols > 0 && object.type() == CV_32FC3); CV_Assert(object.rows == 1 && object.cols > 0 && object.type() == CV_32FC3);
CV_Assert(image.rows == 1 && image.cols > 0 && image.type() == CV_32FC2); CV_Assert(image.rows == 1 && image.cols > 0 && image.type() == CV_32FC2);
CV_Assert(object.cols == image.cols); CV_Assert(object.cols == image.cols);
...@@ -236,7 +237,7 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam ...@@ -236,7 +237,7 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam
Mat transl_vectors(1, num_iters * 3, CV_32F); Mat transl_vectors(1, num_iters * 3, CV_32F);
// Generate set of hypotheses using small subsets of the input data // Generate set of hypotheses using small subsets of the input data
TransformHypothesesGenerator body(object, image_normalized, empty_dist_coef, eye_camera_mat, TransformHypothesesGenerator body(object, image_normalized, empty_dist_coef, eye_camera_mat,
num_points, subset_size, rot_matrices, transl_vectors); num_points, subset_size, rot_matrices, transl_vectors);
parallel_for(BlockedRange(0, num_iters), body); parallel_for(BlockedRange(0, num_iters), body);
...@@ -246,7 +247,7 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam ...@@ -246,7 +247,7 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam
GpuMat d_hypothesis_scores(1, num_iters, CV_32S); GpuMat d_hypothesis_scores(1, num_iters, CV_32S);
solve_pnp_ransac::computeHypothesisScores( solve_pnp_ransac::computeHypothesisScores(
num_iters, num_points, rot_matrices.ptr<float>(), transl_vectors.ptr<float3>(), num_iters, num_points, rot_matrices.ptr<float>(), transl_vectors.ptr<float3>(),
d_object.ptr<float3>(), d_image_normalized.ptr<float2>(), max_dist * max_dist, d_object.ptr<float3>(), d_image_normalized.ptr<float2>(), max_dist * max_dist,
d_hypothesis_scores.ptr<int>()); d_hypothesis_scores.ptr<int>());
// Find the best hypothesis index // Find the best hypothesis index
......
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
} }
unsigned int process(const GpuMat& image, GpuMat& objectsBuf, float scaleFactor, int minNeighbors, unsigned int process(const GpuMat& image, GpuMat& objectsBuf, float scaleFactor, int minNeighbors,
bool findLargestObject, bool visualizeInPlace, cv::Size minSize, cv::Size maxObjectSize) bool findLargestObject, bool visualizeInPlace, cv::Size minSize, cv::Size /*maxObjectSize*/)
{ {
CV_Assert( scaleFactor > 1 && image.depth() == CV_8U); CV_Assert( scaleFactor > 1 && image.depth() == CV_8U);
...@@ -380,12 +380,12 @@ public: ...@@ -380,12 +380,12 @@ public:
LbpCascade(){} LbpCascade(){}
virtual ~LbpCascade(){} virtual ~LbpCascade(){}
virtual unsigned int process(const GpuMat& image, GpuMat& objects, float scaleFactor, int groupThreshold, bool findLargestObject, virtual unsigned int process(const GpuMat& image, GpuMat& objects, float scaleFactor, int groupThreshold, bool /*findLargestObject*/,
bool visualizeInPlace, cv::Size minObjectSize, cv::Size maxObjectSize) bool /*visualizeInPlace*/, cv::Size minObjectSize, cv::Size maxObjectSize)
{ {
CV_Assert(scaleFactor > 1 && image.depth() == CV_8U); CV_Assert(scaleFactor > 1 && image.depth() == CV_8U);
const int defaultObjSearchNum = 100; // const int defaultObjSearchNum = 100;
const float grouping_eps = 0.2f; const float grouping_eps = 0.2f;
if( !objects.empty() && objects.depth() == CV_32S) if( !objects.empty() && objects.depth() == CV_32S)
......
...@@ -52,9 +52,9 @@ void cv::gpu::matchTemplate(const GpuMat&, const GpuMat&, GpuMat&, int, Stream&) ...@@ -52,9 +52,9 @@ void cv::gpu::matchTemplate(const GpuMat&, const GpuMat&, GpuMat&, int, Stream&)
#else #else
namespace cv { namespace gpu { namespace device namespace cv { namespace gpu { namespace device
{ {
namespace match_template namespace match_template
{ {
void matchTemplateNaive_CCORR_8U(const DevMem2Db image, const DevMem2Db templ, DevMem2Df result, int cn, cudaStream_t stream); void matchTemplateNaive_CCORR_8U(const DevMem2Db image, const DevMem2Db templ, DevMem2Df result, int cn, cudaStream_t stream);
void matchTemplateNaive_CCORR_32F(const DevMem2Db image, const DevMem2Db templ, DevMem2Df result, int cn, cudaStream_t stream); void matchTemplateNaive_CCORR_32F(const DevMem2Db image, const DevMem2Db templ, DevMem2Df result, int cn, cudaStream_t stream);
...@@ -71,47 +71,47 @@ namespace cv { namespace gpu { namespace device ...@@ -71,47 +71,47 @@ namespace cv { namespace gpu { namespace device
void matchTemplatePrepared_CCOFF_8U(int w, int h, const DevMem2D_<unsigned int> image_sum, unsigned int templ_sum, DevMem2Df result, cudaStream_t stream); void matchTemplatePrepared_CCOFF_8U(int w, int h, const DevMem2D_<unsigned int> image_sum, unsigned int templ_sum, DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_8UC2( void matchTemplatePrepared_CCOFF_8UC2(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned int> image_sum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned int> image_sum_g,
unsigned int templ_sum_r, unsigned int templ_sum_r,
unsigned int templ_sum_g, unsigned int templ_sum_g,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_8UC3( void matchTemplatePrepared_CCOFF_8UC3(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned int> image_sum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned int> image_sum_g,
const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned int> image_sum_b,
unsigned int templ_sum_r, unsigned int templ_sum_r,
unsigned int templ_sum_g, unsigned int templ_sum_g,
unsigned int templ_sum_b, unsigned int templ_sum_b,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_8UC4( void matchTemplatePrepared_CCOFF_8UC4(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned int> image_sum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned int> image_sum_g,
const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned int> image_sum_b,
const DevMem2D_<unsigned int> image_sum_a, const DevMem2D_<unsigned int> image_sum_a,
unsigned int templ_sum_r, unsigned int templ_sum_r,
unsigned int templ_sum_g, unsigned int templ_sum_g,
unsigned int templ_sum_b, unsigned int templ_sum_b,
unsigned int templ_sum_a, unsigned int templ_sum_a,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_NORMED_8U( void matchTemplatePrepared_CCOFF_NORMED_8U(
int w, int h, const DevMem2D_<unsigned int> image_sum, int w, int h, const DevMem2D_<unsigned int> image_sum,
const DevMem2D_<unsigned long long> image_sqsum, const DevMem2D_<unsigned long long> image_sqsum,
unsigned int templ_sum, unsigned long long templ_sqsum, unsigned int templ_sum, unsigned long long templ_sqsum,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_NORMED_8UC2( void matchTemplatePrepared_CCOFF_NORMED_8UC2(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r, const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g, const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g,
unsigned int templ_sum_r, unsigned long long templ_sqsum_r, unsigned int templ_sum_r, unsigned long long templ_sqsum_r,
unsigned int templ_sum_g, unsigned long long templ_sqsum_g, unsigned int templ_sum_g, unsigned long long templ_sqsum_g,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_NORMED_8UC3( void matchTemplatePrepared_CCOFF_NORMED_8UC3(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r, const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g, const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g,
const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned long long> image_sqsum_b, const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned long long> image_sqsum_b,
...@@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace device ...@@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace device
unsigned int templ_sum_b, unsigned long long templ_sqsum_b, unsigned int templ_sum_b, unsigned long long templ_sqsum_b,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void matchTemplatePrepared_CCOFF_NORMED_8UC4( void matchTemplatePrepared_CCOFF_NORMED_8UC4(
int w, int h, int w, int h,
const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r, const DevMem2D_<unsigned int> image_sum_r, const DevMem2D_<unsigned long long> image_sqsum_r,
const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g, const DevMem2D_<unsigned int> image_sum_g, const DevMem2D_<unsigned long long> image_sqsum_g,
const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned long long> image_sqsum_b, const DevMem2D_<unsigned int> image_sum_b, const DevMem2D_<unsigned long long> image_sqsum_b,
...@@ -131,7 +131,7 @@ namespace cv { namespace gpu { namespace device ...@@ -131,7 +131,7 @@ namespace cv { namespace gpu { namespace device
unsigned int templ_sum_a, unsigned long long templ_sqsum_a, unsigned int templ_sum_a, unsigned long long templ_sqsum_a,
DevMem2Df result, cudaStream_t stream); DevMem2Df result, cudaStream_t stream);
void normalize_8U(int w, int h, const DevMem2D_<unsigned long long> image_sqsum, void normalize_8U(int w, int h, const DevMem2D_<unsigned long long> image_sqsum,
unsigned long long templ_sqsum, DevMem2Df result, int cn, cudaStream_t stream); unsigned long long templ_sqsum, DevMem2Df result, int cn, cudaStream_t stream);
void extractFirstChannel_32F(const DevMem2Db image, DevMem2Df result, int cn, cudaStream_t stream); void extractFirstChannel_32F(const DevMem2Db image, DevMem2Df result, int cn, cudaStream_t stream);
...@@ -140,17 +140,17 @@ namespace cv { namespace gpu { namespace device ...@@ -140,17 +140,17 @@ namespace cv { namespace gpu { namespace device
using namespace ::cv::gpu::device::match_template; using namespace ::cv::gpu::device::match_template;
namespace namespace
{ {
// Evaluates optimal template's area threshold. If // Evaluates optimal template's area threshold. If
// template's area is less than the threshold, we use naive match // template's area is less than the threshold, we use naive match
// template version, otherwise FFT-based (if available) // template version, otherwise FFT-based (if available)
int getTemplateThreshold(int method, int depth) int getTemplateThreshold(int method, int depth)
{ {
switch (method) switch (method)
{ {
case CV_TM_CCORR: case CV_TM_CCORR:
if (depth == CV_32F) return 250; if (depth == CV_32F) return 250;
if (depth == CV_8U) return 300; if (depth == CV_8U) return 300;
break; break;
...@@ -162,10 +162,10 @@ namespace ...@@ -162,10 +162,10 @@ namespace
return 0; return 0;
} }
void matchTemplate_CCORR_32F( void matchTemplate_CCORR_32F(
const GpuMat& image, const GpuMat& templ, GpuMat& result, MatchTemplateBuf &buf, Stream& stream) const GpuMat& image, const GpuMat& templ, GpuMat& result, MatchTemplateBuf &buf, Stream& stream)
{ {
result.create(image.rows - templ.rows + 1, image.cols - templ.cols + 1, CV_32F); result.create(image.rows - templ.rows + 1, image.cols - templ.cols + 1, CV_32F);
if (templ.size().area() < getTemplateThreshold(CV_TM_CCORR, CV_32F)) if (templ.size().area() < getTemplateThreshold(CV_TM_CCORR, CV_32F))
{ {
...@@ -223,10 +223,11 @@ namespace ...@@ -223,10 +223,11 @@ namespace
normalize_8U(templ.cols, templ.rows, buf.image_sqsums[0], templ_sqsum, result, image.channels(), StreamAccessor::getStream(stream)); normalize_8U(templ.cols, templ.rows, buf.image_sqsums[0], templ_sqsum, result, image.channels(), StreamAccessor::getStream(stream));
} }
void matchTemplate_SQDIFF_32F( void matchTemplate_SQDIFF_32F(
const GpuMat& image, const GpuMat& templ, GpuMat& result, MatchTemplateBuf &buf, Stream& stream) const GpuMat& image, const GpuMat& templ, GpuMat& result, MatchTemplateBuf &buf, Stream& stream)
{ {
(void)buf;
result.create(image.rows - templ.rows + 1, image.cols - templ.cols + 1, CV_32F); result.create(image.rows - templ.rows + 1, image.cols - templ.cols + 1, CV_32F);
matchTemplateNaive_SQDIFF_32F(image, templ, result, image.channels(), StreamAccessor::getStream(stream)); matchTemplateNaive_SQDIFF_32F(image, templ, result, image.channels(), StreamAccessor::getStream(stream));
} }
...@@ -362,7 +363,7 @@ namespace ...@@ -362,7 +363,7 @@ namespace
{ {
case 2: case 2:
matchTemplatePrepared_CCOFF_NORMED_8UC2( matchTemplatePrepared_CCOFF_NORMED_8UC2(
templ.cols, templ.rows, templ.cols, templ.rows,
buf.image_sums[0], buf.image_sqsums[0], buf.image_sums[0], buf.image_sqsums[0],
buf.image_sums[1], buf.image_sqsums[1], buf.image_sums[1], buf.image_sqsums[1],
(unsigned int)templ_sum[0], (unsigned long long)templ_sqsum[0], (unsigned int)templ_sum[0], (unsigned long long)templ_sqsum[0],
...@@ -371,7 +372,7 @@ namespace ...@@ -371,7 +372,7 @@ namespace
break; break;
case 3: case 3:
matchTemplatePrepared_CCOFF_NORMED_8UC3( matchTemplatePrepared_CCOFF_NORMED_8UC3(
templ.cols, templ.rows, templ.cols, templ.rows,
buf.image_sums[0], buf.image_sqsums[0], buf.image_sums[0], buf.image_sqsums[0],
buf.image_sums[1], buf.image_sqsums[1], buf.image_sums[1], buf.image_sqsums[1],
buf.image_sums[2], buf.image_sqsums[2], buf.image_sums[2], buf.image_sqsums[2],
...@@ -382,7 +383,7 @@ namespace ...@@ -382,7 +383,7 @@ namespace
break; break;
case 4: case 4:
matchTemplatePrepared_CCOFF_NORMED_8UC4( matchTemplatePrepared_CCOFF_NORMED_8UC4(
templ.cols, templ.rows, templ.cols, templ.rows,
buf.image_sums[0], buf.image_sqsums[0], buf.image_sums[0], buf.image_sqsums[0],
buf.image_sums[1], buf.image_sqsums[1], buf.image_sums[1], buf.image_sqsums[1],
buf.image_sums[2], buf.image_sqsums[2], buf.image_sums[2], buf.image_sqsums[2],
...@@ -391,7 +392,7 @@ namespace ...@@ -391,7 +392,7 @@ namespace
(unsigned int)templ_sum[1], (unsigned long long)templ_sqsum[1], (unsigned int)templ_sum[1], (unsigned long long)templ_sqsum[1],
(unsigned int)templ_sum[2], (unsigned long long)templ_sqsum[2], (unsigned int)templ_sum[2], (unsigned long long)templ_sqsum[2],
(unsigned int)templ_sum[3], (unsigned long long)templ_sqsum[3], (unsigned int)templ_sum[3], (unsigned long long)templ_sqsum[3],
result, StreamAccessor::getStream(stream)); result, StreamAccessor::getStream(stream));
break; break;
default: default:
CV_Error(CV_StsBadArg, "matchTemplate: unsupported number of channels"); CV_Error(CV_StsBadArg, "matchTemplate: unsupported number of channels");
......
...@@ -119,7 +119,6 @@ namespace ...@@ -119,7 +119,6 @@ namespace
int depth = src.depth(); int depth = src.depth();
int num_channels = src.channels(); int num_channels = src.channels();
Size size = src.size();
if (depth == CV_64F) if (depth == CV_64F)
{ {
......
...@@ -302,13 +302,13 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int) ...@@ -302,13 +302,13 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
TEST_P(LBP_Read_classifier, Accuracy) TEST_P(LBP_Read_classifier, Accuracy)
{ {
cv::gpu::CascadeClassifier_GPU classifier; cv::gpu::CascadeClassifier_GPU classifier;
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml"; std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";
ASSERT_TRUE(classifier.load(classifierXmlPath)); ASSERT_TRUE(classifier.load(classifierXmlPath));
} }
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier, INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,
testing::Combine(ALL_DEVICES, testing::Values<int>(0))); testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int) PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)
...@@ -344,31 +344,32 @@ TEST_P(LBP_classify, Accuracy) ...@@ -344,31 +344,32 @@ TEST_P(LBP_classify, Accuracy)
for (; it != rects.end(); ++it) for (; it != rects.end(); ++it)
cv::rectangle(markedImage, *it, CV_RGB(0, 0, 255)); cv::rectangle(markedImage, *it, CV_RGB(0, 0, 255));
cv::gpu::CascadeClassifier_GPU gpuClassifier; cv::gpu::CascadeClassifier_GPU gpuClassifier;
ASSERT_TRUE(gpuClassifier.load(classifierXmlPath)); ASSERT_TRUE(gpuClassifier.load(classifierXmlPath));
cv::gpu::GpuMat gpu_rects; cv::gpu::GpuMat gpu_rects;
cv::gpu::GpuMat tested(grey); cv::gpu::GpuMat tested(grey);
int count = gpuClassifier.detectMultiScale(tested, gpu_rects); int count = gpuClassifier.detectMultiScale(tested, gpu_rects);
#if defined (LOG_CASCADE_STATISTIC)
cv::Mat downloaded(gpu_rects); cv::Mat downloaded(gpu_rects);
const cv::Rect* faces = downloaded.ptr<cv::Rect>(); const cv::Rect* faces = downloaded.ptr<cv::Rect>();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
cv::Rect r = faces[i]; cv::Rect r = faces[i];
#if defined (LOG_CASCADE_STATISTIC) std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl;
std::cout << r.x << " " << r.y << " " << r.width << " " << r.height << std::endl;
cv::rectangle(markedImage, r , CV_RGB(255, 0, 0)); cv::rectangle(markedImage, r , CV_RGB(255, 0, 0));
#endif
} }
#endif
#if defined (LOG_CASCADE_STATISTIC) #if defined (LOG_CASCADE_STATISTIC)
cv::imshow("Res", markedImage); cv::waitKey(); cv::imshow("Res", markedImage); cv::waitKey();
#endif #endif
(void)count;
} }
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify, INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify,
testing::Combine(ALL_DEVICES, testing::Values<int>(0))); testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
} // namespace } // namespace
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment