optflow_gpu compilation under ubuntu

This commit is contained in:
Anatoly Baksheev 2011-10-03 10:14:59 +00:00
parent 336e000ecc
commit 78e678b1f8

@ -84,9 +84,9 @@ public:
}; };
template<class T> template<class T>
NCVStatus CopyData(IplImage *image, Ptr<NCVMatrixAlloc<Ncv32f>> &dst) NCVStatus CopyData(IplImage *image, Ptr<NCVMatrixAlloc<Ncv32f> >& dst)
{ {
dst = Ptr<NCVMatrixAlloc<Ncv32f>> (new NCVMatrixAlloc<Ncv32f> (*g_pHostMemAllocator, image->width, image->height)); dst = Ptr<NCVMatrixAlloc<Ncv32f> > (new NCVMatrixAlloc<Ncv32f> (*g_pHostMemAllocator, image->width, image->height));
ncvAssertReturn (dst->isMemAllocated (), NCV_ALLOCATOR_BAD_ALLOC); ncvAssertReturn (dst->isMemAllocated (), NCV_ALLOCATOR_BAD_ALLOC);
unsigned char *row = reinterpret_cast<unsigned char*> (image->imageData); unsigned char *row = reinterpret_cast<unsigned char*> (image->imageData);
@ -138,8 +138,8 @@ NCVStatus LoadImages (const char *frame0Name,
const char *frame1Name, const char *frame1Name,
int &width, int &width,
int &height, int &height,
Ptr<NCVMatrixAlloc<Ncv32f>> &src, Ptr<NCVMatrixAlloc<Ncv32f> > &src,
Ptr<NCVMatrixAlloc<Ncv32f>> &dst, Ptr<NCVMatrixAlloc<Ncv32f> > &dst,
IplImage *&firstFrame, IplImage *&firstFrame,
IplImage *&lastFrame) IplImage *&lastFrame)
{ {
@ -403,8 +403,8 @@ int main(int argc, char **argv)
int width, height; int width, height;
Ptr<NCVMatrixAlloc<Ncv32f>> src_host; Ptr<NCVMatrixAlloc<Ncv32f> > src_host;
Ptr<NCVMatrixAlloc<Ncv32f>> dst_host; Ptr<NCVMatrixAlloc<Ncv32f> > dst_host;
IplImage *firstFrame, *lastFrame; IplImage *firstFrame, *lastFrame;
if (frame0Name != 0 && frame1Name != 0) if (frame0Name != 0 && frame1Name != 0)
@ -416,10 +416,10 @@ int main(int argc, char **argv)
ncvAssertReturnNcvStat (LoadImages ("frame10.bmp", "frame11.bmp", width, height, src_host, dst_host, firstFrame, lastFrame)); ncvAssertReturnNcvStat (LoadImages ("frame10.bmp", "frame11.bmp", width, height, src_host, dst_host, firstFrame, lastFrame));
} }
Ptr<NCVMatrixAlloc<Ncv32f>> src (new NCVMatrixAlloc<Ncv32f> (*g_pGPUMemAllocator, src_host->width (), src_host->height ())); Ptr<NCVMatrixAlloc<Ncv32f> > src (new NCVMatrixAlloc<Ncv32f> (*g_pGPUMemAllocator, src_host->width (), src_host->height ()));
ncvAssertReturn(src->isMemAllocated(), -1); ncvAssertReturn(src->isMemAllocated(), -1);
Ptr<NCVMatrixAlloc<Ncv32f>> dst (new NCVMatrixAlloc<Ncv32f> (*g_pGPUMemAllocator, src_host->width (), src_host->height ())); Ptr<NCVMatrixAlloc<Ncv32f> > dst (new NCVMatrixAlloc<Ncv32f> (*g_pGPUMemAllocator, src_host->width (), src_host->height ()));
ncvAssertReturn (dst->isMemAllocated (), -1); ncvAssertReturn (dst->isMemAllocated (), -1);
ncvAssertReturnNcvStat (src_host->copySolid ( *src, 0 )); ncvAssertReturnNcvStat (src_host->copySolid ( *src, 0 ));