@@ -1640,7 +1640,7 @@ INSTANTIATE_TEST_CASE_P(Core_CartToPolarToCart, ElemWiseTest, ::testing::Values(
1640
1640
1641
1641
// Mixed Type Arithmetic Operations
1642
1642
1643
- typedef std::tuple<ElemWiseOpPtr, std::tuple<cvtest::MatDepth, cvtest::MatDepth>> SomeType;
1643
+ typedef std::tuple<ElemWiseOpPtr, std::tuple<cvtest::MatDepth, cvtest::MatDepth>, int > SomeType;
1644
1644
class ArithmMixedTest : public ::testing::TestWithParam<SomeType> {};
1645
1645
1646
1646
TEST_P (ArithmMixedTest, accuracy)
@@ -1649,7 +1649,10 @@ TEST_P(ArithmMixedTest, accuracy)
1649
1649
ElemWiseOpPtr op = std::get<0 >(p);
1650
1650
int srcDepth = std::get<0 >(std::get<1 >(p));
1651
1651
int dstDepth = std::get<1 >(std::get<1 >(p));
1652
+ int channels = std::get<2 >(p);
1652
1653
1654
+ int srcType = CV_MAKETYPE (srcDepth, channels);
1655
+ int dstType = CV_MAKETYPE (dstDepth, channels);
1653
1656
op->flags |= BaseElemWiseOp::MIXED_TYPE;
1654
1657
int testIdx = 0 ;
1655
1658
RNG rng ((uint64)ARITHM_RNG_SEED);
@@ -1664,15 +1667,15 @@ TEST_P(ArithmMixedTest, accuracy)
1664
1667
int ninputs = op->ninputs ;
1665
1668
vector<Mat> src (ninputs);
1666
1669
for (int i = 0 ; i < ninputs; i++ )
1667
- src[i] = cvtest::randomMat (rng, size, srcDepth , minval, maxval, true );
1670
+ src[i] = cvtest::randomMat (rng, size, srcType , minval, maxval, true );
1668
1671
Mat dst0, dst, mask;
1669
1672
if ( haveMask )
1670
1673
{
1671
1674
mask = cvtest::randomMat (rng, size, CV_8UC1, 0 , 2 , true );
1672
1675
}
1673
1676
1674
- dst0 = cvtest::randomMat (rng, size, dstDepth , minval, maxval, false );
1675
- dst = cvtest::randomMat (rng, size, dstDepth , minval, maxval, true );
1677
+ dst0 = cvtest::randomMat (rng, size, dstType , minval, maxval, false );
1678
+ dst = cvtest::randomMat (rng, size, dstType , minval, maxval, true );
1676
1679
cvtest::copy (dst, dst0);
1677
1680
1678
1681
op->generateScalars (dstDepth, rng);
@@ -1692,53 +1695,62 @@ INSTANTIATE_TEST_CASE_P(Core_AddMixed, ArithmMixedTest,
1692
1695
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1693
1696
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1694
1697
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1695
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1698
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1699
+ ::testing::Values(1 , 3 , 4 )));
1696
1700
INSTANTIATE_TEST_CASE_P (Core_AddScalarMixed, ArithmMixedTest,
1697
1701
::testing::Combine (::testing::Values(ElemWiseOpPtr(new AddSOp)),
1698
1702
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1699
1703
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1700
1704
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1701
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1705
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1706
+ ::testing::Values(1 , 3 , 4 )));
1702
1707
INSTANTIATE_TEST_CASE_P (Core_AddWeightedMixed, ArithmMixedTest,
1703
1708
::testing::Combine (::testing::Values(ElemWiseOpPtr(new AddWeightedOp)),
1704
1709
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1705
1710
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1706
1711
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1707
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1712
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1713
+ ::testing::Values(1 , 3 , 4 )));
1708
1714
INSTANTIATE_TEST_CASE_P (Core_SubMixed, ArithmMixedTest,
1709
1715
::testing::Combine (::testing::Values(ElemWiseOpPtr(new SubOp)),
1710
1716
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1711
1717
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1712
1718
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1713
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1719
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1720
+ ::testing::Values(1 , 3 , 4 )));
1714
1721
INSTANTIATE_TEST_CASE_P (Core_SubScalarMinusArgMixed, ArithmMixedTest,
1715
1722
::testing::Combine (::testing::Values(ElemWiseOpPtr(new SubRSOp)),
1716
1723
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1717
1724
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1718
1725
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1719
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1726
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1727
+ ::testing::Values(1 , 3 , 4 )));
1720
1728
INSTANTIATE_TEST_CASE_P (Core_MulMixed, ArithmMixedTest,
1721
1729
::testing::Combine (::testing::Values(ElemWiseOpPtr(new MulOp)),
1722
1730
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1723
1731
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1724
1732
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1725
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1733
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1734
+ ::testing::Values(1 , 3 , 4 )));
1726
1735
INSTANTIATE_TEST_CASE_P (Core_MulScalarMixed, ArithmMixedTest,
1727
1736
::testing::Combine (::testing::Values(ElemWiseOpPtr(new MulSOp)),
1728
1737
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1729
1738
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1730
1739
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1731
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1740
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1741
+ ::testing::Values(1 , 3 , 4 )));
1732
1742
INSTANTIATE_TEST_CASE_P (Core_DivMixed, ArithmMixedTest,
1733
1743
::testing::Combine (::testing::Values(ElemWiseOpPtr(new DivOp)),
1734
1744
::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1735
1745
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_16S},
1736
1746
std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1737
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1747
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1748
+ ::testing::Values(1 , 3 , 4 )));
1738
1749
INSTANTIATE_TEST_CASE_P (Core_RecipMixed, ArithmMixedTest,
1739
1750
::testing::Combine (::testing::Values(ElemWiseOpPtr(new RecipOp)),
1740
- ::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_32F},
1741
- std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F})));
1751
+ ::testing::Values(std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8U, CV_16U},
1752
+ std::tuple<cvtest::MatDepth, cvtest::MatDepth>{CV_8S, CV_32F}),
1753
+ ::testing::Values(1 , 3 , 4 )));
1742
1754
1743
1755
TEST (Core_ArithmMask, uninitialized)
1744
1756
{
0 commit comments