Visual Servoing Platform  version 3.6.1 under development (2025-02-08)
vpMbtMeLine.h
1 /*
2  * ViSP, open source Visual Servoing Platform software.
3  * Copyright (C) 2005 - 2023 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  * Implementation of a line used by the model-based tracker.
32  */
33 
39 #ifndef VP_MBT_ME_LINE_H
40 #define VP_MBT_ME_LINE_H
41 
42 #include <visp3/core/vpConfig.h>
43 #include <visp3/core/vpPoint.h>
44 #include <visp3/me/vpMe.h>
45 #include <visp3/me/vpMeLine.h>
46 
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 
49 BEGIN_VISP_NAMESPACE
55 class VISP_EXPORT vpMbtMeLine : public vpMeLine
56 {
57 public:
58  int imin, imax;
59  int jmin, jmax;
60  double expecteddensity;
61 
62 public:
63  vpMbtMeLine();
64  vpMbtMeLine(const vpMbtMeLine &meline);
65 
66  void computeProjectionError(const vpImage<unsigned char> &_I, double &_sumErrorRad, unsigned int &_nbFeatures,
67  const vpMatrix &SobelX, const vpMatrix &SobelY, bool display, unsigned int length,
68  unsigned int thickness);
69 
70  void display(const vpImage<unsigned char> & /* I */, const vpColor &/* col */, unsigned int /* thickness */) { ; }
72 
79  inline double get_a() const { return m_a; }
80 
87  inline double get_b() const { return m_b; }
88 
95  inline double get_c() const { return m_c; }
96 
97  void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
98  double theta, bool doNoTrack);
99 
100  void track(const vpImage<unsigned char> &I);
101 
102  void updateParameters(const vpImage<unsigned char> &I, double rho, double theta);
103  void updateParameters(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
104  double theta);
105 
106 private:
107  virtual unsigned int seekExtremities(const vpImage<unsigned char> &I) VP_OVERRIDE;
108 
109  void suppressPoints(const vpImage<unsigned char> &I);
110  // void reSample(const vpImage<unsigned char> &image);
111  void reSample(const vpImage<unsigned char> &image, const vpImagePoint &ip1, const vpImagePoint &ip2);
112 };
113 END_VISP_NAMESPACE
114 #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
115 
116 #endif
Class to define RGB colors available for display functionalities.
Definition: vpColor.h:157
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition: vpImagePoint.h:82
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
Class that tracks in an image a line moving edges.
Definition: vpMeLine.h:153
void display(const vpImage< unsigned char > &I, const vpColor &color, unsigned int thickness=1)
Definition: vpMeLine.cpp:197
void reSample(const vpImage< unsigned char > &I)
Definition: vpMeLine.cpp:596
double m_c
Parameter c of the line equation a*i + b*j + c = 0.
Definition: vpMeLine.h:488
void track(const vpImage< unsigned char > &I)
Definition: vpMeLine.cpp:683
double m_a
Parameter a of the line equation a*i + b*j + c = 0.
Definition: vpMeLine.h:486
double m_b
Parameter b of the line equation a*i + b*j + c = 0.
Definition: vpMeLine.h:487
void initTracking(const vpImage< unsigned char > &I)
Definition: vpMeLine.cpp:207
virtual unsigned int seekExtremities(const vpImage< unsigned char > &I)
Definition: vpMeLine.cpp:471
void display(const vpImage< unsigned char > &I)