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
5d363e67
Commit
5d363e67
authored
Sep 29, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tegra optimized cvRound; perf test for cvRound; fixed perf test for stitching
parent
3c9979cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
types_c.h
modules/core/include/opencv2/core/types_c.h
+8
-0
perf_core_arithm.cpp
modules/core/perf/perf_core_arithm.cpp
+13
-0
perf_stich.cpp
modules/stitching/perf/perf_stich.cpp
+16
-4
No files found.
modules/core/include/opencv2/core/types_c.h
View file @
5d363e67
...
@@ -259,6 +259,10 @@ enum {
...
@@ -259,6 +259,10 @@ enum {
* Common macros and inline functions *
* Common macros and inline functions *
\****************************************************************************************/
\****************************************************************************************/
#ifdef HAVE_TEGRA_OPTIMIZATION
# include "tegra_round.hpp"
#endif
#define CV_PI 3.1415926535897932384626433832795
#define CV_PI 3.1415926535897932384626433832795
#define CV_LOG2 0.69314718055994530941723212145818
#define CV_LOG2 0.69314718055994530941723212145818
...
@@ -300,7 +304,11 @@ CV_INLINE int cvRound( double value )
...
@@ -300,7 +304,11 @@ CV_INLINE int cvRound( double value )
}
}
return
t
;
return
t
;
#elif defined HAVE_LRINT || defined CV_ICC || defined __GNUC__
#elif defined HAVE_LRINT || defined CV_ICC || defined __GNUC__
# ifdef HAVE_TEGRA_OPTIMIZATION
TEGRA_ROUND
(
value
);
# else
return
(
int
)
lrint
(
value
);
return
(
int
)
lrint
(
value
);
# endif
#else
#else
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation
// while this is not IEEE754-compliant rounding, it's usually a good enough approximation
return
(
int
)(
value
+
(
value
>=
0
?
0
.
5
:
-
0
.
5
));
return
(
int
)(
value
+
(
value
>=
0
?
0
.
5
:
-
0
.
5
));
...
...
modules/core/perf/perf_core_arithm.cpp
View file @
5d363e67
...
@@ -62,3 +62,16 @@ PERF_TEST_P__CORE_ARITHM_SCALAR(subtract, TYPICAL_MATS_CORE_ARITHM)
...
@@ -62,3 +62,16 @@ PERF_TEST_P__CORE_ARITHM_SCALAR(subtract, TYPICAL_MATS_CORE_ARITHM)
PERF_TEST_P__CORE_ARITHM_SCALAR
(
absdiff
,
TYPICAL_MATS_CORE_ARITHM
)
PERF_TEST_P__CORE_ARITHM_SCALAR
(
absdiff
,
TYPICAL_MATS_CORE_ARITHM
)
PERF_TEST
(
convert
,
cvRound
)
{
double
number
=
theRNG
().
uniform
(
-
100
,
100
);
int
result
=
0
;
TEST_CYCLE
(
1000
)
{
for
(
int
i
=
0
;
i
<
500000
;
++
i
)
result
+=
cvRound
(
number
);
}
}
modules/stitching/perf/perf_stich.cpp
View file @
5d363e67
...
@@ -19,12 +19,18 @@ PERF_TEST( stitch3, a123 )
...
@@ -19,12 +19,18 @@ PERF_TEST( stitch3, a123 )
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/a2.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/a2.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/a3.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/a3.jpg"
)
)
);
Stitcher
stitcher
=
Stitcher
::
createDefault
();
Stitcher
::
Status
status
;
Stitcher
::
Status
status
;
declare
.
time
(
30
*
20
);
declare
.
time
(
30
*
20
);
TEST_CYCLE
(
20
)
{
status
=
stitcher
.
stitch
(
imgs
,
pano
);
}
while
(
next
())
{
Stitcher
stitcher
=
Stitcher
::
createDefault
();
startTimer
();
status
=
stitcher
.
stitch
(
imgs
,
pano
);
stopTimer
();
}
}
}
PERF_TEST
(
stitch2
,
b12
)
PERF_TEST
(
stitch2
,
b12
)
...
@@ -35,10 +41,16 @@ PERF_TEST( stitch2, b12 )
...
@@ -35,10 +41,16 @@ PERF_TEST( stitch2, b12 )
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/b1.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/b1.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/b2.jpg"
)
)
);
imgs
.
push_back
(
imread
(
getDataPath
(
"stitching/b2.jpg"
)
)
);
Stitcher
stitcher
=
Stitcher
::
createDefault
();
Stitcher
::
Status
status
;
Stitcher
::
Status
status
;
declare
.
time
(
30
*
20
);
declare
.
time
(
30
*
20
);
TEST_CYCLE
(
20
)
{
status
=
stitcher
.
stitch
(
imgs
,
pano
);
}
while
(
next
())
{
Stitcher
stitcher
=
Stitcher
::
createDefault
();
startTimer
();
status
=
stitcher
.
stitch
(
imgs
,
pano
);
stopTimer
();
}
}
}
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