Merge pull request #18391 from dmatveev:dm/gframe_00_new_type
* G-API: Make GFrame a new (distinct) G-type, not an alias to GMat - The underlying host type is still cv::Mat, a new cv::MediaFrame type is to be added as a separate PR * Fix warnings and review comments - Somewhow there was a switch() without a default: clause in Fluid
This commit is contained in:
@@ -17,15 +17,13 @@ G_API_OP(GBlurFrame, <GMat(GFrame)>, "test.blur_frame") {
|
||||
}
|
||||
};
|
||||
|
||||
GAPI_OCV_KERNEL(OCVBlurFrame, GBlurFrame)
|
||||
{
|
||||
GAPI_OCV_KERNEL(OCVBlurFrame, GBlurFrame) {
|
||||
static void run(const cv::Mat& in, cv::Mat& out) {
|
||||
cv::blur(in, out, cv::Size{3,3});
|
||||
}
|
||||
};
|
||||
|
||||
struct GFrameTest : public ::testing::Test
|
||||
{
|
||||
struct GFrameTest : public ::testing::Test {
|
||||
cv::Size sz{32,32};
|
||||
cv::Mat in_mat;
|
||||
cv::Mat out_mat;
|
||||
@@ -34,20 +32,17 @@ struct GFrameTest : public ::testing::Test
|
||||
GFrameTest()
|
||||
: in_mat(cv::Mat(sz, CV_8UC1))
|
||||
, out_mat(cv::Mat::zeros(sz, CV_8UC1))
|
||||
, out_mat_ocv(cv::Mat::zeros(sz, CV_8UC1))
|
||||
{
|
||||
, out_mat_ocv(cv::Mat::zeros(sz, CV_8UC1)) {
|
||||
cv::randn(in_mat, cv::Scalar::all(127.0f), cv::Scalar::all(40.f));
|
||||
cv::blur(in_mat, out_mat_ocv, cv::Size{3,3});
|
||||
}
|
||||
|
||||
void check()
|
||||
{
|
||||
void check() {
|
||||
EXPECT_EQ(0, cvtest::norm(out_mat, out_mat_ocv, NORM_INF));
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(GFrameTest, Input)
|
||||
{
|
||||
TEST_F(GFrameTest, Input) {
|
||||
cv::GFrame in;
|
||||
auto out = GBlurFrame::on(in);
|
||||
cv::GComputation c(cv::GIn(in), cv::GOut(out));
|
||||
|
||||
Reference in New Issue
Block a user