Visual Servoing Platform  version 3.6.1 under development (2024-04-19)
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 
36 #ifndef vpFeatureBuilder_H
37 #define vpFeatureBuilder_H
38 
43 #include <visp3/core/vpConfig.h>
44 
45 // tracker
46 #ifdef VISP_HAVE_MODULE_BLOB
47 #include <visp3/blob/vpDot.h>
48 #include <visp3/blob/vpDot2.h>
49 #endif
50 
51 #ifdef VISP_HAVE_MODULE_ME
52 #include <visp3/me/vpMeEllipse.h>
53 #include <visp3/me/vpMeLine.h>
54 #endif
55 
56 // forward projection tracker
57 #include <visp3/core/vpCircle.h>
58 #include <visp3/core/vpCylinder.h>
59 #include <visp3/core/vpLine.h>
60 #include <visp3/core/vpPoint.h>
61 #include <visp3/core/vpSphere.h>
62 
63 // visual feature
64 #include <visp3/visual_features/vpFeatureEllipse.h>
65 #include <visp3/visual_features/vpFeatureLine.h>
66 #include <visp3/visual_features/vpFeaturePoint.h>
67 #include <visp3/visual_features/vpFeaturePoint3D.h>
68 #include <visp3/visual_features/vpFeaturePointPolar.h>
69 #include <visp3/visual_features/vpFeatureSegment.h>
70 #include <visp3/visual_features/vpFeatureThetaU.h>
71 #include <visp3/visual_features/vpFeatureTranslation.h>
72 #include <visp3/visual_features/vpFeatureVanishingPoint.h>
73 
74 // others
75 #include <visp3/core/vpImagePoint.h>
76 
77 // pixel / meter conversion
78 #include <visp3/core/vpCameraParameters.h>
79 #include <visp3/core/vpMeterPixelConversion.h>
80 #include <visp3/core/vpPixelMeterConversion.h>
81 
88 class VISP_EXPORT vpFeatureBuilder
89 {
90 public:
91 // create vpFeaturePoint feature
92 #ifdef VISP_HAVE_MODULE_BLOB
93  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d);
94  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot2 &d);
95 #endif
96  static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t);
97  static void create(vpFeaturePoint &s, const vpPoint &p);
98  static void create(vpFeaturePoint &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
99  const vpPoint &p);
100 
101 #ifdef VISP_HAVE_MODULE_BLOB
102  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot &d1, const vpDot &d2);
103  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot2 &d1, const vpDot2 &d2);
104 #endif
105  static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpImagePoint &ip1,
106  const vpImagePoint &ip2);
107  static void create(vpFeatureSegment &s, vpPoint &P1, vpPoint &P2);
108 
109 // create vpFeaturePointPolar feature
110 #ifdef VISP_HAVE_MODULE_BLOB
111  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot &dot);
112  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot2 &dot);
113 #endif
114  static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpImagePoint &iP);
115  static void create(vpFeaturePointPolar &s, const vpPoint &p);
116  static void create(vpFeaturePointPolar &s, const vpCameraParameters &goodCam, const vpCameraParameters &wrongCam,
117  const vpPoint &p);
118 
119  // create vpFeaturePoint3D feature
120  static void create(vpFeaturePoint3D &s, const vpPoint &p);
121 
122  // create vpFeatureLine feature
123  static void create(vpFeatureLine &s, const vpLine &l);
124  static void create(vpFeatureLine &s, const vpCylinder &c, int line);
125 
126 #ifdef VISP_HAVE_MODULE_ME
127  static void create(vpFeatureLine &s, const vpCameraParameters &cam, const vpMeLine &mel);
128 #endif
129 
131  static void create(vpFeatureEllipse &s, const vpCircle &c);
132  static void create(vpFeatureEllipse &s, const vpSphere &sphere);
133 #ifdef VISP_HAVE_MODULE_BLOB
134  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot &blob);
135  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot2 &blob);
136 #endif
137 
138 #ifdef VISP_HAVE_MODULE_ME
139  static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpMeEllipse &ellipse);
140 #endif
141 
142  // To keep compat with previous releases, we set cartesian coordinates as default initialising select var to selectX()
143  // or selectY()
144  static void create(vpFeatureVanishingPoint &s, const vpPoint &p,
146  static void create(vpFeatureVanishingPoint &s, const vpFeatureLine &l1, const vpFeatureLine &l2,
148  static void create(vpFeatureVanishingPoint &s, const vpLine &l1, const vpLine &l2,
150  // This function is new that's why select is not initialized
151  static void create(vpFeatureVanishingPoint &s, const vpCameraParameters &cam, const vpImagePoint &line1_ip1,
152  const vpImagePoint &line1_ip2, const vpImagePoint &line2_ip1, const vpImagePoint &line2_ip2,
153  unsigned int select);
154 };
155 #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:86
Class that defines a 3D cylinder in the object frame and allows forward projection of a 3D cylinder i...
Definition: vpCylinder.h:99
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
Definition: vpDot2.h:124
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage.
Definition: vpDot.h:112
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:101
Class that tracks an ellipse using moving edges.
Definition: vpMeEllipse.h:94
Class that tracks in an image a line moving edges.
Definition: vpMeLine.h:147
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition: vpPoint.h:77
Class that defines a 3D sphere in the object frame and allows forward projection of a 3D sphere in th...
Definition: vpSphere.h:78