Added the GPU version of the Farneback's optical flow

This commit is contained in:
Alexey Spizhevoy
2012-02-16 11:23:51 +00:00
parent 59ff1a4ccb
commit 5c459aa815
9 changed files with 196 additions and 13 deletions

View File

@@ -214,6 +214,8 @@ namespace cv { namespace gpu
CV_EXPORTS void ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m);
CV_EXPORTS void ensureSizeIsEnough(Size size, int type, GpuMat& m);
CV_EXPORTS GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat &mat);
////////////////////////////////////////////////////////////////////////
// Error handling
@@ -459,6 +461,13 @@ namespace cv { namespace gpu
else
m.create(rows, cols, type);
}
inline GpuMat allocMatFromBuf(int rows, int cols, int type, GpuMat &mat)
{
if (!mat.empty() && mat.type() == type && mat.rows >= rows && mat.cols >= cols)
return mat(Rect(0, 0, cols, rows));
return mat = GpuMat(rows, cols, type);
}
}}
#endif // __cplusplus