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
1b6639aa
Commit
1b6639aa
authored
Sep 06, 2012
by
yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little optimization on ocl/pyrdown, ocl/canny
parent
907a9101
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
canny.cpp
modules/ocl/src/canny.cpp
+7
-7
pyr_down.cl
modules/ocl/src/kernels/pyr_down.cl
+0
-0
test_canny.cpp
modules/ocl/test/test_canny.cpp
+1
-1
No files found.
modules/ocl/src/canny.cpp
View file @
1b6639aa
...
...
@@ -66,7 +66,7 @@ namespace cv
}
}
cv
::
ocl
::
CannyBuf
::
CannyBuf
(
const
oclMat
&
dx_
,
const
oclMat
&
dy_
)
:
dx
(
dx_
),
dy
(
dy_
)
cv
::
ocl
::
CannyBuf
::
CannyBuf
(
const
oclMat
&
dx_
,
const
oclMat
&
dy_
)
:
dx
(
dx_
),
dy
(
dy_
)
,
counter
(
NULL
)
{
CV_Assert
(
dx_
.
type
()
==
CV_32SC1
&&
dy_
.
type
()
==
CV_32SC1
&&
dx_
.
size
()
==
dy_
.
size
());
...
...
@@ -102,6 +102,10 @@ void cv::ocl::CannyBuf::create(const Size& image_size, int apperture_size)
float
counter_f
[
1
]
=
{
0
};
int
err
=
0
;
if
(
counter
)
{
openCLFree
(
counter
);
}
counter
=
clCreateBuffer
(
Context
::
getContext
()
->
impl
->
clContext
,
CL_MEM_COPY_HOST_PTR
,
sizeof
(
float
),
counter_f
,
&
err
);
openCLSafeCall
(
err
);
}
...
...
@@ -322,15 +326,11 @@ void canny::calcMap_gpu(oclMat& dx, oclMat& dy, oclMat& mag, oclMat& map, int ro
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
map
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
),
(
void
*
)
&
map
.
offset
));
#if CALCMAP_FIXED
size_t
globalThreads
[
3
]
=
{
cols
,
rows
,
1
};
string
kernelName
=
"calcMap"
;
size_t
localThreads
[
3
]
=
{
16
,
16
,
1
};
#else
size_t
globalThreads
[
3
]
=
{
cols
,
rows
,
1
};
string
kernelName
=
"calcMap_2"
;
size_t
localThreads
[
3
]
=
{
256
,
1
,
1
};
#endif
openCLExecuteKernel
(
clCxt
,
&
imgproc_canny
,
kernelName
,
globalThreads
,
localThreads
,
args
,
-
1
,
-
1
);
}
...
...
modules/ocl/src/kernels/pyr_down.cl
View file @
1b6639aa
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_canny.cpp
View file @
1b6639aa
...
...
@@ -103,6 +103,6 @@ TEST_P(Canny, Accuracy)
EXPECT_MAT_SIMILAR
(
edges_gold
,
edges
,
1e-2
);
}
INSTANTIATE_TEST_CASE_P
(
ocl
_ImgProc
,
Canny
,
testing
::
Combine
(
INSTANTIATE_TEST_CASE_P
(
GPU
_ImgProc
,
Canny
,
testing
::
Combine
(
testing
::
Values
(
AppertureSize
(
3
),
AppertureSize
(
5
)),
testing
::
Values
(
L2gradient
(
false
),
L2gradient
(
true
))));
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