Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpMbtDistanceCircle.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4 *
5 * This software is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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 https://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 * Manage a circle used in the model-based tracker.
32 */
33
38
39#ifndef vpMbtDistanceCircle_HH
40#define vpMbtDistanceCircle_HH
41
42#include <visp3/core/vpConfig.h>
43#include <visp3/core/vpCircle.h>
44#include <visp3/core/vpHomogeneousMatrix.h>
45#include <visp3/core/vpPoint.h>
46#include <visp3/mbt/vpMbHiddenFaces.h>
47#include <visp3/mbt/vpMbtMeEllipse.h>
48#include <visp3/visual_features/vpFeatureEllipse.h>
49
70class VISP_EXPORT vpMbtDistanceCircle
71{
72private:
73 std::string name;
74 unsigned int index;
76 vpMe *me;
77 // double alpha;
78 double wmean;
79 vpFeatureEllipse featureEllipse;
81 // vpMbtPolygon poly;
82 bool isTrackedCircle;
83
84public:
86 vpMbtMeEllipse *meEllipse;
87
90
92 double radius;
93
100
106 unsigned int nbFeature;
108 bool Reinit;
115
116 // private:
117 //#ifndef DOXYGEN_SHOULD_SKIP_THIS
118 // vpMbtDistanceCircle(const vpMbtDistanceCircle &)
119 // : name(), index(0), cam(), me(nullptr), wmean(1),
120 // featureEllipse(), isTrackedCircle(true), meEllipse(nullptr),
121 // circle(nullptr), radius(0.), p1(nullptr), p2(nullptr), p3(nullptr),
122 // L(), error(), nbFeature(0), Reinit(false),
123 // hiddenface(nullptr), index_polygon(-1), isvisible(false)
124 // {
125 // throw vpException(vpException::functionNotImplementedError, "Not
126 // implemented!");
127 // }
128 // vpMbtDistanceCircle &operator=(const vpMbtDistanceCircle &){
129 // throw vpException(vpException::functionNotImplementedError, "Not
130 // implemented!"); return *this;
131 // }
132 //#endif
133
134#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
135 vpMbtDistanceCircle(const vpMbtDistanceCircle &) = delete; // non construction-copyable
136 vpMbtDistanceCircle &operator=(const vpMbtDistanceCircle &) = delete; // non copyable
137#endif
138
139public:
141 virtual ~vpMbtDistanceCircle();
142
143 void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, double r);
144
146
147 void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
148 const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false);
149 void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
150 const vpColor &col, unsigned int thickness = 1, bool displayFullModel = false);
152 void displayMovingEdges(const vpImage<vpRGBa> &I);
153
159 inline void getCameraParameters(vpCameraParameters &camera) { camera = this->cam; }
160
166 inline unsigned int getIndex() { return index; }
167
175 inline double getMeanWeight() const { return wmean; }
176
177 std::vector<std::vector<double> > getFeaturesForDisplay();
178
179 std::vector<double> getModelForDisplay(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam,
180 bool displayFullModel = false);
181
187 inline std::string getName() const { return name; }
188
189 void initInteractionMatrixError();
190
191 bool initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, bool doNotTrack,
192 const vpImage<bool> *mask = nullptr, const int &initRange = 1U);
193
199 inline bool isTracked() const { return isTrackedCircle; }
200
206 inline bool isVisible() const { return isvisible; }
207
208 void reinitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo,
209 const vpImage<bool> *mask = nullptr);
210
215 inline void setCameraParameters(const vpCameraParameters &camera) { this->cam = camera; }
216
222 inline void setTracked(const bool &track) { this->isTrackedCircle = track; }
223
229 inline void setIndex(unsigned int i) { index = i; }
230
236 inline void setMeanWeight(double _wmean) { this->wmean = _wmean; }
237
238 void setMovingEdge(vpMe *Me);
239
245 inline void setName(const std::string &circle_name) { this->name = circle_name; }
246
252 inline void setName(const char *circle_name) { this->name = std::string(circle_name); }
253
260 inline void setVisible(bool _isvisible) { isvisible = _isvisible; }
261
262 void trackMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
263
264 void updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo);
265
266private:
267 void project(const vpHomogeneousMatrix &cMo);
268};
269END_VISP_NAMESPACE
270#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
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
Definition vpColor.h:157
Class that defines 2D ellipse visual feature.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition of the vpImage class member functions.
Definition vpImage.h:131
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
Implementation of the polygons management for the model-based trackers.
void setVisible(bool _isvisible)
void setName(const char *circle_name)
void setCameraParameters(const vpCameraParameters &camera)
vpColVector error
The error vector.
vpMbHiddenFaces< vpMbtPolygon > * hiddenface
Pointer to the list of faces.
vpPoint * p1
The center of the circle.
unsigned int nbFeature
The number of moving edges.
vpMatrix L
The interaction matrix.
void getCameraParameters(vpCameraParameters &camera)
vpMbtDistanceCircle & operator=(const vpMbtDistanceCircle &)=delete
void setIndex(unsigned int i)
std::string getName() const
void computeInteractionMatrixError(const vpHomogeneousMatrix &cMo)
vpCircle * circle
The circle to track.
void buildFrom(const vpPoint &_p1, const vpPoint &_p2, const vpPoint &_p3, double r)
vpPoint * p2
A point on the plane containing the circle.
void setMeanWeight(double _wmean)
bool isvisible
Indicates if the circle is visible or not.
void displayMovingEdges(const vpImage< unsigned char > &I)
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)
bool Reinit
Indicates if the circle has to be reinitialized.
double radius
The radius of the circle.
int index_polygon
Index of the faces which contain the line.
vpPoint * p3
An other point on the plane containing the circle.
vpMbtMeEllipse * meEllipse
The moving edge containers.
void setName(const std::string &circle_name)
vpMbtDistanceCircle(const vpMbtDistanceCircle &)=delete
void setTracked(const bool &track)
Definition vpMe.h:143
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition vpPoint.h:79