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
e6f7e4d8
Commit
e6f7e4d8
authored
Jul 02, 2012
by
Marina Kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPU resize became same as CPU implementation
parent
60b73e74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
filters.hpp
modules/gpu/src/opencv2/gpu/device/filters.hpp
+1
-1
interpolation.hpp
modules/gpu/test/interpolation.hpp
+1
-1
test_resize.cpp
modules/gpu/test/test_resize.cpp
+23
-1
No files found.
modules/gpu/src/opencv2/gpu/device/filters.hpp
View file @
e6f7e4d8
...
@@ -64,7 +64,7 @@ namespace cv { namespace gpu { namespace device
...
@@ -64,7 +64,7 @@ namespace cv { namespace gpu { namespace device
__device__
__forceinline__
elem_type
operator
()(
float
y
,
float
x
)
const
__device__
__forceinline__
elem_type
operator
()(
float
y
,
float
x
)
const
{
{
return
src
(
__float2int_r
n
(
y
),
__float2int_rn
(
x
));
return
src
(
__float2int_r
z
(
y
),
__float2int_rz
(
x
));
}
}
const
Ptr2D
src
;
const
Ptr2D
src
;
...
...
modules/gpu/test/interpolation.hpp
View file @
e6f7e4d8
...
@@ -54,7 +54,7 @@ template <typename T> struct NearestInterpolator
...
@@ -54,7 +54,7 @@ template <typename T> struct NearestInterpolator
{
{
static
T
getValue
(
const
cv
::
Mat
&
src
,
float
y
,
float
x
,
int
c
,
int
border_type
,
cv
::
Scalar
borderVal
=
cv
::
Scalar
())
static
T
getValue
(
const
cv
::
Mat
&
src
,
float
y
,
float
x
,
int
c
,
int
border_type
,
cv
::
Scalar
borderVal
=
cv
::
Scalar
())
{
{
return
readVal
<
T
>
(
src
,
cvRound
(
y
),
cvRound
(
x
),
c
,
border_type
,
borderVal
);
return
readVal
<
T
>
(
src
,
int
(
y
),
int
(
x
),
c
,
border_type
,
borderVal
);
}
}
};
};
...
...
modules/gpu/test/test_resize.cpp
View file @
e6f7e4d8
...
@@ -160,7 +160,7 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Resize, testing::Combine(
...
@@ -160,7 +160,7 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Resize, testing::Combine(
/////////////////
/////////////////
PARAM_TEST_CASE
(
Resize
Area
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
,
MatType
,
double
,
Interpolation
,
UseRoi
)
PARAM_TEST_CASE
(
Resize
SameAsHost
,
cv
::
gpu
::
DeviceInfo
,
cv
::
Size
,
MatType
,
double
,
Interpolation
,
UseRoi
)
{
{
cv
::
gpu
::
DeviceInfo
devInfo
;
cv
::
gpu
::
DeviceInfo
devInfo
;
cv
::
Size
size
;
cv
::
Size
size
;
...
@@ -182,6 +182,28 @@ PARAM_TEST_CASE(ResizeArea, cv::gpu::DeviceInfo, cv::Size, MatType, double, Inte
...
@@ -182,6 +182,28 @@ PARAM_TEST_CASE(ResizeArea, cv::gpu::DeviceInfo, cv::Size, MatType, double, Inte
}
}
};
};
// downscaling only: used for classifiers
TEST_P
(
ResizeSameAsHost
,
Accuracy
)
{
cv
::
Mat
src
=
randomMat
(
size
,
type
);
cv
::
gpu
::
GpuMat
dst
=
createMat
(
cv
::
Size
(
cv
::
saturate_cast
<
int
>
(
src
.
cols
*
coeff
),
cv
::
saturate_cast
<
int
>
(
src
.
rows
*
coeff
)),
type
,
useRoi
);
cv
::
gpu
::
resize
(
loadMat
(
src
,
useRoi
),
dst
,
cv
::
Size
(),
coeff
,
coeff
,
interpolation
);
cv
::
Mat
dst_gold
;
cv
::
resize
(
src
,
dst_gold
,
cv
::
Size
(),
coeff
,
coeff
,
interpolation
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
src
.
depth
()
==
CV_32F
?
1e-2
:
1.0
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_ImgProc
,
ResizeSameAsHost
,
testing
::
Combine
(
ALL_DEVICES
,
DIFFERENT_SIZES
,
testing
::
Values
(
MatType
(
CV_8UC3
),
MatType
(
CV_16UC1
),
MatType
(
CV_16UC3
),
MatType
(
CV_16UC4
),
MatType
(
CV_32FC1
),
MatType
(
CV_32FC3
),
MatType
(
CV_32FC4
)),
testing
::
Values
(
0.3
,
0.5
),
testing
::
Values
(
Interpolation
(
cv
::
INTER_AREA
),
Interpolation
(
cv
::
INTER_NEAREST
)),
//, Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)
WHOLE_SUBMAT
));
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// Test NPP
// Test NPP
...
...
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