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
5728612f
Commit
5728612f
authored
Aug 29, 2013
by
Jin Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the trailing whitespace
parent
1e8194fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
17 deletions
+14
-17
bgfg_mog.cpp
modules/ocl/src/bgfg_mog.cpp
+7
-7
bgfg_mog.cl
modules/ocl/src/opencl/bgfg_mog.cl
+7
-10
No files found.
modules/ocl/src/bgfg_mog.cpp
View file @
5728612f
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
#include "precomp.hpp"
#include "precomp.hpp"
using
namespace
cv
;
using
namespace
cv
;
using
namespace
cv
::
ocl
;
using
namespace
cv
::
ocl
;
namespace
cv
namespace
cv
{
{
namespace
ocl
namespace
ocl
{
{
...
@@ -82,10 +82,10 @@ namespace cv { namespace ocl { namespace device
...
@@ -82,10 +82,10 @@ namespace cv { namespace ocl { namespace device
void
getBackgroundImage_ocl
(
int
cn
,
const
oclMat
&
weight
,
const
oclMat
&
mean
,
oclMat
&
dst
,
int
nmixtures
,
float
backgroundRatio
);
void
getBackgroundImage_ocl
(
int
cn
,
const
oclMat
&
weight
,
const
oclMat
&
mean
,
oclMat
&
dst
,
int
nmixtures
,
float
backgroundRatio
);
void
loadConstants
(
float
Tb
,
float
TB
,
float
Tg
,
float
varInit
,
float
varMin
,
float
varMax
,
float
tau
,
void
loadConstants
(
float
Tb
,
float
TB
,
float
Tg
,
float
varInit
,
float
varMin
,
float
varMax
,
float
tau
,
unsigned
char
shadowVal
);
unsigned
char
shadowVal
);
void
mog2_ocl
(
const
oclMat
&
frame
,
int
cn
,
oclMat
&
fgmask
,
oclMat
&
modesUsed
,
oclMat
&
weight
,
oclMat
&
variance
,
oclMat
&
mean
,
void
mog2_ocl
(
const
oclMat
&
frame
,
int
cn
,
oclMat
&
fgmask
,
oclMat
&
modesUsed
,
oclMat
&
weight
,
oclMat
&
variance
,
oclMat
&
mean
,
float
alphaT
,
float
prune
,
bool
detectShadows
,
int
nmixtures
);
float
alphaT
,
float
prune
,
bool
detectShadows
,
int
nmixtures
);
void
getBackgroundImage2_ocl
(
int
cn
,
const
oclMat
&
modesUsed
,
const
oclMat
&
weight
,
const
oclMat
&
mean
,
oclMat
&
dst
,
int
nmixtures
);
void
getBackgroundImage2_ocl
(
int
cn
,
const
oclMat
&
modesUsed
,
const
oclMat
&
weight
,
const
oclMat
&
mean
,
oclMat
&
dst
,
int
nmixtures
);
...
@@ -392,11 +392,11 @@ void cv::ocl::device::mog::loadConstants(float Tb, float TB, float Tg, float var
...
@@ -392,11 +392,11 @@ void cv::ocl::device::mog::loadConstants(float Tb, float TB, float Tg, float var
constants
->
c_tau
=
tau
;
constants
->
c_tau
=
tau
;
constants
->
c_shadowVal
=
shadowVal
;
constants
->
c_shadowVal
=
shadowVal
;
cl_constants
=
load_constant
(
*
((
cl_context
*
)
getoclContext
()),
*
((
cl_command_queue
*
)
getoclCommandQueue
()),
cl_constants
=
load_constant
(
*
((
cl_context
*
)
getoclContext
()),
*
((
cl_command_queue
*
)
getoclCommandQueue
()),
(
void
*
)
constants
,
sizeof
(
_contant_struct
));
(
void
*
)
constants
,
sizeof
(
_contant_struct
));
}
}
void
cv
::
ocl
::
device
::
mog
::
mog2_ocl
(
const
oclMat
&
frame
,
int
cn
,
oclMat
&
fgmaskRaw
,
oclMat
&
modesUsed
,
oclMat
&
weight
,
oclMat
&
variance
,
void
cv
::
ocl
::
device
::
mog
::
mog2_ocl
(
const
oclMat
&
frame
,
int
cn
,
oclMat
&
fgmaskRaw
,
oclMat
&
modesUsed
,
oclMat
&
weight
,
oclMat
&
variance
,
oclMat
&
mean
,
float
alphaT
,
float
prune
,
bool
detectShadows
,
int
nmixtures
)
oclMat
&
mean
,
float
alphaT
,
float
prune
,
bool
detectShadows
,
int
nmixtures
)
{
{
oclMat
fgmask
(
fgmaskRaw
.
size
(),
CV_32SC1
);
oclMat
fgmask
(
fgmaskRaw
.
size
(),
CV_32SC1
);
...
@@ -635,5 +635,4 @@ void cv::ocl::MOG2::release()
...
@@ -635,5 +635,4 @@ void cv::ocl::MOG2::release()
mean_
.
release
();
mean_
.
release
();
bgmodelUsedModes_
.
release
();
bgmodelUsedModes_
.
release
();
}
}
\ No newline at end of file
modules/ocl/src/opencl/bgfg_mog.cl
View file @
5728612f
...
@@ -134,7 +134,7 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
...
@@ -134,7 +134,7 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__global
T_MEAN_VAR*
var,
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__global
T_MEAN_VAR*
var,
int
frame_row,
int
frame_col,
int
frame_step,
int
fgmask_step,
int
frame_row,
int
frame_col,
int
frame_step,
int
fgmask_step,
int
weight_step,
int
mean_step,
int
var_step,
int
weight_step,
int
mean_step,
int
var_step,
float
varThreshold,
float
backgroundRatio,
int
fgmask_offset_x,
float
varThreshold,
float
backgroundRatio,
int
fgmask_offset_x,
int
fgmask_offset_y,
int
frame_offset_x,
int
frame_offset_y
)
int
fgmask_offset_y,
int
frame_offset_x,
int
frame_offset_y
)
{
{
int
x
=
get_global_id
(
0
)
;
int
x
=
get_global_id
(
0
)
;
...
@@ -142,7 +142,6 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
...
@@ -142,7 +142,6 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
if
(
x
<
frame_col
&&
y
<
frame_row
)
if
(
x
<
frame_col
&&
y
<
frame_row
)
{
{
T_MEAN_VAR
pix
=
cvt
(
frame[
(
y
+
frame_offset_y
)
*
frame_step
+
(
x
+
frame_offset_x
)
]
)
;
T_MEAN_VAR
pix
=
cvt
(
frame[
(
y
+
frame_offset_y
)
*
frame_step
+
(
x
+
frame_offset_x
)
]
)
;
int
kHit
=
-1
;
int
kHit
=
-1
;
...
@@ -179,20 +178,18 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
...
@@ -179,20 +178,18 @@ __kernel void mog_withoutLearning_kernel(__global T_FRAME* frame, __global uchar
}
}
}
}
}
}
if
(
kHit
<
0
|
| kHit >= kForeground)
if
(
kHit
<
0
|
| kHit >= kForeground)
fgmask[(y + fgmask_offset_y) * fgmask_step + (x + fgmask_offset_x)] = (uchar) (-1);
fgmask[(y + fgmask_offset_y) * fgmask_step + (x + fgmask_offset_x)] = (uchar) (-1);
else
else
fgmask[(y + fgmask_offset_y) * fgmask_step + (x + fgmask_offset_x)] = (uchar) (0);
fgmask[(y + fgmask_offset_y) * fgmask_step + (x + fgmask_offset_x)] = (uchar) (0);
}
}
}
}
__kernel void mog_withLearning_kernel(__global T_FRAME* frame, __global int* fgmask,
__kernel void mog_withLearning_kernel(__global T_FRAME* frame, __global int* fgmask,
__global float* weight, __global float* sortKey, __global T_MEAN_VAR* mean,
__global float* weight, __global float* sortKey, __global T_MEAN_VAR* mean,
__global T_MEAN_VAR* var, int frame_row, int frame_col, int frame_step, int fgmask_step,
__global T_MEAN_VAR* var, int frame_row, int frame_col, int frame_step, int fgmask_step,
int weight_step, int sortKey_step, int mean_step, int var_step,
int weight_step, int sortKey_step, int mean_step, int var_step,
float varThreshold, float backgroundRatio, float learningRate, float minVar,
float varThreshold, float backgroundRatio, float learningRate, float minVar,
int fgmask_offset_x, int fgmask_offset_y, int frame_offset_x, int frame_offset_y)
int fgmask_offset_x, int fgmask_offset_y, int frame_offset_x, int frame_offset_y)
{
{
const float w0 = 0.05f;
const float w0 = 0.05f;
...
@@ -322,7 +319,7 @@ __kernel void mog_withLearning_kernel(__global T_FRAME* frame, __global int* fgm
...
@@ -322,7 +319,7 @@ __kernel void mog_withLearning_kernel(__global T_FRAME* frame, __global int* fgm
__kernel
void
getBackgroundImage_kernel
(
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__global
T_FRAME*
dst,
__kernel
void
getBackgroundImage_kernel
(
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__global
T_FRAME*
dst,
int
dst_row,
int
dst_col,
int
weight_step,
int
mean_step,
int
dst_step,
int
dst_row,
int
dst_col,
int
weight_step,
int
mean_step,
int
dst_step,
float
backgroundRatio
)
float
backgroundRatio
)
{
{
int
x
=
get_global_id
(
0
)
;
int
x
=
get_global_id
(
0
)
;
...
@@ -351,8 +348,8 @@ __kernel void getBackgroundImage_kernel(__global float* weight, __global T_MEAN_
...
@@ -351,8 +348,8 @@ __kernel void getBackgroundImage_kernel(__global float* weight, __global T_MEAN_
}
}
__kernel
void
mog2_kernel
(
__global
T_FRAME
*
frame,
__global
int*
fgmask,
__global
float*
weight,
__global
T_MEAN_VAR
*
mean,
__kernel
void
mog2_kernel
(
__global
T_FRAME
*
frame,
__global
int*
fgmask,
__global
float*
weight,
__global
T_MEAN_VAR
*
mean,
__global
int*
modesUsed,
__global
float*
variance,
int
frame_row,
int
frame_col,
int
frame_step,
__global
int*
modesUsed,
__global
float*
variance,
int
frame_row,
int
frame_col,
int
frame_step,
int
fgmask_step,
int
weight_step,
int
mean_step,
int
modesUsed_step,
int
var_step,
float
alphaT,
float
alpha1,
float
prune,
int
fgmask_step,
int
weight_step,
int
mean_step,
int
modesUsed_step,
int
var_step,
float
alphaT,
float
alpha1,
float
prune,
int
detectShadows_flag,
int
fgmask_offset_x,
int
fgmask_offset_y,
int
frame_offset_x,
int
frame_offset_y,
__constant
con_srtuct_t*
constants
)
int
detectShadows_flag,
int
fgmask_offset_x,
int
fgmask_offset_y,
int
frame_offset_x,
int
frame_offset_y,
__constant
con_srtuct_t*
constants
)
{
{
int
x
=
get_global_id
(
0
)
;
int
x
=
get_global_id
(
0
)
;
...
@@ -505,7 +502,7 @@ __kernel void mog2_kernel(__global T_FRAME * frame, __global int* fgmask, __glob
...
@@ -505,7 +502,7 @@ __kernel void mog2_kernel(__global T_FRAME * frame, __global int* fgmask, __glob
}
}
__kernel
void
getBackgroundImage2_kernel
(
__global
int*
modesUsed,
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__kernel
void
getBackgroundImage2_kernel
(
__global
int*
modesUsed,
__global
float*
weight,
__global
T_MEAN_VAR*
mean,
__global
T_FRAME*
dst,
float
c_TB,
int
modesUsed_row,
int
modesUsed_col,
int
modesUsed_step,
int
weight_step,
__global
T_FRAME*
dst,
float
c_TB,
int
modesUsed_row,
int
modesUsed_col,
int
modesUsed_step,
int
weight_step,
int
mean_step,
int
dst_step,
int
dst_x,
int
dst_y
)
int
mean_step,
int
dst_step,
int
dst_x,
int
dst_y
)
{
{
int
x
=
get_global_id
(
0
)
;
int
x
=
get_global_id
(
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