Stream sources are traited as GMats in the G-API's internal type system #2
dmatveev
started this conversation in
Architecture
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As mentioned in opencv/opencv#24178 (namely, gtype_traits.hpp#L147),
g_type_of_t<IStreamSource::Ptr>
resolves toGMat
, however the source itself may produce data of any G-API kind (GMat / GFrame / GScalar / GAarray / etc).As shown in the same PR, creating a Queue Stream source producing a Scalar still works and works correctly, but internally we have such an inconsistency.
g_type_of_t<>
is used to identify the right host data type wrapper helper:cv::gin()
which accepts data of any kind;GRunArg
form (which is a variant over a set of predefined types);Mat
andScalar
may be wrapped as-is, but some (normally - a customizable template ones) require special handling to strip type and wrap value into a container likeVectorRef
orOpaqueRef
(and store some type information in that container).When an instance of
IStreamSource::Ptr
is passed tocv::gin()
, treating it ascv::GMat
in this particular case meanswrapping it using a default helper
, no actualGMat
-specific handling is done. Anyway, it may be confusing to resolveg_type_of_t<>
toGMat
in this case and this disambiguation needs to be resolved.Beta Was this translation helpful? Give feedback.
All reactions