Skip to content

Commit af13f61

Browse files
Merge pull request opencv#19580 from SergeyKrivohatskiy:patch-1
* Fixed OCL implementation of pyrlk If prevPts size is (N, 1) (which is a default layout for converting `vector<Point2f>` to `UMat`) the `prevPts.cols == 1` and optical flow will be calculated for the first point only. Getting `prevPts.total()` as in line 1048 is the correct way to get points count. * fixed compilation warning (size_t to int) Signed-off-by: Sergey Krivohatskiy <s.krivohatskiy@gmail.com>
1 parent d093ac6 commit af13f61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/video/src/lkpyramid.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,8 @@ namespace
938938
{
939939
if (!lkSparse_run(prevPyr[level], nextPyr[level], prevPts,
940940
nextPts, status, err,
941-
prevPts.cols, level))
941+
static_cast<int>(prevPts.total()),
942+
level))
942943
return false;
943944
}
944945
return true;

0 commit comments

Comments
 (0)