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
84cd5096
Commit
84cd5096
authored
Nov 30, 2010
by
Gary Bradski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
described
parent
fb671863
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
bgfg_segm.cpp
samples/cpp/bgfg_segm.cpp
+15
-0
No files found.
samples/cpp/bgfg_segm.cpp
View file @
84cd5096
...
...
@@ -2,6 +2,14 @@
#include <opencv2/highgui/highgui.hpp>
#include <stdio.h>
void
help
()
{
printf
(
"
\n
Do background segmentation, especially demonstrating the use of cvUpdateBGStatModel.
\n
"
"Learns the background at the start and then segments.
\n
"
"Learning is togged by the space key. Will read from file or camera
\n
"
"Call:
\n
"
"./ bgfg_segm [file name -- if no name, read from camera]
\n\n
"
);
}
//this is a sample for foreground detection functions
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -14,6 +22,7 @@ int main(int argc, char** argv)
cap
=
cvCaptureFromCAM
(
0
);
else
cap
=
cvCaptureFromFile
(
argv
[
1
]);
help
();
if
(
!
cap
)
{
...
...
@@ -52,7 +61,13 @@ int main(int argc, char** argv)
char
k
=
cvWaitKey
(
5
);
if
(
k
==
27
)
break
;
if
(
k
==
' '
)
{
update_bg_model
=
!
update_bg_model
;
if
(
update_bg_model
)
printf
(
"Background update is on
\n
"
);
else
printf
(
"Background update is off
\n
"
);
}
}
...
...
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