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
1cb87da0
Commit
1cb87da0
authored
Dec 01, 2010
by
Gary Bradski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added docs and minor program changes
parent
28bca0ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
segment_objects.cpp
samples/cpp/segment_objects.cpp
+15
-1
No files found.
samples/cpp/segment_objects.cpp
View file @
1cb87da0
...
...
@@ -6,6 +6,15 @@
using
namespace
cv
;
void
help
()
{
printf
(
"
\n
"
"This program demonstrated a simple method of connected components clean up of background subtraction
\n
"
"When the program starts, it begins learning the background. You can toggle background learning on and off
\n
"
"by hitting the space bar.
\n
"
"Call
\n
"
"./segment_objects [video file, else it reads camera 0]
\n\n
"
);
}
void
refineSegments
(
const
Mat
&
img
,
Mat
&
mask
,
Mat
&
dst
)
{
...
...
@@ -52,6 +61,8 @@ int main(int argc, char** argv)
VideoCapture
cap
;
bool
update_bg_model
=
true
;
help
();
if
(
argc
<
2
)
cap
.
open
(
0
);
else
...
...
@@ -59,7 +70,7 @@ int main(int argc, char** argv)
if
(
!
cap
.
isOpened
()
)
{
printf
(
"
c
an not open camera or video file
\n
"
);
printf
(
"
\n
C
an not open camera or video file
\n
"
);
return
-
1
;
}
...
...
@@ -93,7 +104,10 @@ int main(int argc, char** argv)
if
(
keycode
==
27
)
break
;
if
(
keycode
==
' '
)
{
update_bg_model
=
!
update_bg_model
;
printf
(
"Learn background is in state = %d
\n
"
,
update_bg_model
);
}
}
return
0
;
...
...
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