mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
Added planar flag to GMatDesc, intergated into framework, added tests
This commit is contained in:
@@ -99,8 +99,8 @@ void cv::gimpl::GExecutor::initResource(const ade::NodeHandle &orig_nh)
|
||||
case GShape::GMAT:
|
||||
{
|
||||
const auto desc = util::get<cv::GMatDesc>(d.meta);
|
||||
const auto type = CV_MAKETYPE(desc.depth, desc.chan);
|
||||
m_res.slot<cv::gapi::own::Mat>()[d.rc].create(desc.size, type);
|
||||
auto& mat = m_res.slot<cv::gapi::own::Mat>()[d.rc];
|
||||
createMat(desc, mat);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -152,21 +152,17 @@ void cv::gimpl::GExecutor::run(cv::gimpl::GRuntimeArgs &&args)
|
||||
{
|
||||
using cv::util::get;
|
||||
const auto desc = get<cv::GMatDesc>(d.meta);
|
||||
const auto type = CV_MAKETYPE(desc.depth, desc.chan);
|
||||
|
||||
#if !defined(GAPI_STANDALONE)
|
||||
// Building as part of OpenCV - follow OpenCV behavior
|
||||
// if output buffer is not enough to hold the result, reallocate it
|
||||
auto& out_mat = *get<cv::Mat*>(args.outObjs.at(index));
|
||||
out_mat.create(cv::gapi::own::to_ocv(desc.size), type);
|
||||
createMat(desc, out_mat);
|
||||
#else
|
||||
// Building standalone - output buffer should always exist,
|
||||
// and _exact_ match our inferred metadata
|
||||
auto& out_mat = *get<cv::gapi::own::Mat*>(args.outObjs.at(index));
|
||||
GAPI_Assert( out_mat.type() == type
|
||||
&& out_mat.data != nullptr
|
||||
&& out_mat.rows == desc.size.height
|
||||
&& out_mat.cols == desc.size.width)
|
||||
GAPI_Assert(out_mat.data != nullptr &&
|
||||
desc.canDescribe(out_mat))
|
||||
#endif // !defined(GAPI_STANDALONE)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user