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
3727168b
Commit
3727168b
authored
Nov 08, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a performance test for ocl::buildWarpPerspectiveMaps; moved warps to a separate file
parent
8b57893e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
196 deletions
+2
-196
perf_imgproc.cpp
modules/ocl/perf/perf_imgproc.cpp
+0
-194
perf_imgwarp.cpp
modules/ocl/perf/perf_imgwarp.cpp
+0
-0
test_warp.cpp
modules/ocl/test/test_warp.cpp
+2
-2
No files found.
modules/ocl/perf/perf_imgproc.cpp
View file @
3727168b
...
...
@@ -231,139 +231,6 @@ PERF_TEST_P(integralFixture, integral, OCL_TYPICAL_MAT_SIZES)
OCL_PERF_ELSE
}
///////////// WarpAffine ////////////////////////
typedef
Size_MatType
WarpAffineFixture
;
PERF_TEST_P
(
WarpAffineFixture
,
WarpAffine
,
::
testing
::
Combine
(
OCL_TYPICAL_MAT_SIZES
,
OCL_PERF_ENUM
(
CV_8UC1
,
CV_8UC4
)))
{
static
const
double
coeffs
[
2
][
3
]
=
{
{
cos
(
CV_PI
/
6
),
-
sin
(
CV_PI
/
6
),
100.0
},
{
sin
(
CV_PI
/
6
),
cos
(
CV_PI
/
6
),
-
100.0
}
};
Mat
M
(
2
,
3
,
CV_64F
,
(
void
*
)
coeffs
);
const
int
interpolation
=
INTER_NEAREST
;
const
Size_MatType_t
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
);
Mat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
if
(
RUN_OCL_IMPL
)
{
ocl
::
oclMat
oclSrc
(
src
),
oclDst
(
srcSize
,
type
);
OCL_TEST_CYCLE
()
cv
::
ocl
::
warpAffine
(
oclSrc
,
oclDst
,
M
,
srcSize
,
interpolation
);
oclDst
.
download
(
dst
);
SANITY_CHECK
(
dst
);
}
else
if
(
RUN_PLAIN_IMPL
)
{
TEST_CYCLE
()
cv
::
warpAffine
(
src
,
dst
,
M
,
srcSize
,
interpolation
);
SANITY_CHECK
(
dst
);
}
else
OCL_PERF_ELSE
}
///////////// WarpPerspective ////////////////////////
typedef
Size_MatType
WarpPerspectiveFixture
;
PERF_TEST_P
(
WarpPerspectiveFixture
,
WarpPerspective
,
::
testing
::
Combine
(
OCL_TYPICAL_MAT_SIZES
,
OCL_PERF_ENUM
(
CV_8UC1
,
CV_8UC4
)))
{
static
const
double
coeffs
[
3
][
3
]
=
{
{
cos
(
CV_PI
/
6
),
-
sin
(
CV_PI
/
6
),
100.0
},
{
sin
(
CV_PI
/
6
),
cos
(
CV_PI
/
6
),
-
100.0
},
{
0.0
,
0.0
,
1.0
}
};
Mat
M
(
3
,
3
,
CV_64F
,
(
void
*
)
coeffs
);
const
int
interpolation
=
INTER_LINEAR
;
const
Size_MatType_t
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
);
Mat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
)
.
time
(
srcSize
==
OCL_SIZE_4000
?
18
:
srcSize
==
OCL_SIZE_2000
?
5
:
2
);
if
(
RUN_OCL_IMPL
)
{
ocl
::
oclMat
oclSrc
(
src
),
oclDst
(
srcSize
,
type
);
OCL_TEST_CYCLE
()
cv
::
ocl
::
warpPerspective
(
oclSrc
,
oclDst
,
M
,
srcSize
,
interpolation
);
oclDst
.
download
(
dst
);
SANITY_CHECK
(
dst
);
}
else
if
(
RUN_PLAIN_IMPL
)
{
TEST_CYCLE
()
cv
::
warpPerspective
(
src
,
dst
,
M
,
srcSize
,
interpolation
);
SANITY_CHECK
(
dst
);
}
else
OCL_PERF_ELSE
}
///////////// resize ////////////////////////
CV_ENUM
(
resizeInterType
,
INTER_NEAREST
,
INTER_LINEAR
)
typedef
tuple
<
Size
,
MatType
,
resizeInterType
,
double
>
resizeParams
;
typedef
TestBaseWithParam
<
resizeParams
>
resizeFixture
;
PERF_TEST_P
(
resizeFixture
,
resize
,
::
testing
::
Combine
(
OCL_TYPICAL_MAT_SIZES
,
OCL_PERF_ENUM
(
CV_8UC1
,
CV_8UC4
),
resizeInterType
::
all
(),
::
testing
::
Values
(
0.5
,
2.0
)))
{
const
resizeParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
interType
=
get
<
2
>
(
params
);
double
scale
=
get
<
3
>
(
params
);
Mat
src
(
srcSize
,
type
),
dst
;
const
Size
dstSize
(
cvRound
(
srcSize
.
width
*
scale
),
cvRound
(
srcSize
.
height
*
scale
));
dst
.
create
(
dstSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
if
(
interType
==
INTER_LINEAR
&&
type
==
CV_8UC4
&&
OCL_SIZE_4000
==
srcSize
)
declare
.
time
(
11
);
if
(
RUN_OCL_IMPL
)
{
ocl
::
oclMat
oclSrc
(
src
),
oclDst
(
dstSize
,
type
);
OCL_TEST_CYCLE
()
cv
::
ocl
::
resize
(
oclSrc
,
oclDst
,
Size
(),
scale
,
scale
,
interType
);
oclDst
.
download
(
dst
);
SANITY_CHECK
(
dst
,
1
+
DBL_EPSILON
);
}
else
if
(
RUN_PLAIN_IMPL
)
{
TEST_CYCLE
()
cv
::
resize
(
src
,
dst
,
Size
(),
scale
,
scale
,
interType
);
SANITY_CHECK
(
dst
,
1
+
DBL_EPSILON
);
}
else
OCL_PERF_ELSE
}
///////////// threshold////////////////////////
CV_ENUM
(
ThreshType
,
THRESH_BINARY
,
THRESH_TOZERO_INV
)
...
...
@@ -727,67 +594,6 @@ PERF_TEST_P(meanShiftProcFixture, meanShiftProc,
OCL_PERF_ELSE
}
///////////// remap////////////////////////
CV_ENUM
(
RemapInterType
,
INTER_NEAREST
,
INTER_LINEAR
)
typedef
tuple
<
Size
,
MatType
,
RemapInterType
>
remapParams
;
typedef
TestBaseWithParam
<
remapParams
>
remapFixture
;
PERF_TEST_P
(
remapFixture
,
remap
,
::
testing
::
Combine
(
OCL_TYPICAL_MAT_SIZES
,
OCL_PERF_ENUM
(
CV_8UC1
,
CV_8UC4
),
RemapInterType
::
all
()))
{
const
remapParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
interpolation
=
get
<
2
>
(
params
);
Mat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
if
(
srcSize
==
OCL_SIZE_4000
&&
interpolation
==
INTER_LINEAR
)
declare
.
time
(
9
);
Mat
xmap
,
ymap
;
xmap
.
create
(
srcSize
,
CV_32FC1
);
ymap
.
create
(
srcSize
,
CV_32FC1
);
for
(
int
i
=
0
;
i
<
srcSize
.
height
;
++
i
)
{
float
*
const
xmap_row
=
xmap
.
ptr
<
float
>
(
i
);
float
*
const
ymap_row
=
ymap
.
ptr
<
float
>
(
i
);
for
(
int
j
=
0
;
j
<
srcSize
.
width
;
++
j
)
{
xmap_row
[
j
]
=
(
j
-
srcSize
.
width
*
0.5
f
)
*
0.75
f
+
srcSize
.
width
*
0.5
f
;
ymap_row
[
j
]
=
(
i
-
srcSize
.
height
*
0.5
f
)
*
0.75
f
+
srcSize
.
height
*
0.5
f
;
}
}
const
int
borderMode
=
BORDER_CONSTANT
;
if
(
RUN_OCL_IMPL
)
{
ocl
::
oclMat
oclSrc
(
src
),
oclDst
(
srcSize
,
type
);
ocl
::
oclMat
oclXMap
(
xmap
),
oclYMap
(
ymap
);
OCL_TEST_CYCLE
()
cv
::
ocl
::
remap
(
oclSrc
,
oclDst
,
oclXMap
,
oclYMap
,
interpolation
,
borderMode
);
oclDst
.
download
(
dst
);
SANITY_CHECK
(
dst
,
1
+
DBL_EPSILON
);
}
else
if
(
RUN_PLAIN_IMPL
)
{
TEST_CYCLE
()
cv
::
remap
(
src
,
dst
,
xmap
,
ymap
,
interpolation
,
borderMode
);
SANITY_CHECK
(
dst
,
1
+
DBL_EPSILON
);
}
else
OCL_PERF_ELSE
}
///////////// CLAHE ////////////////////////
typedef
TestBaseWithParam
<
Size
>
CLAHEFixture
;
...
...
modules/ocl/perf/perf_imgwarp.cpp
0 → 100644
View file @
3727168b
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_warp.cpp
View file @
3727168b
...
...
@@ -259,8 +259,8 @@ OCL_TEST_P(BuildWarpPerspectiveMaps, Mat)
buildWarpPerspectiveMaps
(
M
,
mapInverse
,
dsize
,
xmap_roi
,
ymap_roi
);
ocl
::
buildWarpPerspectiveMaps
(
M
,
mapInverse
,
dsize
,
gxmap_roi
,
gymap_roi
);
Near
(
1e-6
);
Near1
(
1e-6
);
Near
(
5e-3
);
Near1
(
5e-3
);
}
}
...
...
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