19 #include <vnl/vnl_least_squares_function.h>
26 const std::vector<a_point> & cloud) :
30 void f(
const vnl_vector<double>& x, vnl_vector<double>& fx);
39 a_point
dir(x[0],x[1],x[2]);
40 a_point orig(x[3],x[4],x[5]);
44 for (
int i = 0; i< fx.size(); i++)
52 o <<
"*************" << std::endl;
53 o <<
"a_shape_line:" << std::endl;
54 o <<
"*************" << std::endl;
55 o <<
"This is a 'line' fitting class" << std::endl;
64 if (
dir.norm()==0)
return;
65 this->
dir(dir.normalise());
72 a_point d = this->
orig()-pt;
73 a_point dist = (this->
dir()*d)*this->
dir()-d;
79 a_point d = this->
orig()-pt;
80 a_point dist = (this->
dir()*d)*this->
dir()-d;
101 std::vector<a_point> pts2;
102 int cs0 = pts.size();
116 for (
int i=1; i< pts.size(); i++)
119 double v = this->
dir()*(x-x0);
123 std::cout <<
"1" << std::endl;
124 std::cout << x0+vmin*this->
dir() <<
" " << x0+vmax*this->
dir() << std::endl;
const std::vector< a_point > & cloud_
void f(const vnl_vector< double > &x, vnl_vector< double > &fx)
a_shape_line_function(a_shape_line &shape, const std::vector< a_point > &cloud)
void export_line(const std::vector< a_point > &pts) const
static const std::string help()
void p2pts(const a_point p1, const a_point p2)
void random_hint(const std::vector< a_point > &pts)
a_point closest_point(const a_point p) const
void fit_cloud(std::vector< a_point > &pts, short nl=1)
double dist_point(const a_point p) const
void fit_cloud(const std::vector< a_point > &pts, vnl_least_squares_function &fn)
static const std::string help()
int best_fitting_cloud(const std::vector< a_point > &pts, std::vector< a_point > &pts2)
double v(const uint32_t step, const uint32_t n)
a_point dir(int i, int l)