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
05f45a3b
Commit
05f45a3b
authored
Dec 04, 2010
by
Gary Bradski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revamped
parent
8dd85835
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
fback.cpp
samples/cpp/fback.cpp
+14
-2
No files found.
samples/cpp/fback.cpp
View file @
05f45a3b
...
...
@@ -2,8 +2,20 @@
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using
namespace
cv
;
using
namespace
std
;
void
help
()
{
cout
<<
"
\n
This program demonstrates dense, Farnback, optical flow
\n
"
"Mainly the function: calcOpticalFlowFarneback()
\n
"
"Call:
\n
"
"./fback
\n
"
"This reads from video camera 0
\n
"
<<
endl
;
}
void
drawOptFlowMap
(
const
Mat
&
flow
,
Mat
&
cflowmap
,
int
step
,
double
,
const
Scalar
&
color
)
{
...
...
@@ -20,7 +32,7 @@ void drawOptFlowMap(const Mat& flow, Mat& cflowmap, int step,
int
main
(
int
,
char
**
)
{
VideoCapture
cap
(
0
);
help
();
if
(
!
cap
.
isOpened
()
)
return
-
1
;
...
...
@@ -34,7 +46,7 @@ int main(int, char**)
if
(
prevgray
.
data
)
{
calcOpticalFlowFarneback
(
prevgray
,
gray
,
flow
,
0.5
,
3
,
15
,
3
,
5
,
1.2
,
0
);
(
prevgray
,
gray
,
flow
,
0.5
,
3
,
15
,
3
,
5
,
1.2
,
0
);
cvtColor
(
prevgray
,
cflow
,
CV_GRAY2BGR
);
drawOptFlowMap
(
flow
,
cflow
,
16
,
1.5
,
CV_RGB
(
0
,
255
,
0
));
imshow
(
"flow"
,
cflow
);
...
...
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