本文整理汇总了C++中GpuMat_类的典型用法代码示例。如果您正苦于以下问题:C++ GpuMat_类的具体用法?C++ GpuMat_怎么用?C++ GpuMat_使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GpuMat_类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gridFindMaxVal_
__host__ void gridFindMaxVal_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
dst.create(1, 1);
dst.setTo(Scalar::all(-std::numeric_limits<ResType>::max()), stream);
const int rows = getRows(src);
const int cols = getCols(src);
grid_reduce_detail::maxVal<Policy>(shrinkPtr(src),
dst[0],
WithOutMask(),
rows, cols,
StreamAccessor::getStream(stream));
}
示例2: gridFindMinVal_
__host__ void gridFindMinVal_(const SrcPtr& src, GpuMat_<ResType>& dst, const MaskPtr& mask, Stream& stream = Stream::Null())
{
dst.create(1, 1);
dst.setTo(Scalar::all(std::numeric_limits<ResType>::max()), stream);
const int rows = getRows(src);
const int cols = getCols(src);
CV_Assert( getRows(mask) == rows && getCols(mask) == cols );
grid_reduce_detail::minVal<Policy>(shrinkPtr(src),
dst[0],
shrinkPtr(mask),
rows, cols,
StreamAccessor::getStream(stream));
}
示例3: gridHistogram_
__host__ void gridHistogram_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
CV_Assert( deviceSupports(SHARED_ATOMICS) );
const int rows = getRows(src);
const int cols = getCols(src);
dst.create(1, BIN_COUNT);
dst.setTo(0, stream);
grid_histogram_detail::histogram<BIN_COUNT, Policy>(shrinkPtr(src),
dst[0],
WithOutMask(),
rows, cols,
StreamAccessor::getStream(stream));
}
示例4: gridMinMaxLoc_
__host__ void gridMinMaxLoc_(const SrcPtr& src, GpuMat_<ResType>& valBuf, GpuMat_<int>& locBuf, Stream& stream = Stream::Null())
{
const int rows = getRows(src);
const int cols = getCols(src);
dim3 grid, block;
grid_minmaxloc_detail::getLaunchCfg<Policy>(rows, cols, block, grid);
valBuf.create(2, grid.x * grid.y);
locBuf.create(2, grid.x * grid.y);
grid_minmaxloc_detail::minMaxLoc<Policy>(shrinkPtr(src),
valBuf[0], valBuf[1], locBuf[0], locBuf[1],
WithOutMask(),
rows, cols,
StreamAccessor::getStream(stream));
}
示例5: gridCalcSum_
__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));
}
示例6: gridCountNonZero_
__host__ void gridCountNonZero_(const SrcPtr& src, GpuMat_<ResType>& dst, Stream& stream = Stream::Null())
{
dst.create(1, 1);
dst.setTo(0, stream);
const int rows = getRows(src);
const int cols = getCols(src);
typedef typename PtrTraits<SrcPtr>::value_type src_type;
not_equal_to<src_type> ne_op;
const src_type zero = VecTraits<src_type>::all(0);
grid_reduce_detail::sum<Policy>(shrinkPtr(transformPtr(src, bind2nd(ne_op, zero))),
dst[0],
WithOutMask(),
rows, cols,
StreamAccessor::getStream(stream));
}
示例7: gridTransform_
__host__ void gridTransform_(const SrcPtr& src, GpuMat_<DstType>& dst, const UnOp& op, Stream& stream = Stream::Null())
{
const int rows = getRows(src);
const int cols = getCols(src);
dst.create(rows, cols);
grid_transform_detail::transform<Policy>(shrinkPtr(src), shrinkPtr(dst), op, WithOutMask(), rows, cols, StreamAccessor::getStream(stream));
}
示例8: gridPyrUp
__host__ void gridPyrUp(const SrcPtr& src, GpuMat_<DstType>& dst, Stream& stream = Stream::Null())
{
const int rows = getRows(src);
const int cols = getCols(src);
dst.create(rows * 2, cols * 2);
pyramids_detail::pyrUp(shrinkPtr(src), shrinkPtr(dst), rows, cols, dst.rows, dst.cols, StreamAccessor::getStream(stream));
}