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
a8079366
Commit
a8079366
authored
Feb 02, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed gpu image resize test
parent
12f73aa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
imgproc_gpu.cpp
tests/gpu/src/imgproc_gpu.cpp
+28
-7
No files found.
tests/gpu/src/imgproc_gpu.cpp
View file @
a8079366
...
@@ -64,7 +64,8 @@ protected:
...
@@ -64,7 +64,8 @@ protected:
virtual
int
test
(
const
Mat
&
img
)
=
0
;
virtual
int
test
(
const
Mat
&
img
)
=
0
;
int
CheckNorm
(
const
Mat
&
m1
,
const
Mat
&
m2
);
int
CheckNorm
(
const
Mat
&
m1
,
const
Mat
&
m2
);
int
ChechSimilarity
(
const
Mat
&
m1
,
const
Mat
&
m2
);
};
};
...
@@ -117,6 +118,19 @@ int CV_GpuImageProcTest::CheckNorm(const Mat& m1, const Mat& m2)
...
@@ -117,6 +118,19 @@ int CV_GpuImageProcTest::CheckNorm(const Mat& m1, const Mat& m2)
}
}
}
}
int
CV_GpuImageProcTest
::
ChechSimilarity
(
const
Mat
&
m1
,
const
Mat
&
m2
)
{
Mat
diff
;
cv
::
matchTemplate
(
m1
,
m2
,
diff
,
CV_TM_CCORR_NORMED
);
float
err
=
abs
(
diff
.
at
<
float
>
(
0
,
0
)
-
1.
f
);
if
(
err
>
1e-3
f
)
return
CvTS
::
FAIL_INVALID_OUTPUT
;
return
CvTS
::
OK
;
}
void
CV_GpuImageProcTest
::
run
(
int
)
void
CV_GpuImageProcTest
::
run
(
int
)
{
{
//load image
//load image
...
@@ -241,14 +255,21 @@ struct CV_GpuNppImageResizeTest : public CV_GpuImageProcTest
...
@@ -241,14 +255,21 @@ struct CV_GpuNppImageResizeTest : public CV_GpuImageProcTest
{
{
ts
->
printf
(
CvTS
::
LOG
,
"Interpolation: %s
\n
"
,
interpolations_str
[
i
]);
ts
->
printf
(
CvTS
::
LOG
,
"Interpolation: %s
\n
"
,
interpolations_str
[
i
]);
Mat
cpu_res
;
Mat
cpu_res1
,
cpu_res2
;
cv
::
resize
(
img
,
cpu_res
,
Size
(),
0.5
,
0.5
,
interpolations
[
i
]);
cv
::
resize
(
img
,
cpu_res1
,
Size
(),
2.0
,
2.0
,
interpolations
[
i
]);
cv
::
resize
(
cpu_res1
,
cpu_res2
,
Size
(),
0.5
,
0.5
,
interpolations
[
i
]);
GpuMat
gpu1
(
img
),
gpu_res
;
GpuMat
gpu1
(
img
),
gpu_res1
,
gpu_res2
;
cv
::
gpu
::
resize
(
gpu1
,
gpu_res
,
Size
(),
0.5
,
0.5
,
interpolations
[
i
]);
cv
::
gpu
::
resize
(
gpu1
,
gpu_res1
,
Size
(),
2.0
,
2.0
,
interpolations
[
i
]);
cv
::
gpu
::
resize
(
gpu_res1
,
gpu_res2
,
Size
(),
0.5
,
0.5
,
interpolations
[
i
]);
if
(
CheckNorm
(
cpu_res
,
gpu_res
)
!=
CvTS
::
OK
)
switch
(
img
.
depth
())
test_res
=
CvTS
::
FAIL_GENERIC
;
{
case
CV_8U
:
if
(
ChechSimilarity
(
cpu_res2
,
gpu_res2
)
!=
CvTS
::
OK
)
test_res
=
CvTS
::
FAIL_GENERIC
;
break
;
}
}
}
return
test_res
;
return
test_res
;
...
...
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