OpenEXR image is very dark when displaying
Hello, i am trying to show an OpenEXR file with OpenCV. The code is quite simple and loading of the OpenEXR seems to work.
cv::Mat inputImage = cv::imread("e:\\Daten\\Maya\\Projects\\bedroom\\tmp\\Bedroom2012.exr);
cv::imshow("Display Image", inputImage);
When I load the a jpg everything looks the same compared to other image viewer. When I now load the exr file, the image is totally black. But there is a bright spot where i have very high white values (light bulb).
Do I need to convert the image data somehow? It is not the normal gamma 2.2 issue you got with exr files. Any ideas?
To me it seems that the data might be incorrectly scaled to the proper range for the imshow function. How are normal EXR values ranged (limited experience with EXR here)?
Hi Steven, thanks for the quick reply.
Do you mean the bit range? Normally the exr is saved in 32 bit float. The image resolution is recognized correctly when I load an exr file.
Maybe I am missing some flags witth imread or imshow?
Looking at the docs of imshow, it seems that there are three possible ranges for imshow
Can you verify that in your case all values are in the range [0 1]?
I think the problem here is that the range is higher than 1. E.g: 0 - 2000. And that is whay the values are getting to dark. So I need something like a mapping colors based on the max value of the image file.
Hmm that can be done by grabbing your max and min value, mapping those to 0 and 1 then calculating the step you need to take and retransfer all data in between 0 1. The high values are indeed the killer in the visualisation here.