mirror of
https://github.com/opencv/opencv.git
synced 2026-09-12 05:11:04 -05:00
Fix min with empty matrices.
Fixes https://github.com/opencv/opencv/issues/29739
This commit is contained in:
@@ -1953,8 +1953,7 @@ Mat _OutputArray::reinterpret(int mtype) const
|
||||
|
||||
void _OutputArray::createSameSize(const _InputArray& arr, int mtype) const
|
||||
{
|
||||
int arrsz[CV_MAX_DIM], d = arr.sizend(arrsz);
|
||||
create(d, arrsz, mtype);
|
||||
create(arr.shape(), mtype);
|
||||
}
|
||||
|
||||
void _OutputArray::fit(int d, const int* sizes, int mtype, int i,
|
||||
|
||||
@@ -370,9 +370,7 @@ void UMat::create(Size _sz, int _type, UMatUsageFlags _usageFlags)
|
||||
|
||||
void UMat::createSameSize(InputArray arr, int _type, UMatUsageFlags _usageFlags)
|
||||
{
|
||||
int arr_size[CV_MAX_DIM];
|
||||
int ndims = arr.sizend(arr_size);
|
||||
create(ndims, arr_size, _type, _usageFlags);
|
||||
create(arr.shape(), _type, _usageFlags);
|
||||
}
|
||||
|
||||
void UMat::addref()
|
||||
|
||||
@@ -4275,4 +4275,12 @@ TEST(Core_Arithm, DISABLED_mul_overflow_28557)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST(Core_Arithm, min_empty)
|
||||
{
|
||||
cv::Mat A, B, C;
|
||||
cv::max(A,B,C);
|
||||
EXPECT_TRUE(C.empty());
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user