3 #include "../csm/csm_all.h"
7 int main(
int argc,
const char*argv[]) {
12 const char * filename = argv[1];
13 file = fopen(filename,
"r");
15 fprintf(stderr,
"Could not open '%s'.\n", filename);
23 params.max_angular_correction_deg = 5;
24 params.max_linear_correction = 0.2;
25 params.max_iterations = 30;
27 params.epsilon_theta = 0.001;
28 params.max_correspondence_dist = 2;
31 params.restart_threshold_mean_error = 3.0 / 300.0;
33 params.restart_dtheta= 1.5 * 3.14 /180;
35 params.clustering_threshold = 0.05;
36 params.orientation_neighbourhood = 3;
37 params.use_corr_tricks = 1;
40 params.outliers_maxPerc = 0.85;
42 params.outliers_adaptive_order =0.7;
43 params.outliers_adaptive_mult=2;
44 params.do_visibility_test = 1;
45 params.do_compute_covariance = 0;
47 int num_matchings = 0;
48 int num_iterations = 0;
49 clock_t start = clock();
52 printf(
"Could not read first scan.\n");
56 gsl_vector *u = gsl_vector_alloc(3);
57 gsl_vector *x_old = gsl_vector_alloc(3);
58 gsl_vector *x_new = gsl_vector_alloc(3);
75 clock_t end = clock();
76 float seconds = (end-start)/((
float)CLOCKS_PER_SEC);
78 sm_debug(
"sm0: CPU time = %f (seconds) (start=%d end=%d)\n", seconds,(
int)start,(
int)end);
79 sm_debug(
"sm0: Total number of matchings = %d\n", num_matchings);
80 sm_debug(
"sm0: Total number of iterations = %d\n", num_iterations);
81 sm_debug(
"sm0: Avg. iterations per matching = %f\n", num_iterations/((
float)num_matchings));
82 sm_debug(
"sm0: Avg. seconds per matching = %f\n", seconds/num_matchings);
83 sm_debug(
"sm0: that is, %d matchings per second\n", (
int)floor(num_matchings/seconds));
84 sm_debug(
"sm0: Avg. seconds per iteration = %f (note: very imprecise)\n", seconds/num_iterations);
86 sm_debug(
"sm0: Avg. comparisons per ray = %f \n",
92 gsl_vector_free(x_old);
93 gsl_vector_free(x_new);