mirror of
https://github.com/opencv/opencv.git
synced 2025-07-25 14:47:07 +08:00
Merge pull request #27322 from vrabaud:zeros
Add missing Mat_<_Tp>::zeros(int _ndims, const int* _sizes)
This commit is contained in:
commit
f3cffcd85d
@ -3024,6 +3024,12 @@ Mat_<_Tp>& Mat_<_Tp>::operator = (const MatExpr& e)
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
MatExpr Mat_<_Tp>::zeros(int _ndims, const int* _sizes)
|
||||
{
|
||||
return Mat::zeros(_ndims, _sizes, traits::Type<_Tp>::value);
|
||||
}
|
||||
|
||||
template<typename _Tp> inline
|
||||
MatExpr Mat_<_Tp>::zeros(int rows, int cols)
|
||||
{
|
||||
|
@ -1418,6 +1418,13 @@ TEST(Core_Mat, copyMakeBoderUndefinedBehavior)
|
||||
EXPECT_EQ(0, cv::norm(src.col(2), dst(Rect(5,1,1,4))));
|
||||
}
|
||||
|
||||
TEST(Core_Mat, zeros)
|
||||
{
|
||||
// Should not fail during linkage.
|
||||
const int dims[] = {2, 2, 4};
|
||||
cv::Mat1f mat = cv::Mat1f::zeros(3, dims);
|
||||
}
|
||||
|
||||
TEST(Core_Matx, fromMat_)
|
||||
{
|
||||
Mat_<double> a = (Mat_<double>(2,2) << 10, 11, 12, 13);
|
||||
|
Loading…
Reference in New Issue
Block a user