21 #ifndef LS_MINIMIZER_H
22 #define LS_MINIMIZER_H
49 ls_minimizer(
int state_size,
int maximum_scalar_measure_number);
80 const double d0,
const double d1,
83 const double d0,
const double d1,
84 const double b0,
const double b1);
91 const double d0,
const double d1,
const double d2,
92 const double b0,
const double b1);
162 void set_default_values(
void);
164 inline double rho(
double x2,
double c2) {
return (x2 < c2) ? x2 : c2; }
165 double build_eps(
double *
state,
double current_best_residual = std::numeric_limits<double>::max());
167 bool build_J(
double * state);
168 bool build_J_and_eps(
double * state);
169 bool build_J_and_stuff(
double * state);
170 double compute_residual(
double * state,
bool display =
false);
174 double build_eps_return_inlier_residual(
double * state,
double current_best_residual = std::numeric_limits<double>::max());
175 double inlier_residual(
double * state,
double current_best_residual);
177 void show_state(
int vl,
double * state,
double r);
179 void set_current_c_s(
double k = -1.);
184 double default_squared_c;
186 int number_of_observation_2data_1measure;
189 int number_of_observation_2data_2measures;
192 int number_of_observation_3data_2measures;
194 int type_of_last_added_observation;
196 CvMat * J, * eps, * eps_previous;
197 CvMat * Jt, * JtJ, * Jteps, * ds, * Jds, * aug_JtJ;
201 bool use_user_scaling, use_automated_scaling;
203 void * user_data[10];
207 int lm_max_iterations;
208 int lm_max_failures_in_a_row;
212 double dl_update_Delta(
double rho,
double Delta,
double rho_min,
double rho_max);
214 CvMat * dl_delta_diff, * dl_delta_dl, * dl_delta_sd, * dl_delta_gn;
215 CvMat * JtJdelta, * JJteps;
218 bool line_search(CvMat * dir,
double lambda_min,
double lambda_max,
double current_residual,
double & new_residual,
double & new_lambda);
219 CvMat * ct_delta_gn, * ct_delta_sd;
220 int ct_max_iterations;
221 double ct_k_rough, ct_k_fine, ct_lambda0;
224 bool pick_random_indices(
int & i0,
int & i1,
int max_index);
225 bool pick_random_indices(
int & i0,
int & i1,
int & i2,
int max_index);
226 bool pick_random_indices(
int & i0,
int & i1,
int & i2,
int & i3,
int max_index);
229 bool inside_julien_method;
233 double * ground_truth_state;
236 #endif // LS_MINIMIZER_H