Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
26129cfe
Commit
26129cfe
authored
Sep 25, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
parents
5faa3ec8
1a15cbc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
motempl.py
modules/optflow/samples/motempl.py
+6
-3
No files found.
modules/optflow/samples/motempl.py
View file @
26129cfe
...
...
@@ -11,10 +11,11 @@ MIN_TIME_DELTA = 0.05
def
nothing
(
dummy
):
pass
def
draw_motion_comp
(
vis
,
(
x
,
y
,
w
,
h
),
angle
,
color
):
def
draw_motion_comp
(
vis
,
rect
,
angle
,
color
):
x
,
y
,
w
,
h
=
rect
cv
.
rectangle
(
vis
,
(
x
,
y
),
(
x
+
w
,
y
+
h
),
(
0
,
255
,
0
))
r
=
min
(
w
/
2
,
h
/
2
)
cx
,
cy
=
x
+
w
/
2
,
y
+
h
/
2
r
=
min
(
w
/
/
2
,
h
/
/
2
)
cx
,
cy
=
x
+
w
/
/
2
,
y
+
h
/
/
2
angle
=
angle
*
np
.
pi
/
180
cv
.
circle
(
vis
,
(
cx
,
cy
),
r
,
color
,
3
)
cv
.
line
(
vis
,
(
cx
,
cy
),
(
int
(
cx
+
np
.
cos
(
angle
)
*
r
),
int
(
cy
+
np
.
sin
(
angle
)
*
r
)),
color
,
3
)
...
...
@@ -91,4 +92,6 @@ if __name__ == '__main__':
prev_frame
=
frame
.
copy
()
if
0xFF
&
cv
.
waitKey
(
5
)
==
27
:
break
# cleanup the camera and close any open windows
cam
.
release
()
cv
.
destroyAllWindows
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment