Go to the documentation of this file.00001
00002 #ifndef sdet_gauss_fit_h_
00003 #define sdet_gauss_fit_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <vcl_vector.h>
00013 #include <vnl/vnl_vector.h>
00014 #include <vnl/vnl_least_squares_function.h>
00015 #include <vgl/vgl_point_3d.h>
00016 #include <vsol/vsol_point_2d_sptr.h>
00017
00018
00019
00020
00021
00022
00023
00024 class sdet_adjust_lsqr : public vnl_least_squares_function
00025 {
00026 public:
00027
00028 sdet_adjust_lsqr( vcl_vector<vgl_point_3d<double> > const& img_pts,
00029 unsigned int num_unknowns, unsigned int num_residuals,
00030 int n_peaks);
00031
00032
00033 virtual ~sdet_adjust_lsqr() {}
00034
00035
00036
00037 virtual void f(vnl_vector<double> const& x, vnl_vector<double>& fx);
00038
00039 #if 0
00040
00041 virtual void trace(int iteration, vnl_vector<double> const& x,
00042 vnl_vector<double> const& fx);
00043 #endif
00044
00045 protected:
00046
00047 vcl_vector<vgl_point_3d<double> > img_pts_;
00048 unsigned num_pixels_;
00049 int n_peaks_;
00050 };
00051
00052 class sdet_gauss_fit
00053 {
00054 public:
00055 ~sdet_gauss_fit(){}
00056
00057 static vnl_vector<double> adjust(vcl_vector<vgl_point_3d<double> > img_pts,
00058 vcl_vector<vsol_point_2d_sptr> ps_list,
00059 int n_peaks,
00060 vcl_ofstream& outfile,
00061 double xmin, double ymin);
00062
00063 static vnl_vector<double> calculate_ellipse(vnl_vector<double> result,
00064 float x,
00065 float y,
00066 int i,
00067 int n_peaks,
00068 vcl_ofstream& outfile);
00069
00070 protected:
00071 sdet_gauss_fit();
00072 };
00073
00074 #endif // sdet_gauss_fit_h_