Skip to content

Add CV_16UC1 support for cuda::CLAHE - #13764

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
nglee:dev_CudaCLAHE16bitSupport
Feb 8, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
nglee:dev_CudaCLAHE16bitSupport

Conversation

@nglee

@nglee nglee commented Feb 5, 2019 •

Copy link
Copy Markdown
Contributor

Merge with extra: opencv/opencv_extra#573

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.

Related : opencv/opencv_contrib#1958

Performance test on 2080 Ti and CUDA 10 :

Type Image Size Clip Limit CPU CUDA
CV_8UC1 1280x720 0 0.72 0.04
CV_8UC1 1280x720 40 0.73 0.04
CV_8UC1 1920x1080 0 1.59 0.08
CV_8UC1 1920x1080 40 1.60 0.08
CV_16UC1 1280x720 0 2.45 1.08
CV_16UC1 1280x720 40 2.92 1.32
CV_16UC1 1920x1080 0 4.24 1.78
CV_16UC1 1920x1080 40 4.70 1.98
force_builders=Custom
docker_image:Custom=ubuntu-cuda:16.04
buildworker:Custom=linux-1

@nglee
nglee force-pushed the dev_CudaCLAHE16bitSupport branch 2 times, most recently from 241c464 to 19d63bf Compare February 6, 2019 04:39
@nglee

nglee commented Feb 6, 2019

Copy link
Copy Markdown
Contributor Author

@alalek How do we add regression data to perf tests? The builds fail with messages such as:

/build/precommit_linux64/3.4/opencv/modules/ts/src/ts_perf.cpp:625: Failure
Failed
  No regression data for dst argument, test node: Sz_ClipLimit_CLAHE--CLAHE---640x480--0--8UC1-

@alalek

alalek commented Feb 6, 2019

Copy link
Copy Markdown
Member

Wiki page: https://github.com/opencv/opencv/wiki/HowToUsePerfTests#how-to-update-perf-data

Or use SANITY_CHECK_NOTHING(): accuracy checks in performance tests are usually not reliable.

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.
@nglee
nglee force-pushed the dev_CudaCLAHE16bitSupport branch from 19d63bf to fb8e652 Compare February 6, 2019 17:23

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants