示例#1
0
__host__ void gridTransform_(const SrcPtr& src, const tuple< GpuMat_<D0>&, GpuMat_<D1>& >& dst, const OpTuple& op, Stream& stream = Stream::Null())
{
    CV_StaticAssert( tuple_size<OpTuple>::value == 2, "" );

    const int rows = getRows(src);
    const int cols = getCols(src);

    get<0>(dst).create(rows, cols);
    get<1>(dst).create(rows, cols);

    grid_transform_detail::transform_tuple<Policy>(shrinkPtr(src),
                                                   shrinkPtr(zipPtr(get<0>(dst), get<1>(dst))),
                                                   op,
                                                   WithOutMask(),
                                                   rows, cols,
                                                   StreamAccessor::getStream(stream));
}
示例#2
0
文件: reduce.hpp 项目: 112000/opencv
__host__ void gridCalcSum_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
    typedef typename PtrTraits<SrcPtr>::value_type src_type;

    CV_StaticAssert( unsigned(VecTraits<src_type>::cn) == unsigned(VecTraits<ResType>::cn), "" );

    dst.create(1, 1);
    dst.setTo(0, stream);

    const int rows = getRows(src);
    const int cols = getCols(src);

    grid_reduce_detail::sum<Policy>(shrinkPtr(src),
                                    dst[0],
                                    WithOutMask(),
                                    rows, cols,
                                    StreamAccessor::getStream(stream));
}