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
bf8b5ffe
Commit
bf8b5ffe
authored
Aug 26, 2019
by
Vitaly Tuzov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added performance test for StereoBM algorithm
parent
ca7640e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
perf_stereosgbm.cpp
modules/calib3d/perf/perf_stereosgbm.cpp
+32
-8
No files found.
modules/calib3d/perf/perf_stereosgbm.cpp
View file @
bf8b5ffe
...
...
@@ -41,20 +41,18 @@ namespace opencv_test
using
namespace
perf
;
using
namespace
testing
;
static
void
MakeArtificialExample
(
RNG
rng
,
Mat
&
dst_left_view
,
Mat
&
dst_view
);
static
void
MakeArtificialExample
(
Mat
&
dst_left_view
,
Mat
&
dst_view
);
CV_ENUM
(
SGBMModes
,
StereoSGBM
::
MODE_SGBM
,
StereoSGBM
::
MODE_SGBM_3WAY
,
StereoSGBM
::
MODE_HH4
);
typedef
tuple
<
Size
,
int
,
SGBMModes
>
SGBMParams
;
typedef
TestBaseWithParam
<
SGBMParams
>
TestStereoCorresp
;
typedef
TestBaseWithParam
<
SGBMParams
>
TestStereoCorresp
SGBM
;
#ifndef _DEBUG
PERF_TEST_P
(
TestStereoCorresp
,
SGBM
,
Combine
(
Values
(
Size
(
1280
,
720
),
Size
(
640
,
480
)),
Values
(
256
,
128
),
SGBMModes
::
all
())
)
PERF_TEST_P
(
TestStereoCorresp
SGBM
,
SGBM
,
Combine
(
Values
(
Size
(
1280
,
720
),
Size
(
640
,
480
)),
Values
(
256
,
128
),
SGBMModes
::
all
())
)
#else
PERF_TEST_P
(
TestStereoCorresp
,
DISABLED_TooLongInDebug_SGBM
,
Combine
(
Values
(
Size
(
1280
,
720
),
Size
(
640
,
480
)),
Values
(
256
,
128
),
SGBMModes
::
all
())
)
PERF_TEST_P
(
TestStereoCorresp
SGBM
,
DISABLED_TooLongInDebug_SGBM
,
Combine
(
Values
(
Size
(
1280
,
720
),
Size
(
640
,
480
)),
Values
(
256
,
128
),
SGBMModes
::
all
())
)
#endif
{
RNG
rng
(
0
);
SGBMParams
params
=
GetParam
();
Size
sz
=
get
<
0
>
(
params
);
...
...
@@ -65,7 +63,7 @@ PERF_TEST_P( TestStereoCorresp, DISABLED_TooLongInDebug_SGBM, Combine(Values(Siz
Mat
src_right
(
sz
,
CV_8UC3
);
Mat
dst
(
sz
,
CV_16S
);
MakeArtificialExample
(
rng
,
src_left
,
src_right
);
MakeArtificialExample
(
src_left
,
src_right
);
int
wsize
=
3
;
int
P1
=
8
*
src_left
.
channels
()
*
wsize
*
wsize
;
...
...
@@ -78,8 +76,34 @@ PERF_TEST_P( TestStereoCorresp, DISABLED_TooLongInDebug_SGBM, Combine(Values(Siz
SANITY_CHECK
(
dst
,
.01
,
ERROR_RELATIVE
);
}
void
MakeArtificialExample
(
RNG
rng
,
Mat
&
dst_left_view
,
Mat
&
dst_right_view
)
typedef
tuple
<
Size
,
int
>
BMParams
;
typedef
TestBaseWithParam
<
BMParams
>
TestStereoCorrespBM
;
PERF_TEST_P
(
TestStereoCorrespBM
,
BM
,
Combine
(
Values
(
Size
(
1280
,
720
),
Size
(
640
,
480
)),
Values
(
256
,
128
)))
{
BMParams
params
=
GetParam
();
Size
sz
=
get
<
0
>
(
params
);
int
num_disparities
=
get
<
1
>
(
params
);
Mat
src_left
(
sz
,
CV_8UC1
);
Mat
src_right
(
sz
,
CV_8UC1
);
Mat
dst
(
sz
,
CV_16S
);
MakeArtificialExample
(
src_left
,
src_right
);
int
wsize
=
21
;
TEST_CYCLE
()
{
Ptr
<
StereoBM
>
bm
=
StereoBM
::
create
(
num_disparities
,
wsize
);
bm
->
compute
(
src_left
,
src_right
,
dst
);
}
SANITY_CHECK
(
dst
,
.01
,
ERROR_RELATIVE
);
}
void
MakeArtificialExample
(
Mat
&
dst_left_view
,
Mat
&
dst_right_view
)
{
RNG
rng
(
0
);
int
w
=
dst_left_view
.
cols
;
int
h
=
dst_left_view
.
rows
;
...
...
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