Repository: opencv
Issue: OpenEXR image reads only zeros from depth map
Labels: category: imgcodecs,needs investigation

##### System information (version)

- OpenCV => 4.5.5
- Operating System / Platform => Linux 64 Bit
- Compiler => GCC 8.4.0

##### Detailed description

I have [exr file](https://www.polarnick.com/static/2022/09/d4.exr) with depth map (generated in Agisoft Metashape). And I ensured that it contains non-zero values - using openexr-viewer (version 0.5.2):

![image](https://user-images.githubusercontent.com/1218605/193267726-33f13df7-6d73-4da1-85be-07905a0d2b2a.png)


##### Steps to reproduce

But when I try to read this file in OpenCV (built with fresh OpenEXR::OpenEXR (ver 3.1.5)) - I got only zero values.

Script for building OpenEXR 3.1.5 + OpenCV 4.5.5 (**configure.sh**) and source code (**CMakeLists.txt** and **main.cpp**) for reproducing - https://gist.github.com/PolarNick239/8dfda5a6ed34a46bfeeb422ed6194771

Note that it doesn't work with default old OpenEXR 2.3.0 too (even with OPENCV_IO_ENABLE_OPENEXR=1).

1) Create **SOME_DIR** for OpenEXR and OpenCV build + install
2) cd **SOME_DIR**
3) download **configure.sh**, **CMakeLists.txt** and **main.cpp** (from [here](https://gist.github.com/PolarNick239/8dfda5a6ed34a46bfeeb422ed6194771)) to **SOME_DIR**
4) chmod +x configure.sh
5) ./configure.sh
6) build/TestCVEXR ".../path/to/d4.exr"

Found output:

```
Image size: 384x256
contains only zeros
Image size: 384x256
contains only zeros
Image size: 384x256
contains only zeros
```

Expected output: "non-zero values found"

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with questions without a real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found any solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to the latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only the latest release for each branch.
   The ticket is closed if the problem is not reproduced with the modern version.
   -->
 - [x] There is reproducer code and related data files: image
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as an archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->