moved timing scripts back to main directory, added timeCalibratedCamera
parent
4bc3229670
commit
4b6eb67340
|
|
@ -21,7 +21,7 @@ sources += projectiveGeometry.cpp tensorInterface.cpp
|
||||||
check_PROGRAMS += tests/testTensors tests/testHomography2 tests/testTrifocal
|
check_PROGRAMS += tests/testTensors tests/testHomography2 tests/testTrifocal
|
||||||
|
|
||||||
# Timing tests
|
# Timing tests
|
||||||
noinst_PROGRAMS = tests/timeRot3
|
noinst_PROGRAMS = timeRot3 timeCalibratedCamera
|
||||||
|
|
||||||
#----------------------------------------------------------------------------------------------------
|
#----------------------------------------------------------------------------------------------------
|
||||||
# Create a libtool library that is not installed
|
# Create a libtool library that is not installed
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
/**
|
||||||
|
* @file timeCalibratedCamera.cpp
|
||||||
|
* @brief time CalibratedCamera derivatives
|
||||||
|
* @author Frank Dellaert
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "CalibratedCamera.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace gtsam;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int n = 100000;
|
||||||
|
Matrix computed;
|
||||||
|
|
||||||
|
const Pose3 pose1(Matrix_(3,3,
|
||||||
|
1., 0., 0.,
|
||||||
|
0.,-1., 0.,
|
||||||
|
0., 0.,-1.
|
||||||
|
),
|
||||||
|
Point3(0,0,0.5));
|
||||||
|
|
||||||
|
const CalibratedCamera camera(pose1);
|
||||||
|
const Point3 point1(-0.08,-0.08, 0.0);
|
||||||
|
|
||||||
|
// Aug 8, iMac 3.06GHz Core i3
|
||||||
|
// 0.263943 seconds
|
||||||
|
// 378870 calls/second
|
||||||
|
// 2.63943 musecs/call
|
||||||
|
|
||||||
|
long timeLog = clock();
|
||||||
|
for(int i = 0; i < n; i++)
|
||||||
|
computed = Dproject_pose(camera, point1);
|
||||||
|
long timeLog2 = clock();
|
||||||
|
double seconds = (double)(timeLog2-timeLog)/CLOCKS_PER_SEC;
|
||||||
|
cout << ((double)n/seconds) << " calls/second" << endl;
|
||||||
|
cout << ((double)seconds*1000000/n) << " musecs/call" << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue