1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #19495 from dbudniko:gapi_media_frame_size

Add Media Frame size function and corresponding tests

* add media frame size and tests

* Address comments from Ruslan and Asya
This commit is contained in:
Dmitry Budnikov
2021-02-10 22:23:54 +03:00
committed by GitHub
parent c527b3cefd
commit 1162cef978
6 changed files with 71 additions and 1 deletions
+5
View File
@@ -427,5 +427,10 @@ GOpaque<Size> streaming::size(const GOpaque<Rect>& r)
return streaming::GSizeR::on(r);
}
GOpaque<Size> streaming::size(const GFrame& src)
{
return streaming::GSizeMF::on(src);
}
} //namespace gapi
} //namespace cv
+10 -1
View File
@@ -692,6 +692,14 @@ GAPI_OCV_KERNEL(GCPUSizeR, cv::gapi::streaming::GSizeR)
}
};
GAPI_OCV_KERNEL(GCPUSizeMF, cv::gapi::streaming::GSizeMF)
{
static void run(const cv::MediaFrame& in, cv::Size& out)
{
out = in.desc().size;
}
};
cv::gapi::GKernelPackage cv::gapi::core::cpu::kernels()
{
static auto pkg = cv::gapi::kernels
@@ -771,6 +779,7 @@ cv::gapi::GKernelPackage cv::gapi::core::cpu::kernels()
, GCPUParseYolo
, GCPUSize
, GCPUSizeR
>();
, GCPUSizeMF
>();
return pkg;
}