Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
7e7e577f
Commit
7e7e577f
authored
Jul 02, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OpticalFlow: don't visualize noise (#1249)
parent
3db9af2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
examples/OpticalFlow/helper.py
examples/OpticalFlow/helper.py
+5
-2
No files found.
examples/OpticalFlow/helper.py
View file @
7e7e577f
...
...
@@ -83,7 +83,10 @@ class Flow(object):
rad
=
np
.
sqrt
(
fx
*
fx
+
fy
*
fy
)
max_rad
=
rad
.
max
()
normalizer
=
max
(
rad
.
max
(),
1
)
# This parameter controls how sensitive the visualization is to small displacement
# The smaller it is, the more sensitive the visualization is.
# We don't let it be smaller than 1 since we don't want to be sensitive to noise.
a
=
np
.
arctan2
(
-
fy
,
-
fx
)
/
np
.
pi
fk
=
(
a
+
1.0
)
/
2.0
*
(
NCOLS
-
1
)
...
...
@@ -97,7 +100,7 @@ class Flow(object):
f
=
np
.
stack
([
f
,
f
,
f
],
axis
=-
1
)
color
=
(
1
-
f
)
*
color0
+
f
*
color1
color
=
1
-
(
np
.
expand_dims
(
rad
,
axis
=-
1
)
/
max_rad
)
*
(
1
-
color
)
color
=
1
-
(
np
.
expand_dims
(
rad
,
axis
=-
1
)
/
normalizer
)
*
(
1
-
color
)
return
color
.
reshape
(
h
,
w
,
3
)[:,
:,
::
-
1
]
...
...
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