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