Visual Servoing Platform  version 3.0.0
vpPoint.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Point feature.
32  *
33  * Authors:
34  * Eric Marchand
35  *
36  *****************************************************************************/
37 
38 
39 #ifndef vpPoint_H
40 #define vpPoint_H
41 
48 
49 #include <visp3/core/vpMatrix.h>
50 #include <visp3/core/vpForwardProjection.h>
51 #include <visp3/core/vpColor.h>
52 
53 
59 class VISP_EXPORT vpPoint : public vpForwardProjection
60 {
61 
62 public:
64  vpPoint();
65  vpPoint(double oX, double oY, double oZ);
66  vpPoint(const vpColVector &P);
67  vpPoint(const std::vector<double> &P);
69  virtual ~vpPoint() {}
70 
71 public:
72 
73  // Compute the 3D coordinates _cP (camera frame)
74  void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP) ;
75  void changeFrame(const vpHomogeneousMatrix &cMo);
76 
77  void display(const vpImage<unsigned char> &I,
78  const vpCameraParameters &cam,
79  const vpColor &color=vpColor::green,
80  const unsigned int thickness=1) ;
81  void display(const vpImage<unsigned char> &I,
82  const vpHomogeneousMatrix &cMo,
83  const vpCameraParameters &cam,
84  const vpColor &color=vpColor::green,
85  const unsigned int thickness=1) ;
86  void display(const vpImage<vpRGBa> &I,
87  const vpHomogeneousMatrix &cMo,
88  const vpCameraParameters &cam,
89  const vpColor &color=vpColor::green,
90  const unsigned int thickness=1) ;
91  vpPoint *duplicate() const ;
92 
93  // Get coordinates
94  double get_X() const;
95  double get_Y() const;
96  double get_Z() const;
97  double get_W() const;
98  double get_oX() const;
99  double get_oY() const;
100  double get_oZ() const;
101  double get_oW() const;
102  double get_x() const;
103  double get_y() const;
104  double get_w() const;
105 
106  void getWorldCoordinates(double& oX, double& oY, double& oZ);
107  void getWorldCoordinates(vpColVector &P);
108  vpColVector getWorldCoordinates(void);
109  void getWorldCoordinates(std::vector<double> &P);
110 
112  void init() ;
113 
114  friend VISP_EXPORT std::ostream& operator<<(std::ostream& os, const vpPoint& vpp);
115  vpPoint& operator=(const vpPoint& vpp);
116 
118  void projection(const vpColVector &_cP, vpColVector &_p);
119 
120  void projection();
121 
122  // Set coordinates
123  void set_X(const double X);
124  void set_Y(const double Y);
125  void set_Z(const double Z);
126  void set_W(const double W);
127  void set_oX(const double oX);
128  void set_oY(const double oY);
129  void set_oZ(const double oZ);
130  void set_oW(const double oW);
131  void set_x(const double x);
132  void set_y(const double y);
133  void set_w(const double w);
134 
135  void setWorldCoordinates(const double oX, const double oY, const double oZ);
136  void setWorldCoordinates(const vpColVector &P);
137  void setWorldCoordinates(const std::vector<double> &P);
138 };
139 
140 #endif
vpTracker & operator=(const vpTracker &tracker)
Copy operator.
Definition: vpTracker.cpp:65
virtual void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &cP)=0
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class to define colors available for display functionnalities.
Definition: vpColor.h:121
virtual void display(const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)=0
virtual void init()=0
static const vpColor green
Definition: vpColor.h:166
Class that defines what is a point.
Definition: vpPoint.h:59
virtual void projection()=0
virtual ~vpPoint()
Destructor.
Definition: vpPoint.h:69
Class that defines what is a generic geometric feature.
virtual void setWorldCoordinates(const vpColVector &oP)=0
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
virtual vpForwardProjection * duplicate() const =0