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
712689e8
Commit
712689e8
authored
Oct 30, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9865 from ryanfox:patch-4
parents
7b0d2d18
3da9598a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
py_bg_subtraction.markdown
...als/py_video/py_bg_subtraction/py_bg_subtraction.markdown
+8
-8
No files found.
doc/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.markdown
View file @
712689e8
...
...
@@ -11,21 +11,21 @@ In this chapter,
Basics
------
Background subtraction is a major preprocessing step
s in many vision
based applications. For
example, consider the case
s like
visitor counter where a static camera takes the number of visitors
Background subtraction is a major preprocessing step
in many vision-
based applications. For
example, consider the case
of a
visitor counter where a static camera takes the number of visitors
entering or leaving the room, or a traffic camera extracting information about the vehicles etc. In
all these cases, first you need to extract the person or vehicles alone. Technically, you need to
extract the moving foreground from static background.
If you have an image of background alone, like image of the room without visitors, image of the road
If you have an image of background alone, like
an
image of the room without visitors, image of the road
without vehicles etc, it is an easy job. Just subtract the new image from the background. You get
the foreground objects alone. But in most of the cases, you may not have such an image, so we need
to extract the background from whatever images we have. It become more complicated when there
is
shadow
of the vehicles. Since shadow is also moving
, simple subtraction will mark that also as
to extract the background from whatever images we have. It become more complicated when there
are
shadow
s of the vehicles. Since shadows also move
, simple subtraction will mark that also as
foreground. It complicates things.
Several algorithms were introduced for this purpose. OpenCV has implemented three such algorithms
which
is
very easy to use. We will see them one-by-one.
which
are
very easy to use. We will see them one-by-one.
### BackgroundSubtractorMOG
...
...
@@ -76,7 +76,7 @@ throughout the algorithm). It provides better adaptibility to varying scenes due
changes etc.
As in previous case, we have to create a background subtractor object. Here, you have an option of
selecting whether shadow to be detected
or not. If detectShadows = True (which is so by default), it
detecting shadows
or not. If detectShadows = True (which is so by default), it
detects and marks shadows, but decreases the speed. Shadows will be marked in gray color.
@code{.py}
import numpy as np
...
...
@@ -104,7 +104,7 @@ cv2.destroyAllWindows()
### BackgroundSubtractorGMG
This algorithm combines statistical background image estimation and per-pixel Bayesian segmentation.
It was introduced by Andrew B. Godbehere, Akihiro Matsukawa, Ken Goldberg in their paper "Visual
It was introduced by Andrew B. Godbehere, Akihiro Matsukawa,
and
Ken Goldberg in their paper "Visual
Tracking of Human Visitors under Variable-Lighting Conditions for a Responsive Audio Art
Installation" in 2012. As per the paper, the system ran a successful interactive audio art
installation called “Are We There Yet?” from March 31 - July 31 2011 at the Contemporary Jewish
...
...
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