记录一下levmar(c++ 版)的一些资料
官网网址为:http://users.ics.forth.gr/~lourakis/levmar/index.html
dlevmar_dif()函数接口说明
int dlevmar_dif(void (*func)(double *p, double *hx, int m, int n, void *adata),
dlevmar_dif()函数的原文如下
/*
*/
int dlevmar_dif(
void (*func)(double *p, double *hx, int m, int n, void adata), / functional relation describing measurements.
* A p \in R^m yields a \hat{x} \in R^n
*/
double p, / I/O: initial parameter estimates. On output contains the estimated solution */
double x, / I: measurement vector. NULL implies a zero vector /
int m, / I: parameter vector dimension (i.e. #unknowns) /
int n, / I: measurement vector dimension /
int itmax, / I: maximum number of iterations /
double opts[5], / I: opts[0-4] = minim. options [\tau, \epsilon1, \epsilon2, \epsilon3, \delta]. Respectively the
* scale factor for initial \mu, stopping thresholds for ||J^T e||_inf, ||Dp||_2 and ||e||_2 and the
* step used in difference approximation to the Jacobian. If \delta<0, the Jacobian is approximated
* with central differences which are more accurate (but slower!) compared to the forward differences
* employed by default. Set to NULL for defaults to be used.
/
double info[LM_INFO_SZ],
/ O: information regarding the minimization. Set to NULL if don’t care
* info[0]= ||e||_2 at initial p.
* info[1-4]=[ ||e||_2, ||J^T e||_inf, ||Dp||_2, \mu/max[J^T J]_ii ], all computed at estimated p.
* info[5]= # iterations,
* info[6]=reason for terminating: 1 - stopped by small gradient J^T e
* 2 - stopped by small Dp
* 3 - stopped by itmax
* 4 - singular matrix. Restart from current p with increased \mu
* 5 - no further error reduction is possible. Restart with increased mu
* 6 - stopped by small ||e||_2
* 7 - stopped by invalid (i.e. NaN or Inf) “func” values; a user error
* info[7]= # function evaluations
* info[8]= # Jacobian evaluations
* info[9]= # linear systems solved, i.e. # attempts for reducing error
*/
double work, / I: working memory, allocated internally if NULL. If !=NULL, it is assumed to point to
* a memory chunk at least LM_DIF_WORKSZ(m, n)*sizeof(double) bytes long
*/
double covar, / O: Covariance matrix corresponding to LS solution; Assumed to point to a mxm matrix.
* Set to NULL if not needed.
*/
void adata) / I: pointer to possibly needed additional data, passed uninterpreted to func.
* Set to NULL if not needed
*/