当前位置: 首页>>代码示例>>C++>>正文


C++ GpuMat_类代码示例

本文整理汇总了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));
}
开发者ID:112000,项目名称:opencv,代码行数:14,代码来源:reduce.hpp

示例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));
}
开发者ID:112000,项目名称:opencv,代码行数:16,代码来源:reduce.hpp

示例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));
}
开发者ID:0kazuya,项目名称:opencv,代码行数:16,代码来源:histogram.hpp

示例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));
}
开发者ID:112000,项目名称:opencv,代码行数:17,代码来源:reduce.hpp

示例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));
}
开发者ID:112000,项目名称:opencv,代码行数:18,代码来源:reduce.hpp

示例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));
}
开发者ID:112000,项目名称:opencv,代码行数:18,代码来源:reduce.hpp

示例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));
}
开发者ID:406089450,项目名称:opencv,代码行数:9,代码来源:transform.hpp

示例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));
}
开发者ID:007Indian,项目名称:opencv,代码行数:9,代码来源:pyramids.hpp


注:本文中的GpuMat_类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。