cadik / TMS

Tone Mapping Studio
GNU General Public License v2.0
58 stars 50 forks source link

update plugins to have output in range [0,1] #84

Open freetomik opened 5 years ago

freetomik commented 5 years ago

As said in #83, plugins' output is expected to be in range [0,1] to get them correctly work with tmocmd, otherwise result image has wrong luminance range.

More plugins does not respect that. There are some I have tested - name and output range: Ward94: 0-1.8 CLAHE: 0-344 Biswas05: 0-2.3 Ancuti16: 0-255 Zhongping15: from 0-1 to 0-11.4 (Tested with image with input range 0-241.)

With OpenCV it is matter of calling function

cv::normalize(image, image, 0, 1, cv::NORM_MINMAX, image.type());

before writing result image to output.

For plugins which don't use OpenCV, it should be possible with help of minLum and maxLum from TMOImage.statistics I guess.

Also it will be good to write some guideline for writing plugins and mention this output range there.

freetomik commented 5 years ago

done for Kou15