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
7968baf2
Commit
7968baf2
authored
Jul 29, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continuing fixing rgbd samples
parent
ca2474be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
odometry_evaluation.cpp
modules/rgbd/samples/odometry_evaluation.cpp
+30
-3
No files found.
modules/rgbd/samples/odometry_evaluation.cpp
View file @
7968baf2
...
...
@@ -38,6 +38,7 @@
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/core/utility.hpp>
#include <iostream>
#include <fstream>
...
...
@@ -48,6 +49,32 @@ using namespace cv::rgbd;
#define BILATERAL_FILTER 0// if 1 then bilateral filter will be used for the depth
class
MyTickMeter
{
public
:
MyTickMeter
()
{
reset
();
}
void
start
()
{
startTime
=
getTickCount
();
}
void
stop
()
{
int64
time
=
getTickCount
();
if
(
startTime
==
0
)
return
;
++
counter
;
sumTime
+=
(
time
-
startTime
);
startTime
=
0
;
}
int64
getTimeTicks
()
const
{
return
sumTime
;
}
double
getTimeSec
()
const
{
return
(
double
)
getTimeTicks
()
/
getTickFrequency
();
}
int64
getCounter
()
const
{
return
counter
;
}
void
reset
()
{
startTime
=
sumTime
=
0
;
counter
=
0
;
}
private
:
int64
counter
;
int64
sumTime
;
int64
startTime
;
};
static
void
writeResults
(
const
string
&
filename
,
const
vector
<
string
>&
timestamps
,
const
vector
<
Mat
>&
Rt
)
{
...
...
@@ -154,7 +181,7 @@ int main(int argc, char** argv)
}
odometry
->
set
(
"cameraMatrix"
,
cameraMatrix
);
TickMeter
gtm
;
My
TickMeter
gtm
;
int
count
=
0
;
for
(
int
i
=
0
;
!
file
.
eof
();
i
++
)
{
...
...
@@ -167,7 +194,7 @@ int main(int argc, char** argv)
// Read one pair (rgb and depth)
// example: 1305031453.359684 rgb/1305031453.359684.png 1305031453.374112 depth/1305031453.374112.png
#if BILATERAL_FILTER
TickMeter
tm_bilateral_filter
;
My
TickMeter
tm_bilateral_filter
;
#endif
{
string
rgbFilename
=
str
.
substr
(
timestampLength
+
1
,
rgbPathLehgth
);
...
...
@@ -213,7 +240,7 @@ int main(int argc, char** argv)
Mat
Rt
;
if
(
!
Rts
.
empty
())
{
TickMeter
tm
;
My
TickMeter
tm
;
tm
.
start
();
gtm
.
start
();
bool
res
=
odometry
->
compute
(
frame_curr
,
frame_prev
,
Rt
);
...
...
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