Visual Servoing Platform  version 3.2.0
vpFeatureBuilder.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  * Conversion between tracker and visual feature.
33  *
34  * Authors:
35  * Eric Marchand
36  * Fabien Spindler
37  *
38  *****************************************************************************/
39 
40 #ifndef vpFeatureBuilder_H
41 #define vpFeatureBuilder_H
42 
47 #include <visp3/core/vpConfig.h>
48 
49 // tracker
50 #ifdef VISP_HAVE_MODULE_BLOB
51 #include <visp3/blob/vpDot.h>
52 #include <visp3/blob/vpDot2.h>
53 #endif
54 
55 #ifdef VISP_HAVE_MODULE_ME
56 #include <visp3/me/vpMeEllipse.h>
57 #include <visp3/me/vpMeLine.h>
58 #endif
59 
60 // forward projection tracker
61 #include <visp3/core/vpCircle.h>
62 #include <visp3/core/vpCylinder.h>
63 #include <visp3/core/vpLine.h>
64 #include <visp3/core/vpPoint.h>
65 #include <visp3/core/vpSphere.h>
66 
67 // visual feature
68 #include <visp3/visual_features/vpFeatureEllipse.h>
69 #include <visp3/visual_features/vpFeatureLine.h>
70 #include <visp3/visual_features/vpFeaturePoint.h>
71 #include <visp3/visual_features/vpFeaturePoint3D.h>
72 #include <visp3/visual_features/vpFeaturePointPolar.h>
73 #include <visp3/visual_features/vpFeatureSegment.h>
74 #include <visp3/visual_features/vpFeatureThetaU.h>
75 #include <visp3/visual_features/vpFeatureTranslation.h>
76 #include <visp3/visual_features/vpFeatureVanishingPoint.h>
77 
78 // others
79 #include <visp3/core/vpImagePoint.h>
80 
81 // pixel / meter conversion
82 #include <visp3/core/vpCameraParameters.h>
83 #include <visp3/core/vpMeterPixelConversion.h>
84 #include <visp3/core/vpPixelMeterConversion.h>
85 
92 class VISP_EXPORT vpFeatureBuilder
93 {
94 public:
95 // create vpFeaturePoint feature
96 #ifdef VISP_HAVE_MODULE_BLOB
97  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d);
98  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot2 &d);
99 #endif
100  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t);
101  static void create(vpFeaturePoint &s, const vpPoint &p);
102  static void create(vpFeaturePoint &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
103  const vpPoint &p);
104 
105 #ifdef VISP_HAVE_MODULE_BLOB
106  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot &d1, const vpDot &d2);
107  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot2 &d1, const vpDot2 &d2);
108 #endif
109  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpImagePoint &ip1,
110  const vpImagePoint &ip2);
111  static void create(vpFeatureSegment &s, vpPoint &P1, vpPoint &P2);
112 
113 // create vpFeaturePointPolar feature
114 #ifdef VISP_HAVE_MODULE_BLOB
115  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot &dot);
116  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot2 &dot);
117 #endif
118  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpImagePoint &iP);
119  static void create(vpFeaturePointPolar &s, const vpPoint &p);
120  static void create(vpFeaturePointPolar &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
121  const vpPoint &p);
122 
123  // create vpFeaturePoint3D feature
124  static void create(vpFeaturePoint3D &s, const vpPoint &p);
125 
126  // create vpFeatureLine feature
127  static void create(vpFeatureLine &s, const vpLine &l);
128  static void create(vpFeatureLine &s, const vpCylinder &c, const int line);
129 
130 #ifdef VISP_HAVE_MODULE_ME
131  static void create(vpFeatureLine &s, const vpCameraParameters &cam, const vpMeLine &mel);
132 #endif
133 
135  static void create(vpFeatureEllipse &s, const vpCircle &c);
136  static void create(vpFeatureEllipse &s, const vpSphere &sphere);
137 #ifdef VISP_HAVE_MODULE_BLOB
138  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot &d);
139  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot2 &d);
140 #endif
141 
142 #ifdef VISP_HAVE_MODULE_ME
143  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpMeEllipse &d);
144 #endif
145 
150  static void create(vpFeatureVanishingPoint &s, const vpPoint &p);
155  static void create(vpFeatureVanishingPoint &s, const vpFeatureLine &l1, const vpFeatureLine &l2);
160  static void create(vpFeatureVanishingPoint &s, const vpLine &l1, const vpLine &l2);
161 };
162 
163 #endif
vpFeaturePoint3D
Class that defines the 3D point visual feature.
Definition: vpFeaturePoint3D.h:207
vpFeatureEllipse
Class that defines 2D ellipse visual feature.
Definition: vpFeatureEllipse.h:57
vpCameraParameters
Generic class defining intrinsic camera parameters.
Definition: vpCameraParameters.h:232
vpFeaturePointPolar
Class that defines 2D image point visual feature with polar coordinates described in .
Definition: vpFeaturePointPolar.h:259
vpDot2
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
Definition: vpDot2.h:125
vpFeatureSegment
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
Definition: vpFeatureSegment.h:72
vpCircle
Class that defines what is a circle.
Definition: vpCircle.h:57
vpFeatureBuilder
Class that defines conversion between trackers and visual features.
Definition: vpFeatureBuilder.h:91
vpFeatureVanishingPoint
Class that defines 2D vanishing point visual feature (Z coordinate in 3D space is infinity).
Definition: vpFeatureVanishingPoint.h:60
vpCylinder
Class that defines what is a cylinder.
Definition: vpCylinder.h:95
vpMeEllipse
Class that tracks an ellipse moving edges.
Definition: vpMeEllipse.h:105
vpFeatureLine
Class that defines a 2D line visual feature which is composed by two parameters that are and ,...
Definition: vpFeatureLine.h:194
vpLine
Class that defines a line in the object frame, the camera frame and the image plane....
Definition: vpLine.h:104
vpImagePoint
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:87
vpSphere
Class that defines what is a sphere.
Definition: vpSphere.h:59
vpFeaturePoint
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Definition: vpFeaturePoint.h:180
vpPoint
Class that defines what is a point.
Definition: vpPoint.h:57
vpDot
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage.
Definition: vpDot.h:116
vpMeLine
Class that tracks in an image a line moving edges.
Definition: vpMeLine.h:150