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
9698079c
Commit
9698079c
authored
Mar 26, 2013
by
peng xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass warp size into SURF
parent
0c19a07b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
10 deletions
+32
-10
surf.ocl.cpp
modules/nonfree/src/surf.ocl.cpp
+30
-8
test_surf.ocl.cpp
modules/nonfree/test/test_surf.ocl.cpp
+1
-1
initialization.cpp
modules/ocl/src/initialization.cpp
+1
-1
No files found.
modules/nonfree/src/surf.ocl.cpp
View file @
9698079c
...
...
@@ -57,19 +57,29 @@ namespace cv
///////////////////////////OpenCL kernel strings///////////////////////////
extern
const
char
*
surf
;
const
char
*
noImage2dOption
=
"-D DISABLE_IMAGE2D"
;
const
char
noImage2dOption
[]
=
"-D DISABLE_IMAGE2D"
;
static
char
SURF_OPTIONS
[
1024
]
=
""
;
static
bool
USE_IMAGE2d
=
false
;
static
void
openCLExecuteKernelSURF
(
Context
*
clCxt
,
const
char
**
source
,
string
kernelName
,
size_t
globalThreads
[
3
],
size_t
localThreads
[
3
],
vector
<
pair
<
size_t
,
const
void
*>
>
&
args
,
int
channels
,
int
depth
)
{
if
(
support_image2d
())
char
*
pSURF_OPTIONS
=
SURF_OPTIONS
;
static
bool
OPTION_INIT
=
false
;
if
(
!
OPTION_INIT
)
{
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
);
}
else
if
(
!
USE_IMAGE2d
)
{
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
noImage2dOption
);
strcat
(
pSURF_OPTIONS
,
noImage2dOption
);
pSURF_OPTIONS
+=
strlen
(
noImage2dOption
);
}
size_t
wave_size
=
0
;
queryDeviceInfo
(
DEVICE_INFO
::
WAVEFRONT_SIZE
,
&
wave_size
);
sprintf
(
pSURF_OPTIONS
,
" -D WAVE_SIZE=%d"
,
static_cast
<
int
>
(
wave_size
));
OPTION_INIT
=
true
;
}
openCLExecuteKernel
(
clCxt
,
source
,
kernelName
,
globalThreads
,
localThreads
,
args
,
channels
,
depth
,
SURF_OPTIONS
);
}
}
}
...
...
@@ -152,8 +162,20 @@ public:
integral
(
img
,
surf_
.
sum
);
if
(
support_image2d
())
{
bindImgTex
(
img
,
imgTex
);
bindImgTex
(
surf_
.
sum
,
sumTex
);
try
{
bindImgTex
(
img
,
imgTex
);
bindImgTex
(
surf_
.
sum
,
sumTex
);
USE_IMAGE2d
=
true
;
}
catch
(
const
cv
::
Exception
&
e
)
{
USE_IMAGE2d
=
false
;
if
(
e
.
code
!=
CL_IMAGE_FORMAT_NOT_SUPPORTED
&&
e
.
code
!=
-
217
)
{
throw
e
;
}
}
}
maskSumTex
=
0
;
...
...
modules/nonfree/test/test_surf.ocl.cpp
View file @
9698079c
...
...
@@ -178,7 +178,7 @@ TEST_P(SURF, Detector)
EXPECT_GT
(
matchedRatio
,
0.99
);
}
TEST_P
(
SURF
,
D
ISABLED_D
escriptor
)
TEST_P
(
SURF
,
Descriptor
)
{
cv
::
Mat
image
=
cv
::
imread
(
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"c/fruits.jpg"
,
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
image
.
empty
());
...
...
modules/ocl/src/initialization.cpp
View file @
9698079c
...
...
@@ -361,7 +361,7 @@ namespace cv
{
case
WAVEFRONT_SIZE
:
{
#if
n
def CL_DEVICE_WAVEFRONT_WIDTH_AMD
#ifdef CL_DEVICE_WAVEFRONT_WIDTH_AMD
openCLSafeCall
(
clGetDeviceInfo
(
Context
::
getContext
()
->
impl
->
devices
[
0
],
CL_DEVICE_WAVEFRONT_WIDTH_AMD
,
sizeof
(
size_t
),
info
,
0
));
#else
...
...
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