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
ca9810e8
Commit
ca9810e8
authored
Dec 26, 2013
by
Konstantin Matskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hope last fix
parent
52df2b34
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
6 deletions
+33
-6
morph.cpp
modules/imgproc/src/morph.cpp
+33
-6
No files found.
modules/imgproc/src/morph.cpp
View file @
ca9810e8
...
@@ -1331,6 +1331,27 @@ static bool ocl_morphology_op(InputArray _src, OutputArray _dst, InputArray _ker
...
@@ -1331,6 +1331,27 @@ static bool ocl_morphology_op(InputArray _src, OutputArray _dst, InputArray _ker
_dst
.
create
(
src
.
size
(),
src
.
type
());
_dst
.
create
(
src
.
size
(),
src
.
type
());
UMat
dst
=
_dst
.
getUMat
();
UMat
dst
=
_dst
.
getUMat
();
if
(
iterations
==
1
&&
src
.
u
!=
dst
.
u
)
{
Size
wholesize
;
Point
ofs
;
src
.
locateROI
(
wholesize
,
ofs
);
int
wholecols
=
wholesize
.
width
,
wholerows
=
wholesize
.
height
;
int
idxArg
=
0
;
idxArg
=
kernels
[
0
].
set
(
idxArg
,
ocl
::
KernelArg
::
ReadOnlyNoSize
(
src
));
idxArg
=
kernels
[
0
].
set
(
idxArg
,
ocl
::
KernelArg
::
WriteOnlyNoSize
(
dst
));
idxArg
=
kernels
[
0
].
set
(
idxArg
,
ofs
.
x
);
idxArg
=
kernels
[
0
].
set
(
idxArg
,
ofs
.
y
);
idxArg
=
kernels
[
0
].
set
(
idxArg
,
src
.
cols
);
idxArg
=
kernels
[
0
].
set
(
idxArg
,
src
.
rows
);
idxArg
=
kernels
[
0
].
set
(
idxArg
,
ocl
::
KernelArg
::
PtrReadOnly
(
kernel
));
idxArg
=
kernels
[
0
].
set
(
idxArg
,
wholecols
);
idxArg
=
kernels
[
0
].
set
(
idxArg
,
wholerows
);
return
kernels
[
0
].
run
(
2
,
globalThreads
,
localThreads
,
false
);
}
for
(
int
i
=
0
;
i
<
iterations
;
i
++
)
for
(
int
i
=
0
;
i
<
iterations
;
i
++
)
{
{
UMat
source
;
UMat
source
;
...
@@ -1380,9 +1401,12 @@ static void morphOp( int op, InputArray _src, OutputArray _dst,
...
@@ -1380,9 +1401,12 @@ static void morphOp( int op, InputArray _src, OutputArray _dst,
Point
anchor
,
int
iterations
,
Point
anchor
,
int
iterations
,
int
borderType
,
const
Scalar
&
borderValue
)
int
borderType
,
const
Scalar
&
borderValue
)
{
{
bool
useOpenCL
=
cv
::
ocl
::
useOpenCL
()
&&
_src
.
isUMat
()
&&
_src
.
size
()
==
_dst
.
size
()
&&
_src
.
channels
()
==
_dst
.
channels
()
&&
int
src_type
=
_src
.
type
(),
dst_type
=
_dst
.
type
(),
_src
.
dims
()
<=
2
&&
(
_src
.
channels
()
==
1
||
_src
.
channels
()
==
4
)
&&
(
anchor
.
x
==
-
1
)
&&
(
anchor
.
y
==
-
1
)
&&
src_cn
=
CV_MAT_CN
(
src_type
),
src_depth
=
CV_MAT_DEPTH
(
src_type
);
(
_src
.
depth
()
==
CV_8U
||
_src
.
depth
()
==
CV_32F
||
_src
.
depth
()
==
CV_64F
)
&&
bool
useOpenCL
=
cv
::
ocl
::
useOpenCL
()
&&
_src
.
isUMat
()
&&
_src
.
size
()
==
_dst
.
size
()
&&
src_type
==
dst_type
&&
_src
.
dims
()
<=
2
&&
(
src_cn
==
1
||
src_cn
==
4
)
&&
(
anchor
.
x
==
-
1
)
&&
(
anchor
.
y
==
-
1
)
&&
(
src_depth
==
CV_8U
||
src_depth
==
CV_32F
||
src_depth
==
CV_64F
)
&&
(
borderType
==
cv
::
BORDER_CONSTANT
)
&&
(
borderValue
==
morphologyDefaultBorderValue
())
&&
(
borderType
==
cv
::
BORDER_CONSTANT
)
&&
(
borderValue
==
morphologyDefaultBorderValue
())
&&
(
op
==
MORPH_ERODE
||
op
==
MORPH_DILATE
);
(
op
==
MORPH_ERODE
||
op
==
MORPH_DILATE
);
...
@@ -1470,9 +1494,12 @@ void cv::morphologyEx( InputArray _src, OutputArray _dst, int op,
...
@@ -1470,9 +1494,12 @@ void cv::morphologyEx( InputArray _src, OutputArray _dst, int op,
InputArray
kernel
,
Point
anchor
,
int
iterations
,
InputArray
kernel
,
Point
anchor
,
int
iterations
,
int
borderType
,
const
Scalar
&
borderValue
)
int
borderType
,
const
Scalar
&
borderValue
)
{
{
bool
use_opencl
=
cv
::
ocl
::
useOpenCL
()
&&
_src
.
isUMat
()
&&
_src
.
size
()
==
_dst
.
size
()
&&
_src
.
channels
()
==
_dst
.
channels
()
&&
int
src_type
=
_src
.
type
(),
dst_type
=
_dst
.
type
(),
_src
.
dims
()
<=
2
&&
(
_src
.
channels
()
==
1
||
_src
.
channels
()
==
4
)
&&
(
anchor
.
x
==
-
1
)
&&
(
anchor
.
y
==
-
1
)
&&
src_cn
=
CV_MAT_CN
(
src_type
),
src_depth
=
CV_MAT_DEPTH
(
src_type
);
(
_src
.
depth
()
==
CV_8U
||
_src
.
depth
()
==
CV_32F
||
_src
.
depth
()
==
CV_64F
)
&&
bool
use_opencl
=
cv
::
ocl
::
useOpenCL
()
&&
_src
.
isUMat
()
&&
_src
.
size
()
==
_dst
.
size
()
&&
src_type
==
dst_type
&&
_src
.
dims
()
<=
2
&&
(
src_cn
==
1
||
src_cn
==
4
)
&&
(
anchor
.
x
==
-
1
)
&&
(
anchor
.
y
==
-
1
)
&&
(
src_depth
==
CV_8U
||
src_depth
==
CV_32F
||
src_depth
==
CV_64F
)
&&
(
borderType
==
cv
::
BORDER_CONSTANT
)
&&
(
borderValue
==
morphologyDefaultBorderValue
());
(
borderType
==
cv
::
BORDER_CONSTANT
)
&&
(
borderValue
==
morphologyDefaultBorderValue
());
_dst
.
create
(
_src
.
size
(),
_src
.
type
());
_dst
.
create
(
_src
.
size
(),
_src
.
type
());
...
...
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