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
13bfcd64
Commit
13bfcd64
authored
Oct 08, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sanity checks in improc perf tests
parent
a3ab6d14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
77 deletions
+80
-77
perf_goodFeaturesToTrack.cpp
modules/imgproc/perf/perf_goodFeaturesToTrack.cpp
+6
-3
perf_remap.cpp
modules/imgproc/perf/perf_remap.cpp
+69
-71
perf_warp.cpp
modules/imgproc/perf/perf_warp.cpp
+5
-3
No files found.
modules/imgproc/perf/perf_goodFeaturesToTrack.cpp
View file @
13bfcd64
...
...
@@ -15,7 +15,7 @@ PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_UseHarris, goodF
testing
::
Values
(
100
,
500
),
testing
::
Values
(
0.1
,
0.01
),
testing
::
Values
(
3
,
5
),
testing
::
Bool
()
testing
::
Bool
()
)
)
{
...
...
@@ -28,11 +28,14 @@ PERF_TEST_P(Image_MaxCorners_QualityLevel_MinDistance_BlockSize_UseHarris, goodF
Mat
image
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
if
(
image
.
empty
())
FAIL
()
<<
"Unable to load source image"
<<
filename
;
std
::
vector
<
Point2f
>
corners
;
double
minDistance
=
1
;
TEST_CYCLE
()
goodFeaturesToTrack
(
image
,
corners
,
maxCorners
,
qualityLevel
,
minDistance
,
noArray
(),
blockSize
,
useHarrisDetector
);
//SANITY_CHECK(corners);
if
(
corners
.
size
()
>
50
)
corners
.
erase
(
corners
.
begin
()
+
50
,
corners
.
end
());
SANITY_CHECK
(
corners
);
}
modules/imgproc/perf/perf_remap.cpp
View file @
13bfcd64
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
using
namespace
testing
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
CV_ENUM
(
MatrixType
,
CV_16UC1
,
CV_16SC1
,
CV_32FC1
)
CV_ENUM
(
MapType
,
CV_16SC2
,
CV_32FC1
,
CV_32FC2
)
CV_ENUM
(
InterType
,
INTER_NEAREST
,
INTER_LINEAR
,
INTER_CUBIC
,
INTER_LANCZOS4
)
typedef
TestBaseWithParam
<
tr1
::
tuple
<
Size
,
MatrixType
,
MapType
,
InterType
>
>
TestRemap
;
PERF_TEST_P
(
TestRemap
,
Remap
,
Combine
(
Values
(
szVGA
,
sz1080p
),
ValuesIn
(
MatrixType
::
all
()
),
ValuesIn
(
MapType
::
all
()
),
ValuesIn
(
InterType
::
all
()
)
)
)
{
Size
sz
;
int
src_type
,
map1_type
,
inter_type
;
sz
=
get
<
0
>
(
GetParam
());
src_type
=
get
<
1
>
(
GetParam
());
map1_type
=
get
<
2
>
(
GetParam
());
inter_type
=
get
<
3
>
(
GetParam
());
Mat
src
(
sz
,
src_type
),
dst
(
sz
,
src_type
),
map1
(
sz
,
map1_type
),
map2
;
if
(
map1_type
==
CV_32FC1
)
map2
.
create
(
sz
,
CV_32FC1
);
else
if
(
inter_type
!=
INTER_NEAREST
&&
map1_type
==
CV_16SC2
)
{
map2
.
create
(
sz
,
CV_16UC1
);
map2
=
Scalar
::
all
(
0
);
}
RNG
rng
;
rng
.
fill
(
src
,
RNG
::
UNIFORM
,
0
,
256
);
for
(
int
j
=
0
;
j
<
map1
.
rows
;
++
j
)
for
(
int
i
=
0
;
i
<
map1
.
cols
;
++
i
)
switch
(
map1_type
)
{
case
CV_32FC1
:
map1
.
at
<
float
>
(
j
,
i
)
=
static_cast
<
float
>
(
src
.
cols
-
i
-
1
);
map2
.
at
<
float
>
(
j
,
i
)
=
static_cast
<
float
>
(
j
);
break
;
case
CV_32FC2
:
map1
.
at
<
Vec2f
>
(
j
,
i
)[
0
]
=
static_cast
<
float
>
(
src
.
cols
-
i
-
1
);
map1
.
at
<
Vec2f
>
(
j
,
i
)[
1
]
=
static_cast
<
float
>
(
j
);
break
;
case
CV_16SC2
:
map1
.
at
<
Vec2s
>
(
j
,
i
)[
0
]
=
static_cast
<
short
>
(
src
.
cols
-
i
-
1
);
map1
.
at
<
Vec2s
>
(
j
,
i
)[
1
]
=
static_cast
<
short
>
(
j
);
break
;
default
:
CV_Assert
(
0
);
}
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
).
time
(
20
);
TEST_CYCLE
()
remap
(
src
,
dst
,
map1
,
map2
,
inter_type
);
SANITY_CHECK
(
dst
);
}
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
using
namespace
testing
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
CV_ENUM
(
InterType
,
INTER_NEAREST
,
INTER_LINEAR
,
INTER_CUBIC
,
INTER_LANCZOS4
)
typedef
TestBaseWithParam
<
tr1
::
tuple
<
Size
,
MatType
,
MatType
,
InterType
>
>
TestRemap
;
PERF_TEST_P
(
TestRemap
,
Remap
,
Combine
(
Values
(
szVGA
,
sz1080p
),
Values
(
CV_16UC1
,
CV_16SC1
,
CV_32FC1
),
Values
(
CV_16SC2
,
CV_32FC1
,
CV_32FC2
),
ValuesIn
(
InterType
::
all
()
)
)
)
{
Size
sz
;
int
src_type
,
map1_type
,
inter_type
;
sz
=
get
<
0
>
(
GetParam
());
src_type
=
get
<
1
>
(
GetParam
());
map1_type
=
get
<
2
>
(
GetParam
());
inter_type
=
get
<
3
>
(
GetParam
());
Mat
src
(
sz
,
src_type
),
dst
(
sz
,
src_type
),
map1
(
sz
,
map1_type
),
map2
;
if
(
map1_type
==
CV_32FC1
)
map2
.
create
(
sz
,
CV_32FC1
);
else
if
(
inter_type
!=
INTER_NEAREST
&&
map1_type
==
CV_16SC2
)
{
map2
.
create
(
sz
,
CV_16UC1
);
map2
=
Scalar
::
all
(
0
);
}
RNG
rng
;
rng
.
fill
(
src
,
RNG
::
UNIFORM
,
0
,
256
);
for
(
int
j
=
0
;
j
<
map1
.
rows
;
++
j
)
for
(
int
i
=
0
;
i
<
map1
.
cols
;
++
i
)
switch
(
map1_type
)
{
case
CV_32FC1
:
map1
.
at
<
float
>
(
j
,
i
)
=
static_cast
<
float
>
(
src
.
cols
-
i
-
1
);
map2
.
at
<
float
>
(
j
,
i
)
=
static_cast
<
float
>
(
j
);
break
;
case
CV_32FC2
:
map1
.
at
<
Vec2f
>
(
j
,
i
)[
0
]
=
static_cast
<
float
>
(
src
.
cols
-
i
-
1
);
map1
.
at
<
Vec2f
>
(
j
,
i
)[
1
]
=
static_cast
<
float
>
(
j
);
break
;
case
CV_16SC2
:
map1
.
at
<
Vec2s
>
(
j
,
i
)[
0
]
=
static_cast
<
short
>
(
src
.
cols
-
i
-
1
);
map1
.
at
<
Vec2s
>
(
j
,
i
)[
1
]
=
static_cast
<
short
>
(
j
);
break
;
default
:
CV_Assert
(
0
);
}
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
).
time
(
20
);
TEST_CYCLE
()
remap
(
src
,
dst
,
map1
,
map2
,
inter_type
);
SANITY_CHECK
(
dst
);
}
modules/imgproc/perf/perf_warp.cpp
View file @
13bfcd64
...
...
@@ -9,9 +9,9 @@ using std::tr1::get;
enum
{
HALF_SIZE
=
0
,
UPSIDE_DOWN
,
REFLECTION_X
,
REFLECTION_BOTH
};
CV_ENUM
(
BorderMode
,
BORDER_CONSTANT
,
BORDER_REPLICATE
)
;
CV_ENUM
(
InterType
,
INTER_NEAREST
,
INTER_LINEAR
)
;
CV_ENUM
(
RemapMode
,
HALF_SIZE
,
UPSIDE_DOWN
,
REFLECTION_X
,
REFLECTION_BOTH
)
;
CV_ENUM
(
BorderMode
,
BORDER_CONSTANT
,
BORDER_REPLICATE
)
CV_ENUM
(
InterType
,
INTER_NEAREST
,
INTER_LINEAR
)
CV_ENUM
(
RemapMode
,
HALF_SIZE
,
UPSIDE_DOWN
,
REFLECTION_X
,
REFLECTION_BOTH
)
typedef
TestBaseWithParam
<
tr1
::
tuple
<
Size
,
InterType
,
BorderMode
>
>
TestWarpAffine
;
typedef
TestBaseWithParam
<
tr1
::
tuple
<
Size
,
InterType
,
BorderMode
>
>
TestWarpPerspective
;
...
...
@@ -164,5 +164,7 @@ PERF_TEST(Transform, getPerspectiveTransform)
{
transformCoefficient
=
getPerspectiveTransform
(
source
,
destination
);
}
SANITY_CHECK
(
transformCoefficient
,
1e-5
);
}
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