Lens distortion correction division model 1p
 All Classes Files Functions Variables
line_points.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010-2013, AMI RESEARCH GROUP <lalvarez@dis.ulpgc.es>
3  License : CC Creative Commons "Attribution-NonCommercial-ShareAlike"
4  see http://creativecommons.org/licenses/by-nc-sa/3.0/es/deed.en
5  */
6 
7 #ifndef AMI_DLL_H
8  #define AMI_DLL_H
9 #endif
10 
18 #ifndef LINE_POINTS_H
19 #define LINE_POINTS_H
20 #include "line.h"
21 #include "point2d.h"
22 #include <iostream>
23 #include <vector>
24 
25 
26 using namespace std;
27 using namespace ami;
28 
29 
30 
31 namespace ami
32 {
33 
40 class AMI_DLL_H line_points{
41  ami::line rect;
42  std::vector< ami::point2d<double> > points;
43 
44 
45 public:
50  line_points(){ rect.set_abc((double) 0.,(double) 0,(double) 0);}
51 
56  line_points(const line_points &line){ rect = line.rect; points = line.points;}
57 
63  line_points(double a,double b,
64  double c){ rect.set_abc(a,b,c);}
65 
71 
77  std::vector<point2d<double> > &get_points() {return points;}
83  const std::vector<point2d<double> > &get_points() const {
84  return points;}
90 const ami::line &get_rect() const {return rect;}
91  ami::line &get_rect() {return rect;}
96  const double &get_a() const {return rect.get_a();}
97  double &get_a() {return rect.get_a();}
102  const double &get_b() const {return rect.get_b();}
103  double &get_b() {return rect.get_b();}
108  const double &get_c() const {return rect.get_c();}
109  double &get_c(){return rect.get_c();}
110 
115  void get_abc(double &a2,double &b2,
116  double &c2)
117  {a2=rect.get_a(); b2=rect.get_b(); c2=rect.get_c();}
118 
123  void set_a(double a2){rect.set_a(a2);}
128  void set_b(double b2){rect.set_b(b2);}
133  void set_c(double c2){rect.set_c(c2);}
134 
139  void set_abc(double a,double b,
140  double c){rect.set_abc(a,b,c);}
145  void set_points(std::vector<point2d<double> > p2){
146  points=p2;};
147 
148  double points_to_equation();
154  double evaluation(const point2d<double> &p ) const {
155  return (rect.get_a()*p.x+rect.get_b()*p.y+rect.get_c());
156  }
157 
158  line_points & operator= (const line_points &line)
159  {
160  rect = line.rect;
161  points = line.points;
162  return *this;
163  }
164 
165  void get_max_min_points(point2d<double> &min_x_p, point2d<double> &max_x_p,
166  point2d<double> &min_y_p, point2d<double> &max_y_p );
167 
168 };
169 
170 }
171 
172 #endif
class to store together a collection of aligned points and line equation and basic method ...
Definition: line_points.h:40
void set_c(double c2)
Definition: line_points.h:133
T x
Definition: point2d.h:37
double & get_c()
Definition: line_points.h:109
double evaluation(const point2d< double > &p) const
Definition: line_points.h:154
class for straight lines
Definition: line.h:30
void get_abc(double &a2, double &b2, double &c2)
Definition: line_points.h:115
~line_points()
Definition: line_points.h:70
line_points()
Definition: line_points.h:50
line_points(double a, double b, double c)
Definition: line_points.h:63
double & get_a()
Definition: line_points.h:97
T y
Definition: point2d.h:38
void set_a(double a2)
Definition: line_points.h:123
void set_points(std::vector< point2d< double > > p2)
Definition: line_points.h:145
double & get_b()
Definition: line_points.h:103
void set_abc(double a, double b, double c)
Definition: line_points.h:139
std::vector< point2d< double > > & get_points()
Definition: line_points.h:77
void set_b(double b2)
Definition: line_points.h:128
const ami::line & get_rect() const
Definition: line_points.h:90
point2d class definition
class for straight line