Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
36477fde
Commit
36477fde
authored
Apr 12, 2016
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6344 from anatolix:kalmanpyfix
parents
ee9f8890
1740218e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
kalman.py
samples/python/kalman.py
+5
-5
No files found.
samples/python/kalman.py
View file @
36477fde
#!/usr/bin/python
#!/usr/bin/
env
python
"""
Tracking of rotating point.
Rotation speed is constant.
...
...
@@ -19,7 +19,7 @@ if PY3:
long
=
int
import
cv2
from
math
import
cos
,
sin
from
math
import
cos
,
sin
,
sqrt
import
numpy
as
np
if
__name__
==
"__main__"
:
...
...
@@ -81,16 +81,16 @@ if __name__ == "__main__":
kalman
.
correct
(
measurement
)
process_noise
=
kalman
.
processNoiseCov
*
np
.
random
.
randn
(
2
,
1
)
process_noise
=
sqrt
(
kalman
.
processNoiseCov
[
0
,
0
])
*
np
.
random
.
randn
(
2
,
1
)
state
=
np
.
dot
(
kalman
.
transitionMatrix
,
state
)
+
process_noise
cv2
.
imshow
(
"Kalman"
,
img
)
code
=
cv2
.
waitKey
(
100
)
%
0x100
code
=
cv2
.
waitKey
(
100
)
if
code
!=
-
1
:
break
if
code
in
[
27
,
ord
(
'q'
),
ord
(
'Q'
)]:
if
(
code
%
0x100
)
in
[
27
,
ord
(
'q'
),
ord
(
'Q'
)]:
break
cv2
.
destroyWindow
(
"Kalman"
)
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