From: Sergey Krivohatskiy Date: Sun, 21 Feb 2021 15:57:18 +0000 (+0300) Subject: Merge pull request #19580 from SergeyKrivohatskiy:patch-1 X-Git-Tag: submit/tizen/20220120.021815~1^2~1^2~150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af13f61a4353ede667f5907274511f58d8c536ad;p=platform%2Fupstream%2Fopencv.git Merge pull request #19580 from SergeyKrivohatskiy:patch-1 * Fixed OCL implementation of pyrlk If prevPts size is (N, 1) (which is a default layout for converting `vector` 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 --- diff --git a/modules/video/src/lkpyramid.cpp b/modules/video/src/lkpyramid.cpp index 8df531448a..657b3ced4b 100644 --- a/modules/video/src/lkpyramid.cpp +++ b/modules/video/src/lkpyramid.cpp @@ -938,7 +938,8 @@ namespace { if (!lkSparse_run(prevPyr[level], nextPyr[level], prevPts, nextPts, status, err, - prevPts.cols, level)) + static_cast(prevPts.total()), + level)) return false; } return true;