Skip to content

Updated samples/optflow/motempl.py file to solve 3 issues. #2269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 23, 2019

Conversation

shaikmoeed
Copy link
Contributor

1) Resolved Syntax error at
line 14: def draw_motion_comp(vis, (x, y, w, h), angle, color):
by adding
line 14: def draw_motion_comp(vis, rect, angle, color):
line 15: x, y, w, h = rect

2) Resolved TypeError: integer argument expected, got float
Changed division to return integer value instead of float value
by changing from / to //.

3) Released cam variable in a proper way by adding .release() method by which program is exiting properly. If .release() method is not added, even after destroying all windows program is not get closed.

@alalek
Copy link
Member

alalek commented Sep 22, 2019

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).

So, 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".

@shaikmoeed shaikmoeed changed the base branch from master to 3.4 September 22, 2019 19:55
@shaikmoeed
Copy link
Contributor Author

@alalek I have pushed changes to this shaikmoeed:hotfix/samples-motempl-python-update. Can you merge it to 3.4 branch?

@alalek
Copy link
Member

alalek commented Sep 23, 2019

Perhaps push operation was failed. Please ensure that you using --force option.

@shaikmoeed shaikmoeed force-pushed the hotfix/samples-motempl-python-update branch from 72e4bdb to 3ab5af6 Compare September 23, 2019 15:01
@shaikmoeed
Copy link
Contributor Author

@alalek Sorry, I'm new to this rebase topic.
Please check now. I have used --force to push my commits.

Copy link
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.

Well done! Thank you 👍

@alalek alalek merged commit 4f524db into opencv:3.4 Sep 23, 2019
@shaikmoeed shaikmoeed deleted the hotfix/samples-motempl-python-update branch September 23, 2019 17:32
@shaikmoeed shaikmoeed restored the hotfix/samples-motempl-python-update branch September 23, 2019 17:32
@alalek alalek mentioned this pull request Sep 25, 2019
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