__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)); }
__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)); }
__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)); }
__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)); }
__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)); }
__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)); }
__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)); }
__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)); }
__host__ void gridTransform_(const SrcPtr1& src1, const SrcPtr2& src2, GpuMat_<DstType>& dst, const BinOp& op, const MaskPtr& mask, Stream& stream = Stream::Null()) { const int rows = getRows(src1); const int cols = getCols(src1); CV_Assert( getRows(src2) == rows && getCols(src2) == cols ); CV_Assert( getRows(mask) == rows && getCols(mask) == cols ); dst.create(rows, cols); grid_transform_detail::transform<Policy>(shrinkPtr(src1), shrinkPtr(src2), shrinkPtr(dst), op, shrinkPtr(mask), rows, cols, StreamAccessor::getStream(stream)); }