Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpMbtMeLine.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 * Implementation of a line used by the model-based tracker.
33 *
34 * Authors:
35 * Romain Tallonneau
36 *
37*****************************************************************************/
38
44#ifndef vpMbtMeLine_HH
45#define vpMbtMeLine_HH
46
47#include <visp3/core/vpPoint.h>
48#include <visp3/me/vpMe.h>
49#include <visp3/me/vpMeTracker.h>
50
51#ifndef DOXYGEN_SHOULD_SKIP_THIS
52
59class VISP_EXPORT vpMbtMeLine : public vpMeTracker
60{
61private:
62 vpMeSite PExt[2];
63 double rho, theta, theta_1;
64 double delta, delta_1;
65 int sign;
66 double a, b, c;
67
68public:
69 int imin, imax;
70 int jmin, jmax;
71 double expecteddensity;
72
73public:
74 vpMbtMeLine();
75 virtual ~vpMbtMeLine();
76
77 void computeProjectionError(const vpImage<unsigned char> &_I, double &_sumErrorRad, unsigned int &_nbFeatures,
78 const vpMatrix &SobelX, const vpMatrix &SobelY, bool display, unsigned int length,
79 unsigned int thickness);
80
81 void display(const vpImage<unsigned char> & /* I */, const vpColor &/* col */, unsigned int /* thickness */) { ; }
83
90 inline double get_a() const { return this->a; }
91
98 inline double get_b() const { return this->b; }
99
106 inline double get_c() const { return this->c; }
107
108 void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
109 double theta, bool doNoTrack);
110
111 void track(const vpImage<unsigned char> &I);
112
113 void updateParameters(const vpImage<unsigned char> &I, double rho, double theta);
114 void updateParameters(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, double rho,
115 double theta);
116
117private:
118 void bubbleSortI();
119 void bubbleSortJ();
120 virtual void sample(const vpImage<unsigned char> &image, bool doNotTrack = false);
121 void seekExtremities(const vpImage<unsigned char> &I);
122 void setExtremities();
123 void suppressPoints(const vpImage<unsigned char> &I);
124 void reSample(const vpImage<unsigned char> &image);
125 void reSample(const vpImage<unsigned char> &image, const vpImagePoint &ip1, const vpImagePoint &ip2);
126 void updateDelta();
127};
128
129#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS
130
131#endif
Class to define RGB colors available for display functionalities.
Definition vpColor.h:152
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:135
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:152
Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'....
Definition vpMeSite.h:65
Contains abstract elements for a Distance to Feature type feature.
Definition vpMeTracker.h:60
void initTracking(const vpImage< unsigned char > &I)
virtual void sample(const vpImage< unsigned char > &image, bool doNotTrack=false)=0
void track(const vpImage< unsigned char > &I)
void display(const vpImage< unsigned char > &I)