gpu: added Cascade and mulAndScaleSpectrums perf tests

pull/2/head
Anatoly Baksheev 13 years ago
parent e703e8f5a6
commit 671233cd46
  1. 69
      modules/gpu/perf/perf_imgproc.cpp
  2. 28
      modules/gpu/perf/perf_objdetect.cpp
  3. 53
      modules/gpu/perf_cpu/perf_arithm.cpp
  4. 27
      modules/gpu/perf_cpu/perf_imgproc.cpp
  5. 23
      modules/gpu/perf_cpu/perf_objdetect.cpp
  6. 2258
      modules/gpu/test/test_imgproc.cpp

@ -1020,4 +1020,73 @@ INSTANTIATE_TEST_CASE_P(ImgProc, ImagePyramid_getLayer, testing::Combine(
GPU_TYPICAL_MAT_SIZES,
testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4)));
//////////////////////////////////////////////////////////////////////
// MulAndScaleSpectrums
GPU_PERF_TEST(MulAndScaleSpectrums, cv::gpu::DeviceInfo, cv::Size)
{
cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::Size size = GET_PARAM(1);
cv::gpu::setDevice(devInfo.deviceID());
int type = CV_32FC2;
cv::Mat src1_host(size, type);
cv::Mat src2_host(size, type);
declare.in(src1_host, src2_host, WARMUP_RNG);
cv::gpu::GpuMat src1(src1_host);
cv::gpu::GpuMat src2(src2_host);
cv::gpu::GpuMat dst(size, type);
TEST_CYCLE()
{
cv::gpu::mulSpectrums(src1, src2, dst, cv::DFT_ROWS, false);
}
}
INSTANTIATE_TEST_CASE_P(ImgProc, MulAndScaleSpectrums, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES));
//////////////////////////////////////////////////////////////////////
// MulAndScaleSpectrumsScale
GPU_PERF_TEST(MulAndScaleSpectrumsScale, cv::gpu::DeviceInfo, cv::Size)
{
cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::Size size = GET_PARAM(1);
float scale = 1.f / size.area();
int type = CV_32FC2;
cv::gpu::setDevice(devInfo.deviceID());
cv::Mat src1_host(size, type);
cv::Mat src2_host(size, type);
declare.in(src1_host, src2_host, WARMUP_RNG);
cv::gpu::GpuMat src1(src1_host);
cv::gpu::GpuMat src2(src2_host);
cv::gpu::GpuMat dst(size, type);
TEST_CYCLE()
{
cv::gpu::mulAndScaleSpectrums(src1, src2, dst, cv::DFT_ROWS, scale, false);
}
}
INSTANTIATE_TEST_CASE_P(ImgProc, MulAndScaleSpectrumsScale, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES));
#endif

@ -24,4 +24,32 @@ GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)
INSTANTIATE_TEST_CASE_P(ObjDetect, HOG, ALL_DEVICES);
CV_FLAGS(DftFlags, 0, cv::DFT_INVERSE, cv::DFT_SCALE, cv::DFT_ROWS, cv::DFT_COMPLEX_OUTPUT, cv::DFT_REAL_OUTPUT)
GPU_PERF_TEST_1(HaarClassifier, cv::gpu::DeviceInfo, DftFlags)
{
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);
cv::gpu::CascadeClassifier_GPU cascade;
if (!cascade.load("haarcascade_frontalface_alt.xml"))
CV_Error(0, "Can't load cascade");
cv::gpu::GpuMat img(img_host);
cv::gpu::GpuMat objects_buffer(1, 100, cv::DataType<cv::Rect>::type);
TEST_CYCLE()
{
cascade.detectMultiScale(img, objects_buffer);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, HaarClassifier, ALL_DEVICES);
#endif

@ -636,6 +636,59 @@ INSTANTIATE_TEST_CASE_P(Arithm, BitwiseScalarOr, testing::Combine(
testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32SC1, CV_32SC3, CV_32SC4)));
//////////////////////////////////////////////////////////////////////
// BitwiseXor
GPU_PERF_TEST(BitwiseXor, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
{
cv::Size size = GET_PARAM(1);
int type = GET_PARAM(2);
cv::Mat src1(size, type);
cv::Mat src2(size, type);
declare.in(src1, src2, WARMUP_RNG);
cv::Mat dst;
TEST_CYCLE()
{
cv::bitwise_xor(src1, src2, dst);
}
}
INSTANTIATE_TEST_CASE_P(Arithm, BitwiseXor, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES,
testing::Values(CV_8UC1, CV_16UC1, CV_32SC1)));
//////////////////////////////////////////////////////////////////////
// BitwiseScalarXor
GPU_PERF_TEST(BitwiseScalarXor, cv::gpu::DeviceInfo, cv::Size, perf::MatType)
{
cv::Size size = GET_PARAM(1);
int type = GET_PARAM(2);
cv::Mat src(size, type);
declare.in(src, WARMUP_RNG);
cv::Mat dst;
cv::Scalar sc = cv::Scalar(123, 123, 123, 123);
TEST_CYCLE()
{
cv::bitwise_xor(src, sc, dst);
}
}
INSTANTIATE_TEST_CASE_P(Arithm, BitwiseScalarXor, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES,
testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32SC1, CV_32SC3, CV_32SC4)));
//////////////////////////////////////////////////////////////////////
// Min

@ -533,4 +533,31 @@ INSTANTIATE_TEST_CASE_P(ImgProc, EqualizeHist, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES));
//////////////////////////////////////////////////////////////////////
// MulAndScaleSpectrums
GPU_PERF_TEST(MulAndScaleSpectrums, cv::gpu::DeviceInfo, cv::Size)
{
cv::Size size = GET_PARAM(1);
int type = CV_32FC2;
cv::Mat src1(size, type);
cv::Mat src2(size, type);
cv::Mat dst(size, type);
declare.in(src1, src2, WARMUP_RNG);
TEST_CYCLE()
{
cv::mulSpectrums(src1, src2, dst, cv::DFT_ROWS, false);
}
}
INSTANTIATE_TEST_CASE_P(ImgProc, MulAndScaleSpectrums, testing::Combine(
ALL_DEVICES,
GPU_TYPICAL_MAT_SIZES));
#endif

@ -19,4 +19,27 @@ GPU_PERF_TEST_1(HOG, cv::gpu::DeviceInfo)
INSTANTIATE_TEST_CASE_P(ObjDetect, HOG, ALL_DEVICES);
GPU_PERF_TEST_1(HaarClassifier, cv::gpu::DeviceInfo)
{
cv::Mat img = readImage("gpu/haarcascade/group_1_640x480_VGA.pgm", cv::IMREAD_GRAYSCALE);
cv::CascadeClassifier cascade;
if (!cascade.load("haarcascade_frontalface_alt.xml"))
CV_Error(0, "Can't load cascade");
std::vector<cv::Rect> rects;
rects.reserve(1000);
TEST_CYCLE()
{
cascade.detectMultiScale(img, rects);
}
}
INSTANTIATE_TEST_CASE_P(ObjDetect, HaarClassifier, ALL_DEVICES);
#endif

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save