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
b5bd2cde
Commit
b5bd2cde
authored
Jan 16, 2013
by
yao
Committed by
Andrey Kamaev
Jan 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few optimizations to ocl::pyrLK::sparse, make it running on more OCL platforms
parent
02c9e0a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
5 deletions
+26
-5
arithm_mul.cl
modules/ocl/src/kernels/arithm_mul.cl
+21
-0
pyrlk.cl
modules/ocl/src/kernels/pyrlk.cl
+0
-0
pyrlk_no_image.cl
modules/ocl/src/kernels/pyrlk_no_image.cl
+0
-0
pyrlk.cpp
modules/ocl/src/pyrlk.cpp
+0
-0
test_pyrlk.cpp
modules/ocl/test/test_pyrlk.cpp
+5
-5
No files found.
modules/ocl/src/kernels/arithm_mul.cl
View file @
b5bd2cde
...
...
@@ -16,6 +16,7 @@
//
//
@Authors
//
Jia
Haipeng,
jiahaipeng95@gmail.com
//
Dachuan
Zhao,
dachuan@multicorewareinc.com
//
//
Redistribution
and
use
in
source
and
binary
forms,
with
or
without
modification,
//
are
permitted
provided
that
the
following
conditions
are
met:
...
...
@@ -260,3 +261,22 @@ __kernel void arithm_mul_D6 (__global double *src1, int src1_step, int src1_offs
}
}
#
endif
__kernel
void
arithm_muls_D5
(
__global
float
*src1,
int
src1_step,
int
src1_offset,
__global
float
*dst,
int
dst_step,
int
dst_offset,
int
rows,
int
cols,
int
dst_step1,
float
scalar
)
{
int
x
=
get_global_id
(
0
)
;
int
y
=
get_global_id
(
1
)
;
if
(
x
<
cols
&&
y
<
rows
)
{
int
src1_index
=
mad24
(
y,
src1_step,
(
x
<<
2
)
+
src1_offset
)
;
int
dst_index
=
mad24
(
y,
dst_step,
(
x
<<
2
)
+
dst_offset
)
;
float
data1
=
*
((
__global
float
*
)((
__global
char
*
)
src1
+
src1_index
))
;
float
tmp
=
data1
*
scalar
;
*
((
__global
float
*
)((
__global
char
*
)
dst
+
dst_index
))
=
tmp
;
}
}
\ No newline at end of file
modules/ocl/src/kernels/pyrlk.cl
View file @
b5bd2cde
This diff is collapsed.
Click to expand it.
modules/ocl/src/kernels/pyrlk_no_image.cl
0 → 100644
View file @
b5bd2cde
This diff is collapsed.
Click to expand it.
modules/ocl/src/pyrlk.cpp
View file @
b5bd2cde
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_pyrlk.cpp
View file @
b5bd2cde
...
...
@@ -118,9 +118,9 @@ TEST_P(Sparse, Mat)
cv
::
Mat
status_mat
(
1
,
d_status
.
cols
,
CV_8UC1
,
(
void
*
)
&
status
[
0
]);
d_status
.
download
(
status_mat
);
//
std::vector<float> err(d_err.cols);
//
cv::Mat err_mat(1, d_err.cols, CV_32FC1, (void*)&err[0]);
//
d_err.download(err_mat);
std
::
vector
<
float
>
err
(
d_err
.
cols
);
cv
::
Mat
err_mat
(
1
,
d_err
.
cols
,
CV_32FC1
,
(
void
*
)
&
err
[
0
]);
d_err
.
download
(
err_mat
);
std
::
vector
<
cv
::
Point2f
>
nextPts_gold
;
std
::
vector
<
unsigned
char
>
status_gold
;
...
...
@@ -153,9 +153,9 @@ TEST_P(Sparse, Mat)
}
}
double
bad_ratio
=
static_cast
<
double
>
(
mistmatch
)
/
(
nextPts
.
size
()
*
2
);
double
bad_ratio
=
static_cast
<
double
>
(
mistmatch
)
/
(
nextPts
.
size
());
ASSERT_LE
(
bad_ratio
,
0.0
5
f
);
ASSERT_LE
(
bad_ratio
,
0.0
2
f
);
}
...
...
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