EXR alpha support for 4 channel reading and writing#19655
Conversation
9bde4a5 to
9784b39
Compare
| { | ||
| const string root = cvtest::TS::ptr()->get_data_path(); | ||
| const string filenameInput = root + "readwrite/test_YRYBYA.exr"; | ||
| const string filenameOutput = root + "readwrite/test_YRYBYA.written.removedalpha.exr"; |
There was a problem hiding this comment.
Tests should not write to testdata location by default. It may be mounted in read-only mode (and shared between validation build instances).
Consider using GENERATE_DATA approach to generate test data (write to testdata location "locally" and then commit generated files).
Use cv::tempfile() to generate names for temporary files.
You need to open PR in opencv_extra (with the same source branch name EXR_rw_alpha_support_16115), not in your fork.
There was a problem hiding this comment.
Thank you @alalek. Good points. I see the issue with writing to testdata location. I updated to write to cv::tempfile() location & name.
I updated the code to use GENERATE_DATA for the RGBA test case (and committed a generated RGBA test image to opencv_extra). GENERATE_DATA will not work for YA or YRYBY(A) test images as the current EXR write only supports RGB(A) or Y (all input chroma files are convereted to RGB(A) or Y(A) on read), and loadsave doesn't support YA (2 channel) write.
I believe I updated the opencv_extra PR as instructed: opencv/opencv_extra#859
There was a problem hiding this comment.
Hi @alalek. Are there further changes to my PR you would like to see?
Thank you.
30845b8 to
cc22a73
Compare
Merge with extra: opencv/opencv_extra#859
EXR alpha support for 4 channel reading and writing. Issue #16115.
Replaced magic numbers (3 and 4) with const variables where possible to enhance readability and mantainability.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.