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
26d288bd
Unverified
Commit
26d288bd
authored
Dec 23, 2017
by
GlueCrow
Committed by
GitHub
Dec 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize OpenCL BackgroundSubstractionMOG2
parent
047764f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
13 deletions
+1
-13
bgfg_mog2.cl
modules/video/src/opencl/bgfg_mog2.cl
+1
-13
No files found.
modules/video/src/opencl/bgfg_mog2.cl
View file @
26d288bd
...
...
@@ -11,11 +11,6 @@
#
define
meanToFrame
(
a,
b
)
*b
=
(
float
)
a
;
#
endif
inline
float
sum
(
float
val
)
{
return
val
;
}
#
else
#
define
T_MEAN
float4
...
...
@@ -40,11 +35,6 @@ inline float sum(float val)
b.z
=
a[2]
; \
b.w
=
0.0f
;
inline
float
sum
(
const
float4
val
)
{
return
(
val.x
+
val.y
+
val.z
)
;
}
#
endif
__kernel
void
mog2_kernel
(
__global
const
uchar*
frame,
int
frame_step,
int
frame_offset,
int
frame_row,
int
frame_col,
//uchar
|
| uchar3
...
...
@@ -210,9 +200,7 @@ __kernel void mog2_kernel(__global const uchar* frame, int frame_step, int frame
int
mode_idx
=
mad24
(
mode,
idx_step,
pt_idx
)
;
T_MEAN
c_mean
=
_mean[mode_idx]
;
T_MEAN
pix_mean
=
pix
*
c_mean
;
float
numerator
=
sum
(
pix_mean
)
;
float
numerator
=
dot
(
pix,
c_mean
)
;
float
denominator
=
dot
(
c_mean,
c_mean
)
;
if
(
denominator
==
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