Skip to content

G-API: A quick value-initialization support GMat#25055

Merged
asmorkalov merged 3 commits intoopencv:4.xfrom
dmatveev:dm/value_initialized_gmat
Mar 6, 2024
Merged

G-API: A quick value-initialization support GMat#25055
asmorkalov merged 3 commits intoopencv:4.xfrom
dmatveev:dm/value_initialized_gmat

Conversation

@dmatveev
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev commented Feb 21, 2024

This PR enables GMat objects to be value-initialized in the same way as it was done for GScalars (and, possibly, other types).

  • Added some helper methods in backends to distinguish if a certain G-type value initialization is supported or not;
  • Added tests, including negative.

Where it is needed:

In the current form, PR can be reviewed & merged (@TolyaTalamanov please have a look)

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

@asmorkalov asmorkalov changed the title G-API: A quick (but not very dirty) value-initialization support for … G-API: A quick (but not very dirty) value-initialization support GMat Feb 21, 2024
dmatveev added 2 commits March 3, 2024 23:03
- Added more tests;
- Added a negative test on GComputation with no inputs.
  Currently explicitly marked as throwing exception (tuned code not
  to crash in this case). Supporting running graphs like this will
  be added in a separate PR (a differnt feature)
@dmatveev dmatveev self-assigned this Mar 5, 2024
@dmatveev dmatveev added this to the 4.10.0 milestone Mar 5, 2024
@dmatveev dmatveev marked this pull request as ready for review March 5, 2024 03:19
@dmatveev dmatveev changed the title G-API: A quick (but not very dirty) value-initialization support GMat G-API: A quick value-initialization support GMat Mar 5, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor

@TolyaTalamanov Friendly remider.

Copy link
Copy Markdown
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

*
* @param m a cv::Mat buffer to associate with this GMat object.
*/
GAPI_WRAP explicit GMat(cv::Mat m); // Value-initialization constructor
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.

Wondering if it's really working from python, do you plan to add any test to check that, or it will be done later on?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe it should work in the same way as for GScalar(cv::Scalar), isn't it?

@asmorkalov asmorkalov assigned TolyaTalamanov and unassigned dmatveev Mar 6, 2024
@asmorkalov asmorkalov merged commit f174363 into opencv:4.x Mar 6, 2024
@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Mar 6, 2024

Wow, thanks!

@asmorkalov asmorkalov mentioned this pull request Apr 1, 2024
klatism pushed a commit to klatism/opencv that referenced this pull request May 17, 2024
G-API: A quick value-initialization support GMat opencv#25055

This PR enables `GMat` objects to be value-initialized in the same way as it was done for `GScalar`s (and, possibly, other types).

- Added some helper methods in backends to distinguish if a certain G-type value initialization is supported or not;
- Added tests, including negative.

Where it is needed:

- Further extension of the OVCV backend (opencv#24379 - will be refreshed soon);
- Further experiments with DNN module;
- Further experiments with "G-API behind UMat" sort of aggregation.

In the current form, PR can be reviewed & merged (@TolyaTalamanov please have a look)

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] 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
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
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.

4 participants