Skip to content

G-API media format gray#21511

Merged
alalek merged 34 commits intoopencv:4.xfrom
dbudniko:dbudniko/gapi_media_format_gray
Feb 3, 2022
Merged

G-API media format gray#21511
alalek merged 34 commits intoopencv:4.xfrom
dbudniko:dbudniko/gapi_media_format_gray

Conversation

@dbudniko
Copy link
Copy Markdown

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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.4.1:20.04
build_image:Custom Win=openvino-2021.4.1
build_image:Custom Mac=openvino-2021.4.1

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@smirnov-alexey
Copy link
Copy Markdown
Contributor

@dbudniko please, add tests on GRAY color format

Copy link
Copy Markdown
Contributor

@AsyaPronina AsyaPronina left a comment

Choose a reason for hiding this comment

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

Should we also extend gapi_frame_tests.cpp and, if inference works, gapi_infer_ie_test.cpp also?

{
std::call_once(m_warnFlag,
[]() {
GAPI_LOG_WARNING(NULL, "\nOn-the-fly conversion from GRAY to NV12 Y plane will "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This warning is not applicable here, if to be honest..
This accessor tries to return Y cv::Mat from any given frame. For GRAY frames it is enough to just return their data as Y planes. There is no expected time-consuming conversions.
Warning was about situation when we trying to access, for example, Y plane from BGR cv::MediaFrame. So, the conversion needs to be happen inside from BGR to NV12 and, then, Y plane can only be retrieved. As BGR input frame might have high enough resolution, conversion might be time-consuming and that is why warning is created.
So, here it might be omitted

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd keep a message here that requested plane here doesn't not quite align with the initial format

@dbudniko
Copy link
Copy Markdown
Author

3 new streaming tests with gray are OK now.

@dbudniko
Copy link
Copy Markdown
Author

Media Frame added and green now. Please review. We still have open regarding correct color conversion approach in streaming tests. Discussed it with Asya. Need your inputs to left one. #if0 #else #endif temporary left in the tests source code.

@dmatveev dmatveev self-assigned this Jan 31, 2022
@dmatveev dmatveev added this to the 4.6.0 milestone Jan 31, 2022
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

Looks good overall

@dbudniko
Copy link
Copy Markdown
Author

dbudniko commented Feb 1, 2022

@alalek please merge.

Copy link
Copy Markdown
Contributor

@AsyaPronina AsyaPronina left a comment

Choose a reason for hiding this comment

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

I suggest to discuss IE backend GRAY support last time
Please sorry for incoveniences!

@dbudniko
Copy link
Copy Markdown
Author

dbudniko commented Feb 3, 2022

@alalek gentle reminder

@alalek alalek merged commit 4d0148b into opencv:4.x Feb 3, 2022
TolyaTalamanov pushed a commit to TolyaTalamanov/opencv that referenced this pull request Feb 18, 2022
@alalek alalek mentioned this pull request Feb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
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.

8 participants