mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Add new Mat constructor (#10808)
* Add new Mat constructor * Fix build error * Fix build error * Fixed the code about 4 comments * Fixed three comments * delete previous local declaration * fix build error
This commit is contained in:
committed by
Vadim Pisarevsky
parent
ab0f0f26a1
commit
379ea15d16
@@ -1719,17 +1719,23 @@ TEST(Mat, from_initializer_list)
|
||||
{
|
||||
Mat A({1.f, 2.f, 3.f});
|
||||
Mat_<float> B(3, 1); B << 1, 2, 3;
|
||||
Mat_<float> C({3}, {1,2,3});
|
||||
|
||||
ASSERT_EQ(A.type(), CV_32F);
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(A, B, NORM_INF), 0.);
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(A, C, NORM_INF), 0.);
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(B, C, NORM_INF), 0.);
|
||||
}
|
||||
|
||||
TEST(Mat_, from_initializer_list)
|
||||
{
|
||||
Mat_<float> A = {1, 2, 3};
|
||||
Mat_<float> B(3, 1); B << 1, 2, 3;
|
||||
Mat_<float> C({3}, {1,2,3});
|
||||
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(A, B, NORM_INF), 0.);
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(A, C, NORM_INF), 0.);
|
||||
ASSERT_DOUBLE_EQ(cvtest::norm(B, C, NORM_INF), 0.);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user