@@ -79,6 +79,36 @@ TEST_P(ArithmOpTest, accuracy)
79
79
EXPECT_EQ (normL2, 0 );
80
80
}
81
81
82
+ typedef testing::TestWithParam<tuple<Size>> IntegrateYUVTest;
83
+
84
+ TEST_P (IntegrateYUVTest, accuracy)
85
+ {
86
+ auto p = GetParam ();
87
+ Size srcSize = std::get<0 >(p);
88
+ int depth = CV_8U;
89
+
90
+ cv::Mat Y (srcSize, depth), CbCr (srcSize.height /2 , srcSize.width , depth);
91
+ cv::Mat IY, ICb, ICr;
92
+ RNG& rng = cv::theRNG ();
93
+ cvtest::randUni (rng, Y, Scalar::all (0 ), Scalar::all (255 ));
94
+ cvtest::randUni (rng, CbCr, Scalar::all (0 ), Scalar::all (255 ));
95
+
96
+ cv::fastcv::integrateYUV (Y, CbCr, IY, ICb, ICr);
97
+
98
+ CbCr = CbCr.reshape (2 ,0 );
99
+ std::vector<cv::Mat> ref;
100
+ cv::fastcv::split (CbCr, ref);
101
+
102
+ cv::Mat IY_ref, ICb_ref, ICr_ref;
103
+ cv::integral (Y,IY_ref,CV_32S);
104
+ cv::integral (ref[0 ],ICb_ref,CV_32S);
105
+ cv::integral (ref[1 ],ICr_ref,CV_32S);
106
+
107
+ EXPECT_EQ (IY_ref.at <int >(IY_ref.rows - 1 , IY_ref.cols - 1 ), IY.at <int >(IY.rows - 1 , IY.cols - 1 ));
108
+ EXPECT_EQ (ICb_ref.at <int >(ICb_ref.rows - 1 , ICb_ref.cols - 1 ), ICb.at <int >(ICb.rows - 1 , ICb.cols - 1 ));
109
+ EXPECT_EQ (ICr_ref.at <int >(ICr_ref.rows - 1 , ICr_ref.cols - 1 ), ICr.at <int >(ICr.rows - 1 , ICr.cols - 1 ));
110
+ }
111
+
82
112
INSTANTIATE_TEST_CASE_P (FastCV_Extension, MatMulTest,
83
113
::testing::Combine (::testing::Values(8 , 16 , 128 , 256 ), // rows1
84
114
::testing::Values(8 , 16 , 128 , 256 ), // cols1
@@ -89,4 +119,7 @@ INSTANTIATE_TEST_CASE_P(FastCV_Extension, ArithmOpTest,
89
119
::testing::Values(CV_8U, CV_16S), // depth
90
120
::testing::Values(0 ,1 ))); // op type
91
121
122
+ INSTANTIATE_TEST_CASE_P (FastCV_Extension, IntegrateYUVTest,
123
+ Values (perf::szVGA, perf::sz720p, perf::sz1080p)); // sz
124
+
92
125
}} // namespaces opencv_test, ::
0 commit comments