Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "RANSAC.h"
#include "math/pprz_matrix_decomp_float.h"
#include "math/pprz_algebra_float.h"
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "stdio.h"
Go to the source code of this file.
Functions | |
void | RANSAC_linear_model (int n_samples, int n_iterations, float error_threshold, float *targets, int D, float(*samples)[D], uint16_t count, float *params, float *fit_error) |
Perform RANSAC to fit a linear model. More... | |
float | predict_value (float *sample, float *weights, int D, bool use_bias) |
Predict the value of a sample with linear weights. More... | |
void | get_indices_without_replacement (int *indices_subset, int n_samples, int count) |
Get indices without replacement. More... | |
void get_indices_without_replacement | ( | int * | indices_subset, |
int | n_samples, | ||
int | count | ||
) |
Get indices without replacement.
[out] | indices_subset | This will be filled with the sampled indices |
[in] | n_samples | The number of samples / indices. |
[in] | count | The function will sample n_sample numbers from the range 1, 2, 3,..., count |
Definition at line 160 of file RANSAC.c.
References n_samples.
Referenced by RANSAC_linear_model().
float predict_value | ( | float * | sample, |
float * | weights, | ||
int | D, | ||
bool | use_bias | ||
) |
Predict the value of a sample with linear weights.
[in] | sample | The sample vector of size D |
[in] | weights | The weight vector of size D+1 |
[in] | D | The dimension of the sample. |
Definition at line 136 of file RANSAC.c.
References D.
Referenced by RANSAC_linear_model().
void RANSAC_linear_model | ( | int | n_samples, |
int | n_iterations, | ||
float | error_threshold, | ||
float * | targets, | ||
int | D, | ||
float(*) | samples[D], | ||
uint16_t | count, | ||
float * | params, | ||
float * | fit_error | ||
) |
Perform RANSAC to fit a linear model.
[in] | n_samples | The number of samples to use for a single fit |
[in] | n_iterations | The number of times a linear fit is performed |
[in] | error_threshold | The threshold used to cap errors in the RANSAC process |
[in] | targets | The target values |
[in] | samples | The samples / feature vectors |
[in] | D | The dimensionality of the samples |
[in] | count | The number of samples |
[out] | parameters* | Parameters of the linear fit, of size D + 1 (accounting for a constant 1 being added to the samples to represent a potential bias) |
[out] | fit_error* | Total error of the fit |
Definition at line 57 of file RANSAC.c.
References D, fit_linear_model(), fit_linear_model_prior(), get_indices_without_replacement(), n_samples, and predict_value().