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
f4b8babb
Commit
f4b8babb
authored
Oct 29, 2013
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Oct 29, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1677 from pengx17:patch-1
parents
42c4f91e
ab2bd58f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
52 deletions
+40
-52
imgproc_canny.cl
modules/ocl/src/opencl/imgproc_canny.cl
+40
-52
No files found.
modules/ocl/src/opencl/imgproc_canny.cl
View file @
f4b8babb
...
@@ -600,17 +600,12 @@ edgesHysteresisGlobal
...
@@ -600,17 +600,12 @@ edgesHysteresisGlobal
int
map_offset
int
map_offset
)
)
{
{
map_step
/=
sizeof
(
*map
)
;
map_step
/=
sizeof
(
*map
)
;
map_offset
/=
sizeof
(
*map
)
;
map_offset
/=
sizeof
(
*map
)
;
map
+=
map_offset
;
map
+=
map_offset
;
int
gidx
=
get_global_id
(
0
)
;
int
gidy
=
get_global_id
(
1
)
;
int
lidx
=
get_local_id
(
0
)
;
int
lidx
=
get_local_id
(
0
)
;
int
lidy
=
get_local_id
(
1
)
;
int
grp_idx
=
get_group_id
(
0
)
;
int
grp_idx
=
get_group_id
(
0
)
;
int
grp_idy
=
get_group_id
(
1
)
;
int
grp_idy
=
get_group_id
(
1
)
;
...
@@ -631,71 +626,64 @@ edgesHysteresisGlobal
...
@@ -631,71 +626,64 @@ edgesHysteresisGlobal
if
(
ind
<
count
)
if
(
ind
<
count
)
{
{
ushort2
pos
=
st1[ind]
;
ushort2
pos
=
st1[ind]
;
if
(
pos.x
>
0
&&
pos.x
<=
cols
&&
pos.y
>
0
&&
pos.y
<=
rows
)
if
(
lidx
<
8
)
{
{
if
(
lidx
<
8
)
pos.x
+=
c_dx[lidx]
;
pos.y
+=
c_dy[lidx]
;
if
(
pos.x
>
0
&&
pos.x
<=
cols
&&
pos.y
>
0
&&
pos.y
<=
rows
&&
map[pos.x
+
pos.y
*
map_step]
==
1
)
{
{
pos.x
+=
c_dx[lidx]
;
map[pos.x
+
pos.y
*
map_step]
=
2
;
pos.y
+=
c_dy[lidx]
;
if
(
map[pos.x
+
pos.y
*
map_step]
==
1
)
ind
=
atomic_inc
(
&s_counter
)
;
{
map[pos.x
+
pos.y
*
map_step]
=
2
;
ind
=
atomic_inc
(
&s_counter
)
;
s_st[ind]
=
pos
;
s_st[ind]
=
pos
;
}
}
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
while
(
s_counter
>
0
&&
s_counter
<=
stack_size
-
get_local_size
(
0
))
{
const
int
subTaskIdx
=
lidx
>>
3
;
const
int
portion
=
min
(
s_counter,
(
uint
)(
get_local_size
(
0
)
>>
3
))
;
pos.x
=
pos.y
=
0
;
while
(
s_counter
>
0
&&
s_counter
<=
stack_size
-
get_local_size
(
0
))
{
const
int
subTaskIdx
=
lidx
>>
3
;
const
int
portion
=
min
(
s_counter,
(
uint
)(
get_local_size
(
0
)
>>
3
))
;
if
(
subTaskIdx
<
portion
)
if
(
subTaskIdx
<
portion
)
pos
=
s_st[s_counter
-
1
-
subTaskIdx]
;
pos
=
s_st[s_counter
-
1
-
subTaskIdx]
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
lidx
==
0
)
if
(
lidx
==
0
)
s_counter
-=
portion
;
s_counter
-=
portion
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
pos.x
>
0
&&
pos.x
<=
cols
&&
pos.y
>
0
&&
pos.y
<=
rows
)
if
(
subTaskIdx
<
portion
)
{
pos.x
+=
c_dx[lidx
&
7]
;
pos.y
+=
c_dy[lidx
&
7]
;
if
(
pos.x
>
0
&&
pos.x
<=
cols
&&
pos.y
>
0
&&
pos.y
<=
rows
&&
map[pos.x
+
pos.y
*
map_step]
==
1
)
{
{
pos.x
+=
c_dx[lidx
&
7]
;
map[pos.x
+
pos.y
*
map_step]
=
2
;
pos.y
+=
c_dy[lidx
&
7]
;
if
(
map[pos.x
+
pos.y
*
map_step]
==
1
)
{
map[pos.x
+
pos.y
*
map_step]
=
2
;
ind
=
atomic_inc
(
&s_counter
)
;
ind
=
atomic_inc
(
&s_counter
)
;
s_st[ind]
=
pos
;
s_st[ind]
=
pos
;
}
}
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
if
(
s_counter
>
0
)
if
(
s_counter
>
0
)
{
if
(
lidx
==
0
)
{
{
if
(
lidx
==
0
)
ind
=
atomic_add
(
counter,
s_counter
)
;
{
s_ind
=
ind
-
s_counter
;
ind
=
atomic_add
(
counter,
s_counter
)
;
}
s_ind
=
ind
-
s_counter
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
ind
=
s_ind
;
ind
=
s_ind
;
for
(
int
i
=
lidx
; i < s_counter; i += get_local_size(0))
for
(
int
i
=
lidx
; i < s_counter; i += get_local_size(0))
{
{
st2[ind
+
i]
=
s_st[i]
;
st2[ind
+
i]
=
s_st[i]
;
}
}
}
}
}
}
}
...
...
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