Skip to content

EXR reading: support Z channel if no Y channel#20201

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
PolarNick239:3.4
Jun 3, 2021
Merged

EXR reading: support Z channel if no Y channel#20201
opencv-pushbot merged 1 commit intoopencv:3.4from
PolarNick239:3.4

Conversation

@PolarNick239
Copy link
Copy Markdown
Contributor

Hi, some applications can produce float32 depth maps in OpenEXR format and they can use Z channel instead of Y channel (but only Y is supported in OpenCV). And this is quite natural because Z channel is a "Distance of the front of a sample from the viewer" - see OpenEXR documentation.

Currently if you will try to read such float32 .exr image with single Z channel via imread(path, cv::IMREAD_UNCHANGED) - empty image will be returned.

The proposed fix will try to find Z channel only if no Y channel is found (i.e. this fix is backwards compatible).

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@PolarNick239
Copy link
Copy Markdown
Contributor Author

This is re-PR of PR #19893 (but to the proper branch - 3.4).

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution 👍

@opencv-pushbot opencv-pushbot merged commit c34445a into opencv:3.4 Jun 3, 2021
This was referenced Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants