fix cv::subtract function:

call dst.create(...) before using it
This commit is contained in:
Vladislav Vinogradov
2014-05-07 13:15:19 +04:00
parent 5042ab1f32
commit 4c66614e07
2 changed files with 15 additions and 1 deletions

View File

@@ -1579,3 +1579,13 @@ TEST_P(Mul1, One)
}
INSTANTIATE_TEST_CASE_P(Arithm, Mul1, testing::Values(Size(2, 2), Size(1, 1)));
TEST(Subtract8u8u16s, EmptyOutputMat)
{
cv::Mat src1 = cv::Mat::zeros(16, 16, CV_8UC1);
cv::Mat src2 = cv::Mat::zeros(16, 16, CV_8UC1);
cv::Mat dst;
cv::subtract(src1, src2, dst, cv::noArray(), CV_16S);
ASSERT_FALSE(dst.empty());
ASSERT_EQ(0, cv::countNonZero(dst));
}