Skip to content

Minor fix in OCL implementation of calcOpticalFlowPyrLK#19580

Merged
alalek merged 2 commits intoopencv:3.4from
SergeyKrivohatskiy:patch-1
Feb 21, 2021
Merged

Minor fix in OCL implementation of calcOpticalFlowPyrLK#19580
alalek merged 2 commits intoopencv:3.4from
SergeyKrivohatskiy:patch-1

Conversation

@SergeyKrivohatskiy
Copy link
Copy Markdown
Contributor

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.

@alalek
Copy link
Copy Markdown
Member

alalek commented Feb 20, 2021

Thank you for contribution!

As a "bugfix" this patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@SergeyKrivohatskiy SergeyKrivohatskiy changed the base branch from master to 3.4 February 20, 2021 15:19
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.
Signed-off-by: Sergey Krivohatskiy <s.krivohatskiy@gmail.com>
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution 👍

relates #10614

@alalek alalek merged commit af13f61 into opencv:3.4 Feb 21, 2021
@alalek alalek mentioned this pull request Feb 21, 2021
@SergeyKrivohatskiy SergeyKrivohatskiy deleted the patch-1 branch February 21, 2021 20:51
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants