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
98f73705
Commit
98f73705
authored
Oct 26, 2013
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: fix morph filters
parent
0f95f0d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
filtering.cpp
modules/ocl/src/filtering.cpp
+5
-11
No files found.
modules/ocl/src/filtering.cpp
View file @
98f73705
...
...
@@ -321,28 +321,22 @@ static void GPUDilate(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
openCLExecuteKernel
(
clCxt
,
&
filtering_morph
,
kernelName
,
globalThreads
,
localThreads
,
args
,
-
1
,
-
1
,
compile_option
);
}
Ptr
<
BaseFilter_GPU
>
cv
::
ocl
::
getMorphologyFilter_GPU
(
int
op
,
int
type
,
const
Mat
&
kernel
,
const
Size
&
ksize
,
Point
anchor
)
Ptr
<
BaseFilter_GPU
>
cv
::
ocl
::
getMorphologyFilter_GPU
(
int
op
,
int
type
,
const
Mat
&
_
kernel
,
const
Size
&
ksize
,
Point
anchor
)
{
static
const
GPUMorfFilter_t
GPUMorfFilter_callers
[
2
][
5
]
=
{
{
0
,
GPUErode
,
0
,
GPUErode
,
GPUErode
},
{
0
,
GPUDilate
,
0
,
GPUDilate
,
GPUDilate
}
};
CV_Assert
(
op
==
MORPH_ERODE
||
op
==
MORPH_DILATE
);
CV_Assert
(
type
==
CV_8UC1
||
type
==
CV_8UC3
||
type
==
CV_8UC4
||
type
==
CV_32FC1
||
type
==
CV_32FC3
||
type
==
CV_32FC4
);
normalizeAnchor
(
anchor
,
ksize
);
Mat
kernel8U
;
kernel
.
convertTo
(
kernel8U
,
CV_8U
);
Mat
cont_krn
l
=
kernel8U
.
reshape
(
1
,
1
);
_
kernel
.
convertTo
(
kernel8U
,
CV_8U
);
Mat
kerne
l
=
kernel8U
.
reshape
(
1
,
1
);
bool
noZero
=
true
;
for
(
int
i
=
0
;
i
<
kernel
.
rows
*
kernel
.
cols
;
++
i
)
if
(
kernel
.
data
[
i
]
!=
1
)
if
(
kernel
.
at
<
uchar
>
(
i
)
!=
1
)
noZero
=
false
;
MorphFilter_GPU
*
mfgpu
=
new
MorphFilter_GPU
(
ksize
,
anchor
,
cont_krnl
,
GPUMorfFilter_callers
[
op
][
CV_MAT_CN
(
type
)]
);
MorphFilter_GPU
*
mfgpu
=
new
MorphFilter_GPU
(
ksize
,
anchor
,
kernel
,
op
==
MORPH_ERODE
?
GPUErode
:
GPUDilate
);
if
(
noZero
)
mfgpu
->
rectKernel
=
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