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
545f0267
Commit
545f0267
authored
Dec 19, 2013
by
Matthias Bady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimized version. Faster than CPU
parent
69d034ec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
brief.cpp
modules/ocl/src/brief.cpp
+11
-15
brief.cl
modules/ocl/src/opencl/brief.cl
+0
-0
No files found.
modules/ocl/src/brief.cpp
View file @
545f0267
...
...
@@ -61,30 +61,27 @@ BRIEF_OCL::compute( const oclMat& image, oclMat& keypoints, oclMat& descriptors
oclMat
sum
;
integral
(
grayImage
,
sum
,
CV_32S
);
cl_mem
sumTexture
=
bindTexture
(
sum
);
cl_mem
sumTexture
=
bindTexture
(
sum
);
//TODO filter keypoints by border
oclMat
xRow
=
keypoints
.
row
(
0
);
oclMat
yRow
=
keypoints
.
row
(
1
);
descriptors
=
oclMat
(
keypoints
.
cols
,
bytes
,
CV_8U
);
std
::
stringstream
build_opt
;
build_opt
<<
" -D BYTES="
<<
bytes
<<
" -D KERNEL_SIZE="
<<
KERNEL_SIZE
;
const
String
kernelname
=
"extractBriefDescriptors"
;
size_t
globalThreads
[
3
]
=
{
keypoints
.
col
s
,
1
,
1
};
size_t
localThreads
[
3
]
=
{
1
,
1
,
1
};
size_t
localThreads
[
3
]
=
{
byte
s
,
1
,
1
};
size_t
globalThreads
[
3
]
=
{
keypoints
.
cols
*
bytes
,
1
,
1
};
std
::
vector
<
std
::
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
sumTexture
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
xRow
.
data
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
yRow
.
data
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
descriptors
.
data
));
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
sumTexture
)
);
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
keypoints
.
data
)
);
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
keypoints
.
step
)
);
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
descriptors
.
data
)
);
args
.
push_back
(
std
::
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
descriptors
.
step
)
);
Context
*
ctx
=
Context
::
getContext
(
);
openCLExecuteKernel
(
ctx
,
&
brief
,
kernelname
,
globalThreads
,
localThreads
,
args
,
-
1
,
-
1
,
build_opt
.
str
(
).
c_str
(
)
);
openCLFree
(
sumTexture
);
openCLExecuteKernel
(
ctx
,
&
brief
,
kernelname
,
globalThreads
,
localThreads
,
args
,
-
1
,
-
1
,
build_opt
.
str
(
).
c_str
(
)
);
openCLFree
(
sumTexture
);
}
//optimiuerungsstrategieen:
// - vorher ganzes bild blurren (vgl. orb)
\ No newline at end of file
modules/ocl/src/opencl/brief.cl
View file @
545f0267
This diff is collapsed.
Click to expand it.
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