Ejemplo n.º 1
0
double
probability_between_moves( logtools_rmove2_t move1, logtools_rmove2_t move2 )
{
  double sum = 0.0;
  sum += log( EPSILON +
	      logtools_gauss_function( fabs( move1.forward-move2.forward ),
				       0, settings.motion_model.forward ));
  sum += log( EPSILON +
	      logtools_gauss_function( fabs( move1.sideward-move2.sideward ),
				       0, settings.motion_model.sideward));
  sum += log( EPSILON +
	      logtools_gauss_function( fabs( compute_orientation_diff( move1.rotation,
								       move2.rotation )),
			      0, settings.motion_model.rotation ));
  return( sum );
}
Ejemplo n.º 2
0
logtools_gauss_kernel_t
logtools_compute_gauss_kernel_with_function( int length )
{
  logtools_gauss_kernel_t kernel;

  int center = (length-1) / 2;
  double sigma = sqrt( length/(2*M_PI) );
  int i;

  kernel.len = length;
  kernel.val = (double *) malloc( length * sizeof(double) );
  for (i=0;i<length;i++) {
    kernel.val[i] = logtools_gauss_function( (i-center), 0.0, sigma );
  }
  return(kernel);
}