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
e2ff0ed1
Commit
e2ff0ed1
authored
Oct 09, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sanity checks to objdetect module perf tests
parent
c146c54b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
perf_cascadeclassifier.cpp
modules/objdetect/perf/perf_cascadeclassifier.cpp
+6
-3
ts_perf.hpp
modules/ts/include/opencv2/ts/ts_perf.hpp
+18
-2
No files found.
modules/objdetect/perf/perf_cascadeclassifier.cpp
View file @
e2ff0ed1
...
@@ -38,17 +38,20 @@ PERF_TEST_P(ImageName_MinSize, CascadeClassifierLBPFrontalFace,
...
@@ -38,17 +38,20 @@ PERF_TEST_P(ImageName_MinSize, CascadeClassifierLBPFrontalFace,
if
(
img
.
empty
())
if
(
img
.
empty
())
FAIL
()
<<
"Can't load source image"
;
FAIL
()
<<
"Can't load source image"
;
vector
<
Rect
>
r
es
;
vector
<
Rect
>
fac
es
;
equalizeHist
(
img
,
img
);
equalizeHist
(
img
,
img
);
declare
.
in
(
img
);
declare
.
in
(
img
);
while
(
next
())
while
(
next
())
{
{
r
es
.
clear
();
fac
es
.
clear
();
startTimer
();
startTimer
();
cc
.
detectMultiScale
(
img
,
r
es
,
1.1
,
3
,
0
,
minSize
);
cc
.
detectMultiScale
(
img
,
fac
es
,
1.1
,
3
,
0
,
minSize
);
stopTimer
();
stopTimer
();
}
}
std
::
sort
(
faces
.
begin
(),
faces
.
end
(),
comparators
::
RectLess
());
SANITY_CHECK
(
faces
);
}
}
modules/ts/include/opencv2/ts/ts_perf.hpp
View file @
e2ff0ed1
...
@@ -473,10 +473,26 @@ int main(int argc, char **argv)\
...
@@ -473,10 +473,26 @@ int main(int argc, char **argv)\
#define TEST_CYCLE() for(; startTimer(), next(); stopTimer())
#define TEST_CYCLE() for(; startTimer(), next(); stopTimer())
#define TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; ++r)
#define TEST_CYCLE_MULTIRUN(runsNum) for(declare.runs(runsNum); startTimer(), next(); stopTimer()) for(int r = 0; r < runsNum; ++r)
//flags
namespace
perf
namespace
perf
{
{
//GTEST_DECLARE_int32_(allowed_outliers);
namespace
comparators
{
template
<
typename
T
>
struct
CV_EXPORTS
RectLess_
{
bool
operator
()(
const
cv
::
Rect_
<
T
>&
r1
,
const
cv
::
Rect_
<
T
>&
r2
)
const
{
return
r1
.
x
<
r2
.
x
||
(
r1
.
x
==
r2
.
x
&&
r1
.
y
<
r2
.
y
)
||
(
r1
.
x
==
r2
.
x
&&
r1
.
y
==
r2
.
y
&&
r1
.
width
<
r2
.
width
)
||
(
r1
.
x
==
r2
.
x
&&
r1
.
y
==
r2
.
y
&&
r1
.
width
==
r2
.
width
&&
r1
.
height
<
r2
.
height
);
}
};
typedef
RectLess_
<
int
>
RectLess
;
}
//namespace comparators
}
//namespace perf
}
//namespace perf
#endif //__OPENCV_TS_PERF_HPP__
#endif //__OPENCV_TS_PERF_HPP__
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