Commit 863d61e9 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

fix gpu module compilation under linux

parent 4cdcf371
This diff is collapsed.
......@@ -48,15 +48,18 @@ void cv::gpu::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Gpu
#else /* !defined (HAVE_CUDA) */
#define NPP_VERSION (10 * NPP_VERSION_MAJOR + NPP_VERSION_MINOR)
void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTransp, GpuMat& top, GpuMat& bottom, GpuMat& labels, GpuMat& buf)
{
#if NPP_VERSION >= 32
CV_Assert(leftTransp.type() == CV_32S && rightTransp.type() == CV_32S);
CV_Assert(terminals.type() == CV_32S && bottom.type() == CV_32S && top.type() == CV_32S);
CV_Assert(terminals.size() == leftTransp.size());
CV_Assert(terminals.size() == rightTransp.size());
CV_Assert(terminals.size() == top.size() && terminals.size() == bottom.size());
CV_Assert(terminals.size() == top.size() && terminals.size() == bottom.size());
CV_Assert(top.step == bottom.step && top.step == terminals.step && rightTransp.step == leftTransp.step);
labels.create(terminals.size(), CV_8U);
NppiSize sznpp;
......@@ -69,8 +72,11 @@ void cv::gpu::graphcut(GpuMat& terminals, GpuMat& leftTransp, GpuMat& rightTrans
if ((size_t)bufsz > buf.cols * buf.rows * buf.elemSize())
buf.create(1, bufsz, CV_8U);
nppSafeCall( nppiGraphcut_32s8u(terminals.ptr<Npp32s>(), leftTransp.ptr<Npp32s>(), rightTransp.ptr<Npp32s>(), top.ptr<Npp32s>(), bottom.ptr<Npp32s>(),
nppSafeCall( nppiGraphcut_32s8u(terminals.ptr<Npp32s>(), leftTransp.ptr<Npp32s>(), rightTransp.ptr<Npp32s>(), top.ptr<Npp32s>(), bottom.ptr<Npp32s>(),
terminals.step, leftTransp.step, sznpp, labels.ptr<Npp8u>(), labels.step, buf.ptr<Npp8u>()) );
#else
CV_Assert(!"This function doesn't supported");
#endif
}
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment