Skip to content

Commit bbe0f2c

Browse files
committed
refactoring
1 parent c2a880d commit bbe0f2c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

samples/gpu/pyrlk_optical_flow.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,6 @@ int main(int argc, const char* argv[])
268268
return -1;
269269
}
270270

271-
if(is_sparse)
272-
{
273-
namedWindow("PyrLK [Sparse]", WINDOW_NORMAL);
274-
}
275-
else
276-
{
277-
namedWindow("PyrLK [Dense] Flow Field", WINDOW_NORMAL);
278-
}
279-
280271
cout << "Image size : " << frame0.cols << " x " << frame0.rows << endl;
281272
cout << "Points count : " << points << endl;
282273

@@ -318,6 +309,7 @@ int main(int argc, const char* argv[])
318309
vector<uchar> status(d_status.cols);
319310
download(d_status, status);
320311

312+
namedWindow("PyrLK [Sparse]", WINDOW_NORMAL);
321313
drawArrows(frame0, prevPts, nextPts, status, Scalar(255, 0, 0));
322314
imshow("PyrLK [Sparse]", frame0);
323315
}
@@ -329,6 +321,7 @@ int main(int argc, const char* argv[])
329321
d_pyrLK_dense->calc(d_frame0Gray, d_frame1Gray, d_flow);
330322

331323
// Draw flows
324+
namedWindow("PyrLK [Dense] Flow Field", WINDOW_NORMAL);
332325
showFlow("PyrLK [Dense] Flow Field", d_flow);
333326
}
334327

0 commit comments

Comments
 (0)