1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Add CV_16UC1 support for cuda::CLAHE

Due to size limit of shared memory, histogram is built on
the global memory for CV_16UC1 case.

The amount of memory needed for building histogram is:

    65536 * 4byte = 256KB

and shared memory limit is 48KB typically.

Added test cases for CV_16UC1 and various clip limits.
Added perf tests for CV_16UC1 on both CPU and CUDA code.

There was also a bug in CV_8UC1 case when redistributing
"residual" clipped pixels. Adding the test case where clip
limit is 5.0 exposes this bug.
This commit is contained in:
Namgoo Lee
2019-02-05 16:37:33 +00:00
parent a63f66c90e
commit fb8e652c3f
6 changed files with 285 additions and 31 deletions
+5 -3
View File
@@ -183,16 +183,18 @@ PERF_TEST_P(Sz, EqualizeHist,
//////////////////////////////////////////////////////////////////////
// CLAHE
DEF_PARAM_TEST(Sz_ClipLimit, cv::Size, double);
DEF_PARAM_TEST(Sz_ClipLimit, cv::Size, double, MatType);
PERF_TEST_P(Sz_ClipLimit, CLAHE,
Combine(CUDA_TYPICAL_MAT_SIZES,
Values(0.0, 40.0)))
Values(0.0, 40.0),
Values(MatType(CV_8UC1), MatType(CV_16UC1))))
{
const cv::Size size = GET_PARAM(0);
const double clipLimit = GET_PARAM(1);
const int type = GET_PARAM(2);
cv::Mat src(size, CV_8UC1);
cv::Mat src(size, type);
declare.in(src, WARMUP_RNG);
if (PERF_RUN_CUDA())