hsm.h
Go to the documentation of this file.
1 #ifndef H_CSM_HSM
2 #define H_CSM_HSM
3 
4 #include <stdlib.h>
7 struct hsm_params {
9  double max_norm;
14 
17 
20 
21 
24 
27 
28 
31 
34 
35 
36 
38 
42  double debug_true_x[3];
43 };
44 
45 
51 
54 
57 
59  double rho_min, rho_max;
60 
62  double **ht;
63 
65  double *hs;
66 
71 
74 
76  double **results;
77 
79  double *results_quality;
80 
81 
83  double *theta;
84 
86  double *sint,*cost;
87 
89  double *hs_cross_corr;
90 
92  double disp[3];
93  double disp_th_cos, disp_th_sin;
94 };
95 
96 typedef struct hsm_buffer_struct* hsm_buffer;
97 
98 
100  hsm_buffer hsm_buffer_alloc(struct hsm_params*);
101 
103  void hsm_buffer_free(hsm_buffer);
104 
106  void hsm_compute_ht_point(hsm_buffer, double x, double y, double weight);
107 
108 
109  void hsm_match(struct hsm_params*p, hsm_buffer b1, hsm_buffer b2);
110 
114  void hsm_compute_ht_base(hsm_buffer, const double base_pose[3]);
115 
117  void hsm_compute_spectrum(hsm_buffer);
118 
119  void hsm_compute_spectrum_norm(hsm_buffer b);
120 
124  void hsm_find_local_maxima_circ(int n, const double*f, int*maxima, int*nmaxima);
125 
127  int hsm_is_angle_between_smaller_than_deg(double angle1, double angle2, double threshold_deg);
128 
129 
132  int hsm_rho2index(hsm_buffer b, double rho, int *rho_index, double *alpha);
133 
135  void hsm_circular_cross_corr_stupid(int n, const double *a, const double *b, double*res);
136 
138  void hsm_find_peaks_circ(int n, const double*f, double min_angle_deg, int unidir, int max_peaks,
139  int*peaks, int* npeaks) ;
140 
141  void hsm_find_peaks_linear(int n, const double*f, double min_dist, int max_peaks,
142  int*peaks, int* npeaks);
143  void hsm_find_local_maxima_linear(int n, const double*f, int*maxima, int*nmaxima);
144 
145  void hsm_linear_cross_corr_stupid(int na, const double *a, int nb, const double *b, double*res, int*lags, int min_lag, int max_lag);
146 
147  void hsm_generate_combinations(int nslots, const int possible_choices[],
148  int i, int i_choice[]) ;
149 
150  /* a mod b >= 0 */
151  int pos_mod(int a, int b);
152 
154  void qsort_descending(int *indexes, size_t nmemb, const double*values);
155 
156  /* used by qsort_descending */
157  int compare_descending(const void *index_pt1, const void *index_pt2);
158 
159 
160 #endif
void hsm_compute_ht_point(hsm_buffer, double x, double y, double weight)
Definition: hsm.c:90
void qsort_descending(int *indexes, size_t nmemb, const double *values)
Definition: hsm.c:582
int compare_descending(const void *index_pt1, const void *index_pt2)
Definition: hsm.c:575
double ** results
Definition: hsm.h:76
void hsm_match(struct hsm_params *p, hsm_buffer b1, hsm_buffer b2)
Definition: hsm.c:156
int num_angular_hypotheses
Definition: hsm.h:16
double * results_quality
Definition: hsm.h:79
void hsm_buffer_free(hsm_buffer)
Definition: hsm.c:62
void hsm_circular_cross_corr_stupid(int n, const double *a, const double *b, double *res)
Definition: hsm.c:539
int hsm_rho2index(hsm_buffer b, double rho, int *rho_index, double *alpha)
Definition: hsm.c:119
double angular_cell_size_deg
Definition: hsm.h:13
int num_valid_results
Definition: hsm.h:73
void hsm_compute_spectrum(hsm_buffer)
Definition: hsm.c:140
void hsm_linear_cross_corr_stupid(int na, const double *a, int nb, const double *b, double *res, int *lags, int min_lag, int max_lag)
Definition: hsm.c:551
double debug_true_x[3]
Definition: hsm.h:42
void hsm_find_peaks_linear(int n, const double *f, double min_dist, int max_peaks, int *peaks, int *npeaks)
Definition: hsm.c:460
double * sint
Definition: hsm.h:86
double linear_xc_peaks_min_distance
Definition: hsm.h:33
void hsm_find_peaks_circ(int n, const double *f, double min_angle_deg, int unidir, int max_peaks, int *peaks, int *npeaks)
Definition: hsm.c:401
double * hs_cross_corr
Definition: hsm.h:89
double disp_th_sin
Definition: hsm.h:93
int num_angular_cells
Definition: hsm.h:50
void hsm_find_local_maxima_circ(int n, const double *f, int *maxima, int *nmaxima)
Definition: hsm.c:514
int linear_xc_max_npeaks
Definition: hsm.h:30
void hsm_compute_ht_base(hsm_buffer, const double base_pose[3])
Definition: hsm.c:82
struct @0 p
void hsm_find_local_maxima_linear(int n, const double *f, int *maxima, int *nmaxima)
Definition: hsm.c:526
double xc_directions_min_distance_deg
Definition: hsm.h:26
int debug_true_x_valid
Definition: hsm.h:40
double linear_cell_size
Definition: hsm.h:56
double linear_cell_size
Definition: hsm.h:11
int max_num_results
Definition: hsm.h:70
double rho_min
Definition: hsm.h:59
struct hsm_buffer_struct * hsm_buffer
Definition: hsm.h:96
Definition: hsm.h:7
double max_norm
Definition: hsm.h:9
int num_linear_cells
Definition: hsm.h:53
int xc_ndirections
Definition: hsm.h:23
double max_translation
Definition: hsm.h:37
hsm_buffer hsm_buffer_alloc(struct hsm_params *)
Definition: hsm.c:10
double ** ht
Definition: hsm.h:62
int hsm_is_angle_between_smaller_than_deg(double angle1, double angle2, double threshold_deg)
Definition: hsm.c:509
void hsm_generate_combinations(int nslots, const int possible_choices[], int i, int i_choice[])
Definition: hsm.c:392
double * hs
Definition: hsm.h:65
void hsm_compute_spectrum_norm(hsm_buffer b)
Definition: hsm.c:148
int pos_mod(int a, int b)
Definition: hsm.c:591
double angular_hyp_min_distance_deg
Definition: hsm.h:19
double * theta
Definition: hsm.h:83


csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23