MCPcopy Create free account
hub / github.com/creatale/node-dv / subtract

Method subtract

deps/opencv/modules/core/src/arithm.cpp:1564–1618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1562}
1563
1564void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst,
1565 InputArray mask, int dtype )
1566{
1567#ifdef HAVE_TEGRA_OPTIMIZATION
1568 int kind1 = _src1.kind(), kind2 = _src2.kind();
1569 Mat src1 = _src1.getMat(), src2 = _src2.getMat();
1570 bool src1Scalar = checkScalar(src1, _src2.type(), kind1, kind2);
1571 bool src2Scalar = checkScalar(src2, _src1.type(), kind2, kind1);
1572
1573 if (!src1Scalar && !src2Scalar &&
1574 src1.depth() == CV_8U && src2.type() == src1.type() &&
1575 src1.dims == 2 && src2.size() == src1.size() &&
1576 mask.empty())
1577 {
1578 if (dtype < 0)
1579 {
1580 if (_dst.fixedType())
1581 {
1582 dtype = _dst.depth();
1583 }
1584 else
1585 {
1586 dtype = src1.depth();
1587 }
1588 }
1589
1590 dtype = CV_MAT_DEPTH(dtype);
1591
1592 if (!_dst.fixedType() || dtype == _dst.depth())
1593 {
1594 _dst.create(src1.size(), CV_MAKE_TYPE(dtype, src1.channels()));
1595
1596 if (dtype == CV_16S)
1597 {
1598 Mat dst = _dst.getMat();
1599 if(tegra::subtract_8u8u16s(src1, src2, dst))
1600 return;
1601 }
1602 else if (dtype == CV_32F)
1603 {
1604 Mat dst = _dst.getMat();
1605 if(tegra::subtract_8u8u32f(src1, src2, dst))
1606 return;
1607 }
1608 else if (dtype == CV_8S)
1609 {
1610 Mat dst = _dst.getMat();
1611 if(tegra::subtract_8u8u8s(src1, src2, dst))
1612 return;
1613 }
1614 }
1615 }
1616#endif
1617 arithm_op(_src1, _src2, _dst, mask, dtype, getSubTab() );
1618}
1619
1620void cv::absdiff( InputArray src1, InputArray src2, OutputArray dst )
1621{

Callers

nothing calls this directly

Calls 12

checkScalarFunction · 0.85
arithm_opFunction · 0.85
getSubTabFunction · 0.85
kindMethod · 0.80
fixedTypeMethod · 0.80
getMatMethod · 0.45
typeMethod · 0.45
depthMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
createMethod · 0.45
channelsMethod · 0.45

Tested by

no test coverage detected