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
941897aa
Commit
941897aa
authored
Aug 13, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed build errors in bgfg_gmg
parent
2a1e8e3e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
background_segm.hpp
modules/video/include/opencv2/video/background_segm.hpp
+1
-1
bgfg_gmg.cpp
modules/video/src/bgfg_gmg.cpp
+11
-11
No files found.
modules/video/include/opencv2/video/background_segm.hpp
View file @
941897aa
...
...
@@ -251,7 +251,7 @@ private:
int
frameNum_
;
cv
::
Mat_
<
int
>
nfeatures_
;
cv
::
Mat_
<
uint
>
colors_
;
cv
::
Mat_
<
u
nsigned
int
>
colors_
;
cv
::
Mat_
<
float
>
weights_
;
cv
::
Mat
buf_
;
...
...
modules/video/src/bgfg_gmg.cpp
View file @
941897aa
...
...
@@ -91,7 +91,7 @@ void cv::BackgroundSubtractorGMG::initialize(cv::Size frameSize, double min, dou
namespace
{
float
findFeature
(
u
int
color
,
const
u
int
*
colors
,
const
float
*
weights
,
int
nfeatures
)
float
findFeature
(
u
nsigned
int
color
,
const
unsigned
int
*
colors
,
const
float
*
weights
,
int
nfeatures
)
{
for
(
int
i
=
0
;
i
<
nfeatures
;
++
i
)
{
...
...
@@ -116,7 +116,7 @@ namespace
}
}
bool
insertFeature
(
u
int
color
,
float
weight
,
u
int
*
colors
,
float
*
weights
,
int
&
nfeatures
,
int
maxFeatures
)
bool
insertFeature
(
u
nsigned
int
color
,
float
weight
,
unsigned
int
*
colors
,
float
*
weights
,
int
&
nfeatures
,
int
maxFeatures
)
{
int
idx
=
-
1
;
for
(
int
i
=
0
;
i
<
nfeatures
;
++
i
)
...
...
@@ -134,7 +134,7 @@ namespace
{
// move feature to beginning of list
::
memmove
(
colors
+
1
,
colors
,
idx
*
sizeof
(
uint
));
::
memmove
(
colors
+
1
,
colors
,
idx
*
sizeof
(
u
nsigned
int
));
::
memmove
(
weights
+
1
,
weights
,
idx
*
sizeof
(
float
));
colors
[
0
]
=
color
;
...
...
@@ -144,7 +144,7 @@ namespace
{
// discard oldest feature
::
memmove
(
colors
+
1
,
colors
,
(
nfeatures
-
1
)
*
sizeof
(
uint
));
::
memmove
(
colors
+
1
,
colors
,
(
nfeatures
-
1
)
*
sizeof
(
u
nsigned
int
));
::
memmove
(
weights
+
1
,
weights
,
(
nfeatures
-
1
)
*
sizeof
(
float
));
colors
[
0
]
=
color
;
...
...
@@ -168,12 +168,12 @@ namespace
{
template
<
typename
T
>
struct
Quantization
{
static
uint
apply
(
const
void
*
src_
,
int
x
,
int
cn
,
double
minVal
,
double
maxVal
,
int
quantizationLevels
)
static
u
nsigned
int
apply
(
const
void
*
src_
,
int
x
,
int
cn
,
double
minVal
,
double
maxVal
,
int
quantizationLevels
)
{
const
T
*
src
=
static_cast
<
const
T
*>
(
src_
);
src
+=
x
*
cn
;
uint
res
=
0
;
u
nsigned
int
res
=
0
;
for
(
int
i
=
0
,
shift
=
0
;
i
<
cn
;
++
i
,
++
src
,
shift
+=
8
)
res
|=
static_cast
<
int
>
((
*
src
-
minVal
)
*
quantizationLevels
/
(
maxVal
-
minVal
))
<<
shift
;
...
...
@@ -184,7 +184,7 @@ namespace
class
GMG_LoopBody
:
public
cv
::
ParallelLoopBody
{
public
:
GMG_LoopBody
(
const
cv
::
Mat
&
frame
,
const
cv
::
Mat
&
fgmask
,
const
cv
::
Mat_
<
int
>&
nfeatures
,
const
cv
::
Mat_
<
uint
>&
colors
,
const
cv
::
Mat_
<
float
>&
weights
,
GMG_LoopBody
(
const
cv
::
Mat
&
frame
,
const
cv
::
Mat
&
fgmask
,
const
cv
::
Mat_
<
int
>&
nfeatures
,
const
cv
::
Mat_
<
u
nsigned
int
>&
colors
,
const
cv
::
Mat_
<
float
>&
weights
,
int
maxFeatures
,
double
learningRate
,
int
numInitializationFrames
,
int
quantizationLevels
,
double
backgroundPrior
,
double
decisionThreshold
,
double
maxVal
,
double
minVal
,
int
frameNum
,
bool
updateBackgroundModel
)
:
frame_
(
frame
),
fgmask_
(
fgmask
),
nfeatures_
(
nfeatures
),
colors_
(
colors
),
weights_
(
weights
),
...
...
@@ -202,7 +202,7 @@ namespace
mutable
cv
::
Mat_
<
uchar
>
fgmask_
;
mutable
cv
::
Mat_
<
int
>
nfeatures_
;
mutable
cv
::
Mat_
<
uint
>
colors_
;
mutable
cv
::
Mat_
<
u
nsigned
int
>
colors_
;
mutable
cv
::
Mat_
<
float
>
weights_
;
int
maxFeatures_
;
...
...
@@ -220,7 +220,7 @@ namespace
void
GMG_LoopBody
::
operator
()
(
const
cv
::
Range
&
range
)
const
{
typedef
uint
(
*
func_t
)(
const
void
*
src_
,
int
x
,
int
cn
,
double
minVal
,
double
maxVal
,
int
quantizationLevels
);
typedef
u
nsigned
int
(
*
func_t
)(
const
void
*
src_
,
int
x
,
int
cn
,
double
minVal
,
double
maxVal
,
int
quantizationLevels
);
static
const
func_t
funcs
[]
=
{
Quantization
<
uchar
>::
apply
,
...
...
@@ -246,10 +246,10 @@ namespace
for
(
int
x
=
0
;
x
<
frame_
.
cols
;
++
x
,
++
featureIdx
)
{
int
nfeatures
=
nfeatures_row
[
x
];
uint
*
colors
=
colors_
[
featureIdx
];
u
nsigned
int
*
colors
=
colors_
[
featureIdx
];
float
*
weights
=
weights_
[
featureIdx
];
uint
newFeatureColor
=
func
(
frame_row
,
x
,
cn
,
minVal_
,
maxVal_
,
quantizationLevels_
);
u
nsigned
int
newFeatureColor
=
func
(
frame_row
,
x
,
cn
,
minVal_
,
maxVal_
,
quantizationLevels_
);
bool
isForeground
=
false
;
...
...
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