Visual Servoing Platform  version 3.6.1 under development (2024-11-14)
vpFeatureBuilder.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 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 https://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 *****************************************************************************/
35 
41 #ifndef vpFeatureBuilder_H
42 #define vpFeatureBuilder_H
43 
44 
45 #include <visp3/core/vpConfig.h>
46 
47 // tracker
48 #ifdef VISP_HAVE_MODULE_BLOB
49 #include <visp3/blob/vpDot.h>
50 #include <visp3/blob/vpDot2.h>
51 #endif
52 
53 #ifdef VISP_HAVE_MODULE_ME
54 #include <visp3/me/vpMeEllipse.h>
55 #include <visp3/me/vpMeLine.h>
56 #endif
57 
58 // forward projection tracker
59 #include <visp3/core/vpCircle.h>
60 #include <visp3/core/vpCylinder.h>
61 #include <visp3/core/vpLine.h>
62 #include <visp3/core/vpPoint.h>
63 #include <visp3/core/vpSphere.h>
64 
65 // visual feature
66 #include <visp3/visual_features/vpFeatureEllipse.h>
67 #include <visp3/visual_features/vpFeatureLine.h>
68 #include <visp3/visual_features/vpFeaturePoint.h>
69 #include <visp3/visual_features/vpFeaturePoint3D.h>
70 #include <visp3/visual_features/vpFeaturePointPolar.h>
71 #include <visp3/visual_features/vpFeatureSegment.h>
72 #include <visp3/visual_features/vpFeatureThetaU.h>
73 #include <visp3/visual_features/vpFeatureTranslation.h>
74 #include <visp3/visual_features/vpFeatureVanishingPoint.h>
75 
76 // others
77 #include <visp3/core/vpImagePoint.h>
78 
79 // pixel / meter conversion
80 #include <visp3/core/vpCameraParameters.h>
81 #include <visp3/core/vpMeterPixelConversion.h>
82 #include <visp3/core/vpPixelMeterConversion.h>
83 
84 BEGIN_VISP_NAMESPACE
91 class VISP_EXPORT vpFeatureBuilder
92 {
93 public:
94 // create vpFeaturePoint feature
95 #ifdef VISP_HAVE_MODULE_BLOB
96  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d);
97  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot2 &d);
98 #endif
99  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t);
100  static void create(vpFeaturePoint &s, const vpPoint &p);
101  static void create(vpFeaturePoint &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
102  const vpPoint &p);
103 
104 #ifdef VISP_HAVE_MODULE_BLOB
105  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot &d1, const vpDot &d2);
106  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot2 &d1, const vpDot2 &d2);
107 #endif
108  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpImagePoint &ip1,
109  const vpImagePoint &ip2);
110  static void create(vpFeatureSegment &s, vpPoint &P1, vpPoint &P2);
111 
112 // create vpFeaturePointPolar feature
113 #ifdef VISP_HAVE_MODULE_BLOB
114  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot &dot);
115  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot2 &dot);
116 #endif
117  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpImagePoint &iP);
118  static void create(vpFeaturePointPolar &s, const vpPoint &p);
119  static void create(vpFeaturePointPolar &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
120  const vpPoint &p);
121 
122  // create vpFeaturePoint3D feature
123  static void create(vpFeaturePoint3D &s, const vpPoint &p);
124 
125  // create vpFeatureLine feature
126  static void create(vpFeatureLine &s, const vpLine &l);
127  static void create(vpFeatureLine &s, const vpCylinder &c, int line);
128 
129 #ifdef VISP_HAVE_MODULE_ME
130  static void create(vpFeatureLine &s, const vpCameraParameters &cam, const vpMeLine &mel);
131 #endif
132 
134  static void create(vpFeatureEllipse &s, const vpCircle &c);
135  static void create(vpFeatureEllipse &s, const vpSphere &sphere);
136 #ifdef VISP_HAVE_MODULE_BLOB
137  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot &blob);
138  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot2 &blob);
139 #endif
140 
141 #ifdef VISP_HAVE_MODULE_ME
142  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpMeEllipse &ellipse);
143 #endif
144 
145  // To keep compat with previous releases, we set cartesian coordinates as default initialising select var to selectX()
146  // or selectY()
147  static void create(vpFeatureVanishingPoint &s, const vpPoint &p,
149  static void create(vpFeatureVanishingPoint &s, const vpFeatureLine &l1, const vpFeatureLine &l2,
151  static void create(vpFeatureVanishingPoint &s, const vpLine &l1, const vpLine &l2,
153  // This function is new that's why select is not initialized
154  static void create(vpFeatureVanishingPoint &s, const vpCameraParameters &cam, const vpImagePoint &line1_ip1,
155  const vpImagePoint &line1_ip2, const vpImagePoint &line2_ip1, const vpImagePoint &line2_ip2,
156  unsigned int select);
157 };
158 END_VISP_NAMESPACE
159 #endif
Generic class defining intrinsic camera parameters.
Class that defines a 3D circle in the object frame and allows forward projection of a 3D circle in th...
Definition: vpCircle.h:87
Class that defines a 3D cylinder in the object frame and allows forward projection of a 3D cylinder i...
Definition: vpCylinder.h:101
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
Definition: vpDot2.h:125
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage.
Definition: vpDot.h:116
Class that defines conversion between trackers and visual features.
Class that defines 2D ellipse visual feature.
Class that defines a 2D line visual feature which is composed by two parameters that are and ,...
Class that defines the 3D point visual feature.
Class that defines 2D image point visual feature with polar coordinates described in .
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
static unsigned int selectX()
Select visual feature .
static unsigned int selectY()
Select visual feature .
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:82
Class that defines a 3D line in the object frame and allows forward projection of the line in the cam...
Definition: vpLine.h:103
Class that tracks an ellipse using moving edges.
Definition: vpMeEllipse.h:96
Class that tracks in an image a line moving edges.
Definition: vpMeLine.h:152
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition: vpPoint.h:79
Class that defines a 3D sphere in the object frame and allows forward projection of a 3D sphere in th...
Definition: vpSphere.h:80