00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #pragma once
00018 #include "global.h"
00019 #include "tnt.h"
00020 #include "tnt_array2d.h"
00021 #include "tnt_array2d_utils.h"
00022 #include "tnt_array1d_utils.h"
00023 #include "jama_cholesky.h"
00024
00025 namespace Calibration{
00026 class Step1;
00027 class Step3;
00030 class Step2{
00031 friend class Step3;
00033 Step1 **z;
00035 int count;
00037 double LM_scales[7];
00039 Array2D<double> A;
00041 double k1;
00043 double k2;
00044
00046 void AfromB(Array1D<double> b);
00049 void estimateRadial();
00050
00052 static int fcn(void *p,int m, int n,const double *x, double *fvec, int iflag);
00054 static int fcn2(void *p,int m, int n,const double *x, double *fvec, int iflag);
00055
00057 void optimize();
00060 void scaleModel(double);
00061
00062
00063 public:
00067 Step2(Step1 **z,int count);
00069 Array2D<double> project(int);
00070
00072 void printTests();
00074 void outA(char **text);
00076 void outPics(char **text);
00078 void getA(Array2D<double> &A){
00079 A=this->A;
00080 }
00082 void getK(double &k1,double &k2){
00083 k1=this->k1;
00084 k2=this->k2;
00085 }
00086
00087 };
00088 }