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
44fbfb2c
Commit
44fbfb2c
authored
Aug 06, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed extrapolation in pyrDown
parent
2a0b39d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
pyr_down.cl
modules/imgproc/src/opencl/pyr_down.cl
+3
-3
test_pyramids.cpp
modules/imgproc/test/ocl/test_pyramids.cpp
+1
-2
No files found.
modules/imgproc/src/opencl/pyr_down.cl
View file @
44fbfb2c
...
...
@@ -53,16 +53,16 @@
#
if
defined
BORDER_REPLICATE
//
aaaaaa|abcdefgh|hhhhhhh
#
define
EXTRAPOLATE
(
x,
maxV
)
clamp
(
x,
0
,
maxV
-1
)
#
define
EXTRAPOLATE
(
x,
maxV
)
clamp
(
(
x
)
,
0
,
(
maxV
)
-1
)
#
elif
defined
BORDER_WRAP
//
cdefgh|abcdefgh|abcdefg
#
define
EXTRAPOLATE
(
x,
maxV
)
(
(
x
)
+
(
maxV
)
)
%
(
maxV
)
#
elif
defined
BORDER_REFLECT
//
fedcba|abcdefgh|hgfedcb
#
define
EXTRAPOLATE
(
x,
maxV
)
min
(((
maxV
)
-1
)
*2-
(
x
)
+1
,
max
((
x
)
,
-
(
x
)
-1
)
)
#
define
EXTRAPOLATE
(
x,
maxV
)
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
)
min
(((
maxV
)
-1
)
*2-
(
x
)
,
max
((
x
)
,
-
(
x
))
)
#
define
EXTRAPOLATE
(
x,
maxV
)
clamp
(
min
(((
maxV
)
-1
)
*2-
(
x
)
,
max
((
x
)
,
-
(
x
))
)
,
0
,
(
maxV
)
-1
)
#
else
#
error
No
extrapolation
method
#
endif
...
...
modules/imgproc/test/ocl/test_pyramids.cpp
View file @
44fbfb2c
...
...
@@ -94,8 +94,7 @@ OCL_TEST_P(PyrDown, Mat)
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
{
// minimal src size is set to 4 since size<4 doesn't make sense
Size
src_roiSize
=
randomSize
(
4
,
MAX_VALUE
);
Size
src_roiSize
=
randomSize
(
1
,
MAX_VALUE
);
Size
dst_roiSize
=
Size
(
randomInt
((
src_roiSize
.
width
-
1
)
/
2
,
(
src_roiSize
.
width
+
3
)
/
2
),
randomInt
((
src_roiSize
.
height
-
1
)
/
2
,
(
src_roiSize
.
height
+
3
)
/
2
));
dst_roiSize
=
dst_roiSize
.
area
()
==
0
?
Size
((
src_roiSize
.
width
+
1
)
/
2
,
(
src_roiSize
.
height
+
1
)
/
2
)
:
dst_roiSize
;
...
...
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