Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
a8b1abcb
Commit
a8b1abcb
authored
Jun 09, 2015
by
Seon-Wook Park
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic perf tests for grayworld
parent
dea8aae2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
7 deletions
+58
-7
perf_grayworld.cpp
modules/xphoto/perf/perf_grayworld.cpp
+29
-0
perf_main.cpp
modules/xphoto/perf/perf_main.cpp
+3
-0
perf_precomp.hpp
modules/xphoto/perf/perf_precomp.hpp
+19
-0
grayworld_white_balance.cpp
modules/xphoto/src/grayworld_white_balance.cpp
+7
-7
No files found.
modules/xphoto/perf/perf_grayworld.cpp
0 → 100644
View file @
a8b1abcb
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
typedef
std
::
tr1
::
tuple
<
Size
,
float
>
Size_WBThresh_t
;
typedef
perf
::
TestBaseWithParam
<
Size_WBThresh_t
>
Size_WBThresh
;
PERF_TEST_P
(
Size_WBThresh
,
autowbGrayworld
,
testing
::
Combine
(
testing
::
Values
(
TYPICAL_MAT_SIZES
),
testing
::
Values
(
0.1
,
0.5
,
1.0
)
)
)
{
Size
size
=
std
::
tr1
::
get
<
0
>
(
GetParam
());
float
wb_thresh
=
std
::
tr1
::
get
<
1
>
(
GetParam
());
Mat
src
(
size
,
CV_8UC3
);
Mat
dst
(
size
,
CV_8UC3
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
TEST_CYCLE
()
xphoto
::
autowbGrayworld
(
src
,
dst
,
wb_thresh
);
SANITY_CHECK
(
dst
);
}
modules/xphoto/perf/perf_main.cpp
0 → 100644
View file @
a8b1abcb
#include "perf_precomp.hpp"
CV_PERF_TEST_MAIN
(
xphoto
)
modules/xphoto/perf/perf_precomp.hpp
0 → 100644
View file @
a8b1abcb
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wmissing-declarations"
# if defined __clang__ || defined __APPLE__
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
# pragma GCC diagnostic ignored "-Wextra"
# endif
#endif
#ifndef __OPENCV_PERF_PRECOMP_HPP__
#define __OPENCV_PERF_PRECOMP_HPP__
#include "opencv2/ts.hpp"
#include "opencv2/xphoto.hpp"
#ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif
#endif
modules/xphoto/src/grayworld_white_balance.cpp
View file @
a8b1abcb
...
...
@@ -67,7 +67,7 @@ namespace cv { namespace xphoto {
// Calculate sum of pixel values of each channel
const
uchar
*
src_data
=
src
.
ptr
<
uchar
>
(
0
);
ulong
sum1
=
0
,
sum2
=
0
,
sum3
=
0
;
u
nsigned
long
sum1
=
0
,
sum2
=
0
,
sum3
=
0
;
int
i
=
0
;
#if CV_SIMD128
v_uint8x16
v_inB
,
v_inG
,
v_inR
;
...
...
@@ -165,9 +165,9 @@ namespace cv { namespace xphoto {
// Scale by maximum
if
(
inv_max
>
0
)
{
inv1
/=
inv_max
;
inv2
/=
inv_max
;
inv3
/=
inv_max
;
inv1
=
(
float
)((
double
)
inv1
/
inv_max
)
;
inv2
=
(
float
)((
double
)
inv2
/
inv_max
)
;
inv3
=
(
float
)((
double
)
inv3
/
inv_max
)
;
}
// Scale input pixel values
...
...
@@ -225,9 +225,9 @@ namespace cv { namespace xphoto {
#endif
for
(
;
i
<
N3
;
i
+=
3
)
{
dst_data
[
i
+
0
]
=
src_data
[
i
+
0
]
*
inv1
;
dst_data
[
i
+
1
]
=
src_data
[
i
+
1
]
*
inv2
;
dst_data
[
i
+
2
]
=
src_data
[
i
+
2
]
*
inv3
;
dst_data
[
i
+
0
]
=
(
uchar
)(
src_data
[
i
+
0
]
*
inv1
)
;
dst_data
[
i
+
1
]
=
(
uchar
)(
src_data
[
i
+
1
]
*
inv2
)
;
dst_data
[
i
+
2
]
=
(
uchar
)(
src_data
[
i
+
2
]
*
inv3
)
;
}
}
...
...
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