fix gpu samples compilation

This commit is contained in:
Vladislav Vinogradov
2014-12-31 15:37:09 +03:00
parent 62f8240b00
commit b3a743f09a
3 changed files with 35 additions and 69 deletions

View File

@@ -186,12 +186,8 @@ int main(int argc, const char* argv[])
// Sparse
PyrLKOpticalFlow d_pyrLK;
d_pyrLK.winSize.width = winSize;
d_pyrLK.winSize.height = winSize;
d_pyrLK.maxLevel = maxLevel;
d_pyrLK.iters = iters;
Ptr<cuda::SparsePyrLKOpticalFlow> d_pyrLK = cuda::SparsePyrLKOpticalFlow::create(
Size(winSize, winSize), maxLevel, iters);
GpuMat d_frame0(frame0);
GpuMat d_frame1(frame1);
@@ -199,7 +195,7 @@ int main(int argc, const char* argv[])
GpuMat d_nextPts;
GpuMat d_status;
d_pyrLK.sparse(useGray ? d_frame0Gray : d_frame0, useGray ? d_frame1Gray : d_frame1, d_prevPts, d_nextPts, d_status);
d_pyrLK->calc(useGray ? d_frame0Gray : d_frame0, useGray ? d_frame1Gray : d_frame1, d_prevPts, d_nextPts, d_status);
// Draw arrows
@@ -216,20 +212,6 @@ int main(int argc, const char* argv[])
imshow("PyrLK [Sparse]", frame0);
// Dense
GpuMat d_u;
GpuMat d_v;
d_pyrLK.dense(d_frame0Gray, d_frame1Gray, d_u, d_v);
// Draw flow field
Mat flowField;
getFlowField(Mat(d_u), Mat(d_v), flowField);
imshow("PyrLK [Dense] Flow Field", flowField);
waitKey();
return 0;