Skip to content

Commit

Permalink
added perf test for CalcBackProj
Browse files Browse the repository at this point in the history
  • Loading branch information
mlyashko committed Mar 25, 2014
1 parent 2299e2e commit f38fe76
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions modules/imgproc/perf/opencl/perf_imgproc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,34 @@ OCL_PERF_TEST_P(CalcHistFixture, CalcHist, OCL_TEST_SIZES)
SANITY_CHECK(hist);
}

///////////// calcHist ////////////////////////

typedef TestBaseWithParam<Size> CalcBackProjFixture;

OCL_PERF_TEST_P(CalcBackProjFixture, CalcBackProj, OCL_TEST_SIZES)
{
const Size srcSize = GetParam();

const std::vector<int> channels(1, 0);
std::vector<float> ranges(2);
std::vector<int> histSize(1, 256);
ranges[0] = 0;
ranges[1] = 256;

checkDeviceMaxMemoryAllocSize(srcSize, CV_8UC1);

UMat src(srcSize, CV_8UC1), hist(256, 1, CV_32FC1), dst(srcSize, CV_8UC1);
declare.in(src, WARMUP_RNG).out(hist);

cv::calcHist(std::vector<UMat>(1, src), channels, noArray(), hist, histSize, ranges, false);

declare.in(src, WARMUP_RNG).out(dst);
OCL_TEST_CYCLE() cv::calcBackProject(std::vector<UMat>(1,src), channels, hist, dst, ranges, 1);

SANITY_CHECK(dst, 1e-3);
}


/////////// CopyMakeBorder //////////////////////

CV_ENUM(Border, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT, BORDER_WRAP, BORDER_REFLECT_101)
Expand Down

0 comments on commit f38fe76

Please sign in to comment.