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
c10225bd
Commit
c10225bd
authored
Dec 03, 2010
by
Gary Bradski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs
parent
cfd17630
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
motempl.c
samples/c/motempl.c
+13
-1
No files found.
samples/c/motempl.c
View file @
c10225bd
...
...
@@ -2,7 +2,19 @@
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <time.h>
#include <stdio.h>
void
help
()
{
printf
(
"
\n
This program demonstrated the use of motion templates -- basically using the gradients
\n
"
"of thresholded layers of decaying frame differencing. New movements are stamped on top with floating system
\n
"
"time code and motions too old are thresholded away. This is the 'motion history file'. The program reads from the camera of your choice or from
\n
"
"a file. Gradients of motion history are used to detect direction of motoin etc
\n
"
"Call:
\n
"
"./motempl [camera number 0-n or file name, default is camera 0]
\n
"
);
}
// various tracking parameters (in seconds)
const
double
MHI_DURATION
=
1
;
const
double
MAX_TIME_DELTA
=
0
.
5
;
...
...
@@ -147,7 +159,7 @@ int main(int argc, char** argv)
{
IplImage
*
motion
=
0
;
CvCapture
*
capture
=
0
;
help
();
if
(
argc
==
1
||
(
argc
==
2
&&
strlen
(
argv
[
1
])
==
1
&&
isdigit
(
argv
[
1
][
0
])))
capture
=
cvCaptureFromCAM
(
argc
==
2
?
argv
[
1
][
0
]
-
'0'
:
0
);
else
if
(
argc
==
2
)
...
...
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