Skip to content

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

Closed
PolarNick239 wants to merge 2142 commits intoopencv:3.4from
PolarNick239:master
Closed

EXR reading: support Z channel if no Y channel#19893
PolarNick239 wants to merge 2142 commits intoopencv:3.4from
PolarNick239:master

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

alalek and others added 30 commits December 31, 2020 10:32
Add missing `#include <thread>` in modules/gapi/test/test_precomp.hpp
G-API: ONNX. Const input

* Added const input for ONNX backend

* Returned initMatrixRandu, added some comments, rebase
[G-API]: Performance tests for boundingRect

* Update boundingRect() tests with the changes from fitLine() PR

* Add performance tests for boundingRect

* Applying comment about g_type_of_t

* Addressing comments

* Addressing comment: replace cmp_f by CompareF in perf.tests + add the default constructor for CompareF

* Fix typo
- migrate GStreamer backed
- migrate FFmpeg backend (with switch on legacy API)
- cv_videoio_capture_retrieve_cb_t uses Mat type instead of number of channels
- use lazy on-demand initialization
A small clerical error of an author. The correct expression should be "xy += x_*y_;".
…re_write

videoio(plugins): split capture and writer APIs
lionkunonly and others added 24 commits April 1, 2021 12:29
* fix the perf tests of OpenCV.js so that it can run on Node.js successfully

* do not modify the CMakeLists.txt

Co-authored-by: lionkun <871518554@qq.com>
[G-API] Fix bug of GArray<GArray> passing through a graph

* Add test to check GArray<GArray> passing through a graph (assertion failed)

* G-API: Flatten GArray<T> to std::vector<T> when capturing VCtr

- Also: Fix formatting in garray.hpp

* Refactored test, added valuable check

* Initialize size_t

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
[GSoC] Added TF and PyTorch segmentation conversion cases

* WIP: Added conversion of segmentation models

* Added tutorial mds

* remove unused
[GSoC] Added TF and PyTorch detection model conversion cases

* Added object detection convertion pipeline and tutorials

* Added tutorial corrections
HAVE_QT and HAVE_WIN32UI can both be true at the same time
if HAVE_QT, window_w32.cpp is not included in the build, see CMakeLists.txt
@alalek
Copy link
Copy Markdown
Member

alalek commented Apr 14, 2021

Thank you for the contribution!

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@asmorkalov
Copy link
Copy Markdown
Contributor

@PolarNick239 Friendly reminder.

@PolarNick239 PolarNick239 changed the base branch from master to 3.4 June 2, 2021 12:27
@PolarNick239
Copy link
Copy Markdown
Contributor Author

After configuring upstream - command git rebase -i --onto upstream/3.4 upstream/master leads to:

fatal: Needed a single revision
invalid upstream upstream/master

I will recreate the PR from forked 3.4 branch to 3.4 upstream branch, this is much easier.

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.