1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #21103 from OrestChura:oc/fix_1D_Mat_RMat_View_issue

[G-API] Fix issue of getting 1D Mat out of RMat::View

* Fix issue of getting 1D Mat out of RMat::View
 - added test
 - fixed for standalone too (removed Assert(dims.empty()))

* Fixed asVeiw() function for standalone

* Put more detailed comment
This commit is contained in:
Orest Chura
2021-11-26 19:42:12 +03:00
committed by GitHub
parent 2deb38d615
commit e20fe421e7
2 changed files with 24 additions and 3 deletions
@@ -268,4 +268,13 @@ TEST_F(RMatViewCallbackTest, MagazineInteraction) {
mag.slot<View>().erase(rc);
EXPECT_EQ(1, callbackCalls);
}
TEST(RMatView, Access1DMat) {
cv::Mat m({1}, CV_32FC1);
m.dims = 1;
auto rmat = cv::make_rmat<cv::gimpl::RMatOnMat>(m);
auto view = rmat.access(cv::RMat::Access::R);
auto out = cv::gimpl::asMat(view);
EXPECT_EQ(1, out.dims);
}
} // namespace opencv_test