C library of triangulation algorithms (for the problems of mobile robot positioning or resection)
|
Go to the source code of this file.
Data Structures | |
struct | color |
Functions | |
tfloat | detMatrix33 (tfloat M[][3]) |
Computes the determinant of a 3x3 matrix. More... | |
tfloat | gaussianRand (void) |
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) |
void | grayscale2RGB (tfloat imageG[], tfloat imageRGB[], unsigned int width, unsigned int height, unsigned int Max) |
Convert a grayscale to an RGB image. More... | |
void | initRand (void) |
Initializes the random number generator with current time. | |
color | mapRGB (double v, double vmin, double vmax) |
tfloat | mean (tfloat data[], unsigned long N) |
Computes the algebraic mean of the array data[] of length N. More... | |
int | saveMapAndScale (tfloat image[], unsigned int Width, unsigned int Height, unsigned int Mode, unsigned int Max, tfloat P1) |
tfloat | triangulationGDOP (tfloat xr, tfloat yr, tfloat x1, tfloat y1, tfloat x2, tfloat y2, tfloat x3, tfloat y3) |
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) |
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) |
tfloat | variance (tfloat data[], unsigned long N) |
Computes the variance of the array data[] of length N. More... | |
int | writePGM (tfloat image[], unsigned int width, unsigned int height, unsigned int Max, char *fileName) |
int | writePPM (tfloat image[], unsigned int width, unsigned int height, unsigned int Max, char *fileName) |
Computes the determinant of a 3x3 matrix.
M[][3] |
Definition at line 358 of file toolbox.c.
Referenced by triangulationGDOP().
tfloat gaussianRand | ( | void | ) |
Returns an occurence of a normally distributed random variable. Uses the Marsaglia polar method (polar version of Box-Muller transform). http://en.wikipedia.org/wiki/Box_Muller_transform
Definition at line 204 of file toolbox.c.
Referenced by triangulationSensitivity().
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 | ||
) |
Computes the angles (a1,a2,a3) measured by a robot (xr,yr) from beacons (x1,y1), (x2,y2), (x3,y3). The orientation of the robot is given by 'or', and angles are computed relatively to 'or'.
a1 | |
a2 | |
a3 | |
xr | |
yr | |
or | |
x1 | |
y1 | |
x2 | |
y2 | |
x3 | |
y3 |
Definition at line 85 of file toolbox.c.
Referenced by triangulationSensitivity(), and usage().
void grayscale2RGB | ( | tfloat | imageG[], |
tfloat | imageRGB[], | ||
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | Max | ||
) |
Convert a grayscale to an RGB image.
imageG[] | |
imageRGB[] | |
width | |
height | |
Max |
Definition at line 439 of file toolbox.c.
References mapRGB().
Referenced by saveMapAndScale().
Return a RGB color value given a scalar v in the range [vmin,vmax] In this case each colour component ranges from 0 (no contribution) to 1 (fully saturated), modifications for other ranges is trivial. The colour is clipped at the end of the scales if v is outside the range [vmin,vmax] http://stackoverflow.com/questions/7706339/grayscale-to-red-green-blue-matlab-jet-color-scale
v | |
vmin | |
vmax |
Definition at line 472 of file toolbox.c.
Referenced by grayscale2RGB().
Computes the algebraic mean of the array data[] of length N.
data[] | |
N |
Definition at line 153 of file toolbox.c.
References mean().
Referenced by mean(), triangulationSensitivity(), and variance().
int saveMapAndScale | ( | tfloat | image[], |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | mode, | ||
unsigned int | Max, | ||
tfloat | P1 | ||
) |
Scales 'image[]' according to 'mode', 'Max', and 'P1'. Saves scaled image in "map.pgm" and corresponding scale in "scale.pgm"
image[] | |
width | |
height | |
mode | |
Max | |
P1 |
Definition at line 378 of file toolbox.c.
References grayscale2RGB(), map_to_grayscale_hist(), map_to_grayscale_lin(), map_to_grayscale_log(), map_to_grayscale_sat(), writePGM(), and writePPM().
Referenced by usage().
tfloat triangulationGDOP | ( | tfloat | xr, |
tfloat | yr, | ||
tfloat | x1, | ||
tfloat | y1, | ||
tfloat | x2, | ||
tfloat | y2, | ||
tfloat | x3, | ||
tfloat | y3 | ||
) |
Computes the first order Geometric Dilution of Precision (GDOP) for triangulation, given the robot position (xr,yr), and beacons locations (x1,y1), (x2,y2), and (x3,y3).
xr | |
yr | |
x1 | |
y1 | |
x2 | |
y2 | |
x3 | |
y3 |
Definition at line 334 of file toolbox.c.
References detMatrix33().
Referenced by usage().
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 | ||
) |
Triangulates robot position (x,y) from measured angles alpha1, alpha2, and alpha3, and beacons locations (x1,y1), (x2,y2), and (x3,y3). Uses triangulation method 'm' given in command line.
x | |
y | |
alpha1 | |
alpha2 | |
alpha3 | |
x1 | |
y1 | |
x2 | |
y2 | |
x3 | |
y3 | |
method |
Definition at line 112 of file toolbox.c.
References triangulationPierlot().
Referenced by triangulationSensitivity(), and usage().
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 | ||
) |
Simulates the beacon position sensitivity of the triangulation method 'm', for measured angles alpha1, alpha2, and alpha3, and beacons locations (x1,y1), (x2,y2), and (x3,y3). 'sigma' is the standard deviation of beacon coordinates. The simulation is performed 'n' times.
xTrue | |
yTrue | |
x1 | |
y1 | |
x2 | |
y2 | |
x3 | |
y3 | |
method | |
sigmaAngle | |
sigmaBeacon | |
n | |
outputType | |
thresh |
Definition at line 242 of file toolbox.c.
References gaussianRand(), get_angles(), initRand(), mean(), PI, triangulationMethod(), and variance().
Referenced by usage().
Computes the variance of the array data[] of length N.
data[] | |
N |
Definition at line 173 of file toolbox.c.
References mean(), and variance().
Referenced by triangulationSensitivity(), and variance().
int writePGM | ( | tfloat | image[], |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | Max, | ||
char * | fileName | ||
) |
Writes a PGM ASCII file in 'fileName'. image[] is the array of values, width/height are the dimensions, Max is the maximum desired value in the file. http://netpbm.sourceforge.net/doc/ppm.html http://en.wikipedia.org/wiki/Netpbm_format
image[] | |
width | |
height | |
Max | |
fileName |
Definition at line 513 of file toolbox.c.
Referenced by saveMapAndScale().
int writePPM | ( | tfloat | image[], |
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | Max, | ||
char * | fileName | ||
) |
Writes a PPM ASCII file in 'fileName'. image[] is the array of values, width/height are the dimensions, Max is the maximum desired value in the file. http://netpbm.sourceforge.net/doc/ppm.html http://en.wikipedia.org/wiki/Netpbm_format
image[] | |
width | |
height | |
Max | |
fileName |
Definition at line 551 of file toolbox.c.
Referenced by saveMapAndScale().