mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Merge pull request #16656 from alalek:issue_16655
This commit is contained in:
commit
f48c84eaee
@ -1257,7 +1257,7 @@ int MatExpr::type() const
|
|||||||
if( isInitializer(*this) )
|
if( isInitializer(*this) )
|
||||||
return a.type();
|
return a.type();
|
||||||
if( isCmp(*this) )
|
if( isCmp(*this) )
|
||||||
return CV_8U;
|
return CV_MAKETYPE(CV_8U, a.channels());
|
||||||
return op ? op->type(*this) : -1;
|
return op ? op->type(*this) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2017,6 +2017,17 @@ TEST(Core_MatExpr, issue_13926)
|
|||||||
EXPECT_GE(1e-6, cvtest::norm(M2*M1, M2*M2, NORM_INF)) << Mat(M2*M1) << std::endl << Mat(M2*M2);
|
EXPECT_GE(1e-6, cvtest::norm(M2*M1, M2*M2, NORM_INF)) << Mat(M2*M1) << std::endl << Mat(M2*M2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Core_MatExpr, issue_16655)
|
||||||
|
{
|
||||||
|
Mat a(Size(5, 5), CV_32FC3, Scalar::all(1));
|
||||||
|
Mat b(Size(5, 5), CV_32FC3, Scalar::all(2));
|
||||||
|
MatExpr ab_expr = a != b;
|
||||||
|
Mat ab_mat = ab_expr;
|
||||||
|
EXPECT_EQ(CV_8UC3, ab_expr.type())
|
||||||
|
<< "MatExpr: CV_8UC3 != " << typeToString(ab_expr.type());
|
||||||
|
EXPECT_EQ(CV_8UC3, ab_mat.type())
|
||||||
|
<< "Mat: CV_8UC3 != " << typeToString(ab_mat.type());
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_EIGEN
|
#ifdef HAVE_EIGEN
|
||||||
TEST(Core_Eigen, eigen2cv_check_Mat_type)
|
TEST(Core_Eigen, eigen2cv_check_Mat_type)
|
||||||
|
@ -56,7 +56,10 @@ TEST(imagesFromBlob, Regression)
|
|||||||
|
|
||||||
for (int i = 0; i < nbOfImages; i++)
|
for (int i = 0; i < nbOfImages; i++)
|
||||||
{
|
{
|
||||||
ASSERT_EQ(cv::countNonZero(inputImgs[i] != outputImgs[i]), 0);
|
EXPECT_EQ(0, cvtest::norm(inputImgs[i], outputImgs[i], NORM_INF))
|
||||||
|
<< "i=" << i
|
||||||
|
<< " inputImgs[i]=" << inputImgs[i].size
|
||||||
|
<< " outputImgs[i]=" << outputImgs[i].size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user