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
214dab39
Commit
214dab39
authored
Sep 02, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed BORDER_REFLECT and BORDER_REFLECT_101 extrapolation for case x > 2*maxV
parent
a125cd6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
covardata.cl
modules/imgproc/src/opencl/covardata.cl
+3
-3
filterSep_singlePass.cl
modules/imgproc/src/opencl/filterSep_singlePass.cl
+3
-3
laplacian5.cl
modules/imgproc/src/opencl/laplacian5.cl
+3
-3
No files found.
modules/imgproc/src/opencl/covardata.cl
View file @
214dab39
...
...
@@ -16,7 +16,7 @@
//aaaaaa|abcdefgh|hhhhhhh
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
max
(
min
((
x
)
,
(
maxV
)
-
1
)
,
0
)
; \
(
x
)
=
clamp
((
x
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_WRAP
//cdefgh|abcdefgh|abcdefg
...
...
@@ -28,13 +28,13 @@
//fedcba|abcdefgh|hgfedcb
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
min
(
mad24
((
maxV
)
-1
,
2
,
-
(
x
))
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
; \
(
x
)
=
clamp
(
min
(
mad24
((
maxV
)
-1
,
2
,
-
(
x
))
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_REFLECT_101
|
| defined BORDER_REFLECT101
//gfedcb|abcdefgh|gfedcba
#define EXTRAPOLATE(x, maxV) \
{ \
(x) =
min( mad24((maxV)-1,2,-(x)), max((x),-(x))
); \
(x) =
clamp(min( mad24((maxV)-1,2,-(x)), max((x),-(x)) ), 0, (maxV)-1
); \
}
#else
#error No extrapolation method
...
...
modules/imgproc/src/opencl/filterSep_singlePass.cl
View file @
214dab39
...
...
@@ -50,7 +50,7 @@
//
aaaaaa|abcdefgh|hhhhhhh
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
max
(
min
((
x
)
,
(
maxV
)
-
1
)
,
0
)
; \
(
x
)
=
clamp
((
x
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_WRAP
//
cdefgh|abcdefgh|abcdefg
...
...
@@ -62,13 +62,13 @@
//
fedcba|abcdefgh|hgfedcb
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
min
(((
maxV
)
-1
)
*2-
(
x
)
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
; \
(
x
)
=
clamp
(
min
(((
maxV
)
-1
)
*2-
(
x
)
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_REFLECT_101
|
| defined BORDER_REFLECT101
// gfedcb|abcdefgh|gfedcba
#define EXTRAPOLATE(x, maxV) \
{ \
(x) =
min(((maxV)-1)*2-(x), max((x),-(x))
); \
(x) =
clamp(min(((maxV)-1)*2-(x), max((x),-(x)) ), 0, (maxV)-1
); \
}
#else
#error No extrapolation method
...
...
modules/imgproc/src/opencl/laplacian5.cl
View file @
214dab39
...
...
@@ -49,7 +49,7 @@ __kernel void sumConvert(__global const uchar * src1ptr, int src1_step, int src1
//
aaaaaa|abcdefgh|hhhhhhh
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
max
(
min
((
x
)
,
(
maxV
)
-
1
)
,
0
)
; \
(
x
)
=
clamp
((
x
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_WRAP
//
cdefgh|abcdefgh|abcdefg
...
...
@@ -61,13 +61,13 @@ __kernel void sumConvert(__global const uchar * src1ptr, int src1_step, int src1
//
fedcba|abcdefgh|hgfedcb
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
min
(((
maxV
)
-1
)
*2-
(
x
)
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
; \
(
x
)
=
clamp
(
min
(((
maxV
)
-1
)
*2-
(
x
)
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
,
0
,
(
maxV
)
-1
)
; \
}
#
elif
defined
BORDER_REFLECT_101
//
gfedcb|abcdefgh|gfedcba
#
define
EXTRAPOLATE
(
x,
maxV
)
\
{
\
(
x
)
=
min
(((
maxV
)
-1
)
*2-
(
x
)
,
max
((
x
)
,
-
(
x
))
)
; \
(
x
)
=
clamp
(
min
(((
maxV
)
-1
)
*2-
(
x
)
,
max
((
x
)
,
-
(
x
))
)
,
0
,
(
maxV
)
-1
)
; \
}
#
else
#
error
No
extrapolation
method
...
...
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