added performance test for LBP classifier.

pull/2/head
Marina Kolpakova 13 years ago
parent 51f6127e0a
commit 248f39e13e
  1. 27
      modules/gpu/perf/perf_objdetect.cpp
  2. 22
      modules/gpu/perf_cpu/perf_objdetect.cpp
  3. 4
      modules/gpu/src/cascadeclassifier.cpp
  4. 10
      modules/gpu/test/nvidia/TestRectStdDev.cpp
  5. 2
      modules/gpu/test/test_warp_affine.cpp
  6. 2
      modules/gpu/test/test_warp_perspective.cpp

@ -57,4 +57,31 @@ GPU_PERF_TEST_1(HaarClassifier, cv::gpu::DeviceInfo)
INSTANTIATE_TEST_CASE_P(ObjDetect, HaarClassifier, ALL_DEVICES);
//===================== LBP cascade ==========================//
GPU_PERF_TEST_1(LBPClassifier, cv::gpu::DeviceInfo)
{
cv::gpu::DeviceInfo devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
cv::Mat img_host = readImage("gpu/haarcascade/group_1_640x480_VGA.pgm", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(img_host.empty());
cv::gpu::CascadeClassifier_GPU_LBP cascade;
ASSERT_TRUE(cascade.load(perf::TestBase::getDataPath("gpu/lbpcascade/lbpcascade_frontalface.xml")));
cv::gpu::GpuMat img(img_host);
cv::gpu::GpuMat gpu_rects, buffer;
// cascade.detectMultiScale(img, objects_buffer);
cascade.detectMultiScale(img, buffer, gpu_rects);
TEST_CYCLE()
{
cascade.detectMultiScale(img, buffer, gpu_rects);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, LBPClassifier, ALL_DEVICES);
#endif

@ -49,4 +49,26 @@ GPU_PERF_TEST_1(HaarClassifier, cv::gpu::DeviceInfo)
INSTANTIATE_TEST_CASE_P(ObjDetect, HaarClassifier, ALL_DEVICES);
//===================== LBP cascade ==========================//
GPU_PERF_TEST_1(LBPClassifier, cv::gpu::DeviceInfo)
{
cv::Mat img = readImage("gpu/haarcascade/group_1_640x480_VGA.pgm", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(img.empty());
cv::CascadeClassifier cascade;
ASSERT_TRUE(cascade.load(perf::TestBase::getDataPath("gpu/lbpcascade/lbpcascade_frontalface.xml")));
std::vector<cv::Rect> rects;
cascade.detectMultiScale(img, rects);
TEST_CYCLE()
{
cascade.detectMultiScale(img, rects);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, LBPClassifier, ALL_DEVICES);
#endif

@ -350,7 +350,9 @@ int cv::gpu::CascadeClassifier_GPU_LBP::detectMultiScale(const GpuMat& image, Gp
if (groupThreshold <= 0 || objects.empty())
return 0;
return cv::gpu::device::lbp::connectedConmonents(candidates, groupThreshold, grouping_eps, dclassified);
cv::gpu::device::lbp::connectedConmonents(candidates, groupThreshold, grouping_eps, dclassified);
cudaSafeCall( cudaDeviceSynchronize() );
return *classified;
}
// ============ old fashioned haar cascade ==============================================//

@ -1,11 +1,11 @@
/*
* Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* agreement from NVIDIA Corporation is strictly prohibited.
*/

@ -185,8 +185,6 @@ PARAM_TEST_CASE(WarpAffine, cv::gpu::DeviceInfo, cv::Size, MatType, Inverse, Int
int borderType;
bool useRoi;
cv::Mat M;
virtual void SetUp()
{
devInfo = GET_PARAM(0);

@ -185,8 +185,6 @@ PARAM_TEST_CASE(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, MatType, Inverse
int borderType;
bool useRoi;
cv::Mat M;
virtual void SetUp()
{
devInfo = GET_PARAM(0);

Loading…
Cancel
Save