Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpRBSilhouetteControlPoint.h
1/*
2 * ViSP, open source Visual Servoing Platform software.
3 * Copyright (C) 2005 - 2024 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
35
36#ifndef VP_RB_SILHOUETTE_CONTROL_POINT_H
37#define VP_RB_SILHOUETTE_CONTROL_POINT_H
38
39#include <visp3/core/vpConfig.h>
40
41#include <visp3/core/vpPoint.h>
42#include <visp3/core/vpPlane.h>
43#include <visp3/core/vpLine.h>
44#include <visp3/core/vpImagePoint.h>
45#include <visp3/core/vpCameraParameters.h>
46#include <visp3/me/vpMe.h>
47#include <visp3/visual_features/vpFeatureLine.h>
48#include <visp3/me/vpMeSite.h>
49#include <visp3/core/vpDisplay.h>
50
52
66{
67private:
68
69 double rho, theta;
70 double thetaInit;
71 int m_meMaskSign;
72 //double a,b,c;
73 vpFeatureLine m_lineFeature;
74 vpLine m_line;
75
76 std::vector<vpMeSite> m_candidates;
77 unsigned int m_numCandidates;
78 const vpMe *m_me;
79 vpMeSite m_site;
80
82 vpColVector m_normal;
83 vpColVector m_normalO;
84
85 bool m_valid;
86 bool m_isSilhouette;
87
88 const vpCameraParameters *m_cam;
89
90public:
91
93
94 // the 3D point
97
98 double xs, ys, nxs, nys, Zs;
99
100public:
101
102 void init();
109
115 void setNumCandidates(unsigned numCandidates) { m_numCandidates = numCandidates; }
116 unsigned getNumCandidates() const { return m_numCandidates; }
117 void setValid(bool valid) { m_valid = valid; }
118 bool isValid() const { return m_valid; }
119
120 const vpCameraParameters &getCameraParameters() const { return *m_cam; }
121 bool siteIsValid() const { return m_site.getState() == vpMeSite::NO_SUPPRESSION; }
122 const vpMeSite &getSite() const { return m_site; }
123 vpMeSite &getSite() { return m_site; }
124 const vpFeatureLine &getFeatureLine() const { return m_lineFeature; }
125 const vpLine &getLine() const { return m_line; }
126 double getTheta() const { return theta; }
127 bool isSilhouette() const { return m_isSilhouette; }
128
129 void initControlPoint(const vpImage<unsigned char> &I, double cvlt);
130 void buildPoint(int n, int m, const double &Z, double orient, const vpColVector &normo, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &oMc, const vpCameraParameters &cam, const vpMe &me, bool isSilhouette);
131 void buildSilhouettePoint(int n, int m, const double &Z, double orient, const vpColVector &normo, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &oMc, const vpCameraParameters &cam);
132
133 void update(const vpHomogeneousMatrix &_cMo);
134 void updateSilhouettePoint(const vpHomogeneousMatrix &_cMo, const vpRotationMatrix &cRo);
135
141 void track(const vpImage<unsigned char> &I);
142
150 void trackMultipleHypotheses(const vpImage<unsigned char> &I);
151
152 void computeMeInteractionMatrixError(const vpHomogeneousMatrix &cMo, unsigned int i, vpMatrix &L, vpColVector &e);
153 void computeMeInteractionMatrixErrorMH(const vpHomogeneousMatrix &cMo, unsigned int i, vpMatrix &L, vpColVector &e);
154
155 double getMaxMaskGradientAlongLine(const vpImage<float> &mask, int searchSize) const;
156
157 bool tooCloseToBorder(unsigned int h, unsigned int w, int searchSize) const;
158
159private:
160 bool isLineDegenerate() const;
161
162 void buildPlane(const vpPoint &pointn, const vpColVector &normal, vpPlane &plane);
163 void buildPLine(const vpHomogeneousMatrix &oMc);
164
165};
166
167END_VISP_NAMESPACE
168
169#endif
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Class that defines a 2D line visual feature which is composed by two parameters that are and ,...
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
Definition vpImage.h:131
Class that defines a 3D line in the object frame and allows forward projection of the line in the cam...
Definition vpLine.h:103
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'....
Definition vpMeSite.h:75
@ NO_SUPPRESSION
Point successfully tracked.
Definition vpMeSite.h:93
Definition vpMe.h:143
This class defines the container for a plane geometrical structure.
Definition vpPlane.h:56
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Definition vpPoint.h:79
const vpCameraParameters & getCameraParameters() const
~vpRBSilhouetteControlPoint()=default
vpRBSilhouetteControlPoint & operator=(const vpRBSilhouetteControlPoint &meTracker)
void setNumCandidates(unsigned numCandidates)
Set the number of candidates to use for multiple hypotheses testing.
const vpFeatureLine & getFeatureLine() const
Implementation of a rotation matrix and operations on such kind of matrices.