Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
navipy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier Bertrand
navipy
Commits
452eae3d
Commit
452eae3d
authored
6 years ago
by
Luise Odenthal
Browse files
Options
Downloads
Patches
Plain Diff
repaired optic flow test
parent
d5f0923a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
navipy/maths/coordinates.py
+3
-0
3 additions, 0 deletions
navipy/maths/coordinates.py
navipy/processing/test_OpticFlow.py
+9
-9
9 additions, 9 deletions
navipy/processing/test_OpticFlow.py
with
12 additions
and
9 deletions
navipy/maths/coordinates.py
+
3
−
0
View file @
452eae3d
...
...
@@ -4,6 +4,8 @@
import
numpy
as
np
from
navipy.maths.homogeneous_transformations
import
rotation_matrix
from
navipy.scene
import
is_numeric_array
from
navipy.maths.homogeneous_transformations
\
import
compose_matrix
def
cartesian_to_spherical
(
x
,
y
,
z
):
...
...
@@ -64,6 +66,7 @@ def cartesian_to_spherical_vectors(opticFlow, angles, viewing_direction):
direction must be of size two
"
)
vec
=
opticFlow
ypr
=
angles
M
=
compose_matrix
(
scale
=
None
,
shear
=
None
,
angles
=
ypr
,
translate
=
None
,
perspective
=
None
,
axes
=
'
rzyx
'
)[:
3
,
:
3
]
vec
=
np
.
dot
(
np
.
transpose
(
M
),
vec
)
...
...
This diff is collapsed.
Click to expand it.
navipy/processing/test_OpticFlow.py
+
9
−
9
View file @
452eae3d
...
...
@@ -702,15 +702,15 @@ class TestCase(unittest.TestCase):
[-0.09950368, -0.0994883, -0.09944262],
[-0.09950195, -0.09948661, -0.09944095]]
"""
testrof
=
[[
4.99512718e-07
,
4.99512718e-07
,
4.99512718e-07
],
[
3.25455335e-07
,
3.27951595e-07
,
3.30500411e-07
],
[
1.50999906e-07
,
1.54939566e-07
,
1.589853
69e-
07
]]
testhof
=
[[
9.88397894e-06
,
1.74640417
e-03
,
3.4
8239240
e-03
],
[
-
1.
66074328
e-04
,
1.5
7018176
e-03
,
3.
30590701
e-03
],
[
-
3.4
1982048
e-04
,
1.3
9348106
e-03
,
3.12
84146
2e-03
]]
testvof
=
[[
-
0.09950042
,
-
0.099485
09
,
-
0.099439
46
],
[
-
0.0995004
3
,
-
0.099485
13
,
-
0.099439
53
],
[
-
0.0995004
4
,
-
0.099485
17
,
-
0.099439
6
]]
testrof
=
[[
-
8.88472903e-19
,
-
8.87544964e-19
,
-
8.84761429e-19
],
[
1.30104261e-18
,
-
2.16840434e-19
,
-
8.67361738e-19
],
[
-
4.33680869e-19
,
0.00000000e+00
,
4.336808
69e-
19
]]
testhof
=
[[
3.18909128e-10
,
1.73652203
e-03
,
3.4
7251478
e-03
],
[
-
1.
74233017
e-04
,
1.5
6202421
e-03
,
3.
29775256
e-03
],
[
-
3.4
8413280
e-04
,
1.3
8705059
e-03
,
3.12
19858
2e-03
]]
testvof
=
[[
-
0.09950042
,
-
0.099485
26
,
-
0.099439
8
],
[
-
0.0995004
2
,
-
0.099485
26
,
-
0.099439
8
],
[
-
0.0995004
2
,
-
0.099485
26
,
-
0.099439
8
]]
assert
np
.
all
(
np
.
isclose
(
rof
,
testrof
))
assert
np
.
all
(
np
.
isclose
(
hof
,
testhof
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment