C library of triangulation algorithms (for the problems of mobile robot positioning or resection)
toolbox.h
Go to the documentation of this file.
1 /**
2  * @file toolbox.h
3  */
4 
5 #ifndef __TOOLBOX_H__
6 
7 #ifdef _WIN32
8 long int random(void);
9 void srandom(unsigned int seed);
10 #endif
11 
12 #define __TOOLBOX_H__
13 
14 typedef struct {
15  double r , g , b ;
16 } color ;
17 
18 void get_angles(tfloat *a1, tfloat *a2, tfloat *a3, tfloat xr, tfloat yr, tfloat or, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3);
19 
21  tfloat alpha1, tfloat alpha2, tfloat alpha3,
22  tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3, int method);
23 
24 tfloat mean( tfloat data[] , unsigned long N );
25 tfloat variance( tfloat data[] , unsigned long N );
26 
27 void initRand( void );
28 tfloat gaussianRand( void );
29 
30 /*tfloat angleSensitivity(tfloat xTrue, tfloat yTrue,
31  tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3,
32  int method, tfloat sigma, unsigned int n, int outputType, double thresh);
33 
34 tfloat beaconSensitivity(tfloat xTrue, tfloat yTrue,
35  tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3,
36  int method, tfloat sigma, unsigned int n, int outputType, double thresh);*/
37 
38 
40  tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3,
41  int method, tfloat sigmaAngle, tfloat sigmaBeacon, unsigned int n, int outputType, double thresh);
42 
44 tfloat detMatrix33(tfloat M[][3]);
45 
46 int saveMapAndScale(tfloat image[] , unsigned int Width, unsigned int Height, unsigned int Mode, unsigned int Max, tfloat P1);
47 int writePGM( tfloat image[] , unsigned int width , unsigned int height , unsigned int Max , char* fileName );
48 int writePPM( tfloat image[] , unsigned int width , unsigned int height , unsigned int Max , char* fileName );
49 color mapRGB( double v , double vmin , double vmax );
50 void grayscale2RGB( tfloat imageG[] , tfloat imageRGB[] , unsigned int width , unsigned int height , unsigned int Max );
51 
52 #endif
53 
tfloat variance(tfloat data[], unsigned long N)
Computes the variance of the array data[] of length N.
Definition: toolbox.c:173
color mapRGB(double v, double vmin, double vmax)
Definition: toolbox.c:472
Definition: toolbox.h:14
tfloat triangulationGDOP(tfloat xr, tfloat yr, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3)
Definition: toolbox.c:334
int saveMapAndScale(tfloat image[], unsigned int Width, unsigned int Height, unsigned int Mode, unsigned int Max, tfloat P1)
Definition: toolbox.c:378
double tfloat
Defines the type for float/double.
Definition: const.h:38
tfloat triangulationMethod(tfloat *x, tfloat *y, tfloat alpha1, tfloat alpha2, tfloat alpha3, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3, int method)
Definition: toolbox.c:112
tfloat mean(tfloat data[], unsigned long N)
Computes the algebraic mean of the array data[] of length N.
Definition: toolbox.c:153
void grayscale2RGB(tfloat imageG[], tfloat imageRGB[], unsigned int width, unsigned int height, unsigned int Max)
Convert a grayscale to an RGB image.
Definition: toolbox.c:439
int writePGM(tfloat image[], unsigned int width, unsigned int height, unsigned int Max, char *fileName)
Definition: toolbox.c:513
tfloat triangulationSensitivity(tfloat xTrue, tfloat yTrue, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3, int method, tfloat sigmaAngle, tfloat sigmaBeacon, unsigned int n, int outputType, double thresh)
Definition: toolbox.c:242
int writePPM(tfloat image[], unsigned int width, unsigned int height, unsigned int Max, char *fileName)
Definition: toolbox.c:551
tfloat detMatrix33(tfloat M[][3])
Computes the determinant of a 3x3 matrix.
Definition: toolbox.c:358
tfloat gaussianRand(void)
Definition: toolbox.c:204
void get_angles(tfloat *a1, tfloat *a2, tfloat *a3, tfloat xr, tfloat yr, tfloat or, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3)
Definition: toolbox.c:85
void initRand(void)
Initializes the random number generator with current time.
Definition: toolbox.c:190