49#define MAX_COUNT_PT 50
51#define MIN_SAMPLES_FIT 3
85 info->surface_roughness =
info->fit_error;
86 info->divergence =
info->relative_velocity_z;
213 PU[
it * 3 + 1] =
pu[1][0];
214 PU[
it * 3 + 2] =
pu[2][0];
219 PV[
it * 3 + 1] =
pv[1][0];
220 PV[
it * 3 + 2] =
pv[2][0];
234 for (
p = 0;
p < count;
p++) {
250 for (
p = 0;
p < count;
p++) {
273 for (param = 0; param < 3; param++) {
287 for (param = 0; param < 3; param++) {
298 for (
p = 0;
p < count;
p++) {
306 for (
p = 0;
p < count;
p++) {
356 info->slope_x = 0.0f;
368 info->slope_y = 0.0f;
378 }
else {
info->focus_of_expansion_x = 0.0f; }
383 }
else {
info->focus_of_expansion_y = 0.0f; }
Perform Random Sample Consensus (RANSAC), a robust fitting method.
#define MAKE_MATRIX_PTR(_ptr, _mat, _rows)
Make a pointer to a matrix of _rows lines.
void fit_linear_flow_field(struct flow_t *vectors, int count, float error_threshold, int n_iterations, int n_samples, float *parameters_u, float *parameters_v, float *fit_error, float *min_error_u, float *min_error_v, int *n_inliers_u, int *n_inliers_v)
Analyze a linear flow field, retrieving information such as divergence, surface roughness,...
bool analyze_flow_field(struct flow_t *vectors, int count, float error_threshold, int n_iterations, int n_samples, int im_width, int im_height, float focal_length, struct linear_flow_fit_info *info)
Analyze a flow field, retrieving information on relative velocities and rotations,...
bool analyze_linear_flow_field(struct flow_t *vectors, int count, float error_threshold, int n_iterations, int n_samples, int im_width, int im_height, struct linear_flow_fit_info *info)
Analyze a linear flow field, retrieving information such as divergence, surface roughness,...
void extract_information_from_parameters(float *parameters_u, float *parameters_v, int im_width, int im_height, struct linear_flow_fit_info *info)
Extract information from the parameters that were fit to the optical flow field.
Paparazzi floating point algebra.
void pprz_svd_solve_float(float **x, float **u, float *w, float **v, float **b, int m, int n, int l)
SVD based linear solver.
int pprz_svd_float(float **a, float *w, float **v, int m, int n)
SVD decomposition.
Matrix decompositions in floating point.
Simple matrix helper macros.
#define MAT_MUL(_i, _k, _j, C, A, B)
#define MAT_SUB(_i, _j, C, A, B)