cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.41k stars 2.98k forks source link

[Feature request] Using CLAHE for Histogram equalization #4929

Open Crescent-Saturn opened 2 years ago

Crescent-Saturn commented 2 years ago

My actions before raising this issue

In some cases, raw images are hard to annotated due to their contrasts, brightness, etc. It is great to see that CVAT has already integrated the Histogram equalization with OpenCV tools in the GUI. However, the default cv.equalizeHist function may work well as it considers the global contrast of the image. This can be improved by using the CLAHE (Contrast Limited Adaptive Histogram Equalization) algo which exists already in OpenCV.

Expected Behaviour

Using CLAHE to perform histogram equalization.

Current Behaviour

Using cv.equalizeHist function to permform histogram equalization. #3447

Possible Solution

Replace cv.equalizeHist by cv.CLAHE(clipLimit, tileGridSize) and cv.CLAHE().apply().

Where clipLimit and titleGridSize may be adjusted by adding a Trackbar.

Steps to Reproduce (for bugs)

1. 1. 1. 1.

Context

Thanks for consideration!

Your Environment

nmanovic commented 2 years ago

@Crescent-Saturn , could you please contribute?

Crescent-Saturn commented 2 years ago

@Crescent-Saturn , could you please contribute?

Hi, @nmanovic , thanks for consideration. Alright, I would like to have a try. Once completed, I will make a PR.