Merge pull request #10283 from zhijackchen:exr_export
authorzhijackchen <31141072+zhijackchen@users.noreply.github.com>
Fri, 15 Dec 2017 09:23:44 +0000 (01:23 -0800)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Fri, 15 Dec 2017 09:23:44 +0000 (12:23 +0300)
commit6df8ac03422784a94f5ccf78e4c68788ef055e7b
tree8918764561571e7fd7ca7d23bcd116434d3fb85f
parent18ff806d5b38131a5123d77d219036995eec41f2
Merge pull request #10283 from zhijackchen:exr_export

* Fix issue #10114
Convert table change
From:
CV_8U -> HALF
CV_8S -> HALF
CV_16U -> UINT
CV_16S -> UINT
CV_32S -> UINT
CV_32F -> FLOAT
To:
CV_8U -> HALF
CV_8S -> HALF
CV_16U -> UINT
CV_16S -> FLOAT
CV_32S -> FLOAT loss precision
CV_32F -> FLOAT
Signed integer can't be presented well with UINT. Even adjust bias, CV16S and CV32S will be confused when load from exr file.
Also fix CV_8S negative value incorrect bug

* EXR import and export
imread() from EXR returns CV_32F only
imwrite() accepts CV_32 cv::Mat only and stores FLOAT images by default. Add imwrite() flag to store in HALF format.

* fix compiling error

* clean up

* fix EXR import issues
modules/imgcodecs/include/opencv2/imgcodecs.hpp
modules/imgcodecs/include/opencv2/imgcodecs/imgcodecs_c.h
modules/imgcodecs/src/grfmt_exr.cpp