fix gpu module compilation under linux

This commit is contained in:
Vladislav Vinogradov
2010-11-08 09:55:10 +00:00
parent 4cdcf37139
commit 863d61e9eb
4 changed files with 425 additions and 252 deletions

View File

@@ -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
}