\****************************************************************************************/
#ifndef CV_CXX_STD_ARRAY
-# if __cplusplus >= 201103L
+# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/)
# define CV_CXX_STD_ARRAY 1
# include <array>
# endif
TEST(Core_Mat_array, SplitMerge)
{
std::array<cv::Mat, 3> src;
- for(size_t i=0; i<src.size(); ++i) {
- src[i].create(10, 10, CV_8U);
- src[i] = 127 * i;
+ for (size_t i = 0; i < src.size(); ++i)
+ {
+ src[i] = Mat(10, 10, CV_8U, Scalar((double)(16 * (i + 1))));
}
Mat merged;
std::array<cv::Mat, 3> dst;
split(merged, dst);
- Mat diff;
- for(size_t i=0; i<dst.size(); ++i) {
- absdiff(src[i], dst[i], diff);
- EXPECT_EQ(0, countNonZero(diff));
+ for (size_t i = 0; i < dst.size(); ++i)
+ {
+ EXPECT_EQ(0, cvtest::norm(src[i], dst[i], NORM_INF));
}
}
#endif