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