This file is indexed.

/usr/include/visp/vpMeEllipse.h is in libvisp-dev 2.8.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
/****************************************************************************
 *
 * $Id: vpMeEllipse.h 4231 2013-04-29 16:26:28Z fspindle $
 *
 * This file is part of the ViSP software.
 * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
 * 
 * This software is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * ("GPL") version 2 as published by the Free Software Foundation.
 * See the file LICENSE.txt at the root directory of this source
 * distribution for additional information about the GNU GPL.
 *
 * For using ViSP with software that can not be combined with the GNU
 * GPL, please contact INRIA about acquiring a ViSP Professional 
 * Edition License.
 *
 * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
 * 
 * This software was developed at:
 * INRIA Rennes - Bretagne Atlantique
 * Campus Universitaire de Beaulieu
 * 35042 Rennes Cedex
 * France
 * http://www.irisa.fr/lagadic
 *
 * If you have questions regarding the use of this file, please contact
 * INRIA at visp@inria.fr
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * Description:
 * Moving edges.
 *
 * Authors:
 * Eric Marchand
 *
 *****************************************************************************/

/*!
  \file vpMeEllipse.h
  \brief Moving edges on an ellipse
*/

#ifndef vpMeEllipse_HH
#define vpMeEllipse_HH

#include <visp/vpMatrix.h>
#include <visp/vpColVector.h>

#include <visp/vpMeTracker.h>
#include <visp/vpMeSite.h>
#include <visp/vpImagePoint.h>

#include <visp/vpImage.h>
#include <visp/vpColor.h>

#include <math.h>
#include <list>

/*!
  \class vpMeEllipse 
  \ingroup TrackingImageME

  \brief Class that tracks an ellipse moving edges.

  In this class, an ellipse is defined as the set of points \f$ (i,j) \f$ of the image frame (For more information about the image frame see the vpImagePoint documentation) that satisfy the implicit equation :

  \f[ i^2 + K_0j^2 + 2K_1ij + 2K_2i + 2K_3j + K4 = 0 \f]

  If \f$ K_0 \f$ is equal to 1 and \f$ K_1 \f$ is equal to 0 the the set of points \f$ (i,j) \f$ represents a circle.

  The five parameters are stored in the public attribute K.

  An ellipse is also defined thanks to three other parameter which are \f$ a \f$, \f$ b \f$ and \f$ e \f$. \f$ a \f$ represents the semiminor axis and \f$ b \f$ is the semimajor axis. Here \f$ e \f$ is the angle made by the
  major axis and the i axis of the image frame \f$ (i,j) \f$. The following figure shows better meaning of those parameters.

  \image html vpMeEllipse.gif
  \image latex vpMeEllipse.ps  width=10cm

  It is possible to compute the coordinates \f$ (i,j) \f$ of a point which belongs to the ellipse thanks to the following equations :

  \f[ i = i_c + b cos(e) cos(\alpha) - a sin(e) sin(\alpha) \f]
  \f[ j = j_c + b sin(e) cos(\alpha) + a cos(e) sin(\alpha) \f]

  Here the coordinates \f$ (i_c,j_c) \f$ are the coordinates of the ellipse center in the image frame and \f$ \alpha \f$ is an angle beetween \f$ [0,2\pi] \f$ and which enables to describe all the points of the ellipse.

  \image html vpMeEllipse2.gif
  \image latex vpMeEllipse2.ps  width=10cm

  The example below available in tutorial-me-ellipse-tracker.cpp and described
  in \ref tutorial-tracking-me, section \ref tracking_me_ellipse shows how to use this class.

  \include tutorial-me-ellipse-tracker.cpp

  */
/*
  The code below shows how to use this class.
\code
#include <visp/vpConfig.h>
#include <visp/vpImage.h>
#include <visp/vpMeEllipse.h>
#include <visp/vpImagePoint.h>

int main()
{
  vpImage<unsigned char> I;

  // I is the image containing the ellipse to track
    
  // Set the moving-edges tracker parameters
  vpMe me;
  me.setRange(25);
  me.setPointsToTrack(20);
  me.setThreshold(15000);
  me.setSampleStep(10);

  // Initialize the moving-edges ellipse tracker parameters
  vpMeEllipse ellipse;
  ellipse.setMe(&me);

  // Initialize the tracking. You have to click on five different points belonging to the ellipse.
  ellipse.initTracking(I);

  while ( 1 )
  {
    // ... Here the code to read or grab the next image.

    // Track the ellipse.
    ellipse.track(I);
  }
  return 0;
}
\endcode

  \note It is possible to display the ellipse as an overlay. For that you 
  must use the display function of the class vpMeEllipse.
*/

class VISP_EXPORT vpMeEllipse : public vpMeTracker
{
public:
  vpMeEllipse() ;
  vpMeEllipse(const vpMeEllipse &meellipse) ;
  virtual ~vpMeEllipse() ;

  void track(const vpImage<unsigned char>& Im);

  void initTracking(const vpImage<unsigned char> &I) ;
  void initTracking(const vpImage<unsigned char> &I, const unsigned int n,
		    vpImagePoint* iP) ;
  void display(const vpImage<unsigned char>&I, vpColor col) ;
  void printParameters() ;

#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
  /*!
    @name Deprecated functions
  */
  //@{
  void initTracking(const vpImage<unsigned char> &I, const unsigned int n,
		    unsigned *i, unsigned *j) ;
  //@}
#endif //VISP_BUILD_DEPRECATED_FUNCTIONS

  /*!
      Set to true if you are sure to track a circle.

      \warning During all the tracking, the shape must be approximatively a circle and not an ellipse with a strong difference between the majoraxis and the minoraxis.

      In that case, the set of points \f$ (i,j) \f$ satisfy the implicit equation :

      \f[ i^2 + j^2 + 2K_2i + 2K_3j + K4 = 0 \f]

      Compared to the classical equation of an ellipse, \f$ K_0 \f$ is equal to 1 and \f$ K_1 \f$ is equal to 0.

      \param circle : Set to true if you want to track a circle.
  */
  void setCircle(bool circle) { this->circle = circle ; }
  
  /*!
    Gets the 0 order moment \f$ m_{00} \f$ which represents the area of the ellipse.
    
    \return the value of \f$ m_{00} \f$.
  */
  inline double get_m00() const {return m00;}
  
  /*!
    Gets the 1 order raw moment \f$ m_{10} \f$ with \f$ m_{nm} = \sum_{i,j}i^n j^m \f$.
    
    \return the value of \f$ m_{10} \f$.
  */
  inline double get_m10() const {return m10;}
  
  /*!
    Gets the 1 order raw moment \f$ m_{01} \f$ with \f$ m_{nm} = \sum_{i,j}i^n j^m \f$.
    
    \return the value of \f$ m_{01} \f$.
  */
  inline double get_m01() const {return m01;}
  
  /*!
    Gets the 2 order raw moment \f$ m_{11} \f$ with \f$ m_{nm} = \sum_{i,j}i^n j^m \f$.
    
    \return the value of \f$ m_{11} \f$.
  */
  inline double get_m11() const {return m11;}
  
  /*!
    Gets the 2 order raw moment \f$ m_{20} \f$ with \f$ m_{nm} = \sum_{i,j}i^n j^m \f$.
    
    \return the value of \f$ m_{11} \f$.
  */
  inline double get_m20() const {return m20;}
  
  /*!
    Gets the 2 order raw moment \f$ m_{02} \f$ with \f$ m_{nm} = \sum_{i,j}i^n j^m \f$.
    
    \return the value of \f$ m_{11} \f$.
  */
  inline double get_m02() const {return m02;}
  
  /*!
    Gets the 2 order central moment \f$ \mu_{11} \f$.
    
    \return the value of \f$ \mu_{11} \f$.
  */
  inline double get_mu11() const {return mu11;}
  
  /*!
    Gets the 2 order central moment \f$ \mu_{02} \f$.
    
    \return the value of \f$ \mu_{02} \f$.
  */
  inline double get_mu02() const {return mu02;}
  
  /*!
    Gets the 2 order central moment \f$ \mu_{20} \f$.
    
    \return the value of \f$ \mu_{20} \f$.
  */
  inline double get_mu20() const {return mu20;}
  
  /*!
    Gets the center of the ellipse.
  */
  inline vpImagePoint getCenter() const {return iPc; }
  
  /*!
    Gets the semiminor axis of the ellipse.
  */
  inline double getA() const {return a; }
  
  /*!
    Gets the semimajor axis of the ellipse.
  */
  inline double getB() const {return b; }
  
  /*!
    Gets the angle made by the major axis and the i axis of the image frame \f$ (i,j) \f$
  */
  inline double getE() const {return e; }
  
  /*!
    Gets the equation parameters of the ellipse
  */
  void getEquationParam(double &A, double &B, double &E) { A = a; B = b; E = e; }
  
  /*!
    Gets the smallest \f$ alpha \f$ angle
  */
  inline double getSmallestAngle() { return alpha1; }
  
  /*!
    Gets the highest \f$ alpha \f$ angle
  */
  inline double getHighestAngle() { return alpha2; }
  
	/*!
		Set the new threshold for the robust estimation of the parameters of the
		ellipse equation.
		If the weight of a point is below this threshold, this one is removed from
		the list of tracked meSite.
		Value must be between 0 (never rejected) and 1 (always rejected).

		\param threshold : The new value of the threshold.
	*/
	void setThresholdRobust(const double threshold){
		if(threshold<0){
			thresholdWeight = 0;
		}else if(threshold>1){
			thresholdWeight = 1;
		}else{
			thresholdWeight = threshold;
		}
	}



#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
public:
#else
protected:
#endif
  /*! Parameters of the ellipse to define the set of points that satisfy the implicit equation :
   \f[ i^2 + K_0j^2 + 2K_1ij + 2K_2i + 2K_3j + K4 = 0 \f]
  */
  vpColVector K ;
  //! The coordinates of the ellipse center.
  vpImagePoint iPc;
  //! \f$ a \f$ is the semiminor axis of the ellipse.
  double a;
  //! \f$ b \f$ is the semimajor axis of the ellipse.
  double b;
  //! \f$ e \f$ is the angle made by the major axis and the i axis of the image frame \f$ (i,j) \f$.
  double e;
	
protected:
  //! The coordinates of the point corresponding to the smallest \f$ alpha \f$ angle. More things about the \f$ alpha \f$ are given at the beginning of the class description.
  vpImagePoint iP1;
  //! The coordinates of the point corresponding to the highest \f$ alpha \f$ angle. More things about the \f$ alpha \f$ are given at the beginning of the class description.
  vpImagePoint iP2;
  //! The smallest \f$ alpha \f$ angle.
  double alpha1 ;
  //! The highest \f$ alpha \f$ angle.
  double alpha2 ;
  //! Value of cos(e).
  double ce;
  //! Value of sin(e).
  double se;
  //! Stores the value of the \f$ alpha \f$ angle for each vpMeSite.
  std::list<double> angle;
  //! Surface
  double m00;
  //! Second order central moments
  double mu11,mu20, mu02;
  //! First order raw moments
  double m10,m01;
  //! Second order raw moments
  double m11,m02,m20;
  //! Threshold for the robust least square.
  double thresholdWeight;

private:
  //! True if the ellipse to track is a circle
  bool circle ;

  void computeAngle(vpImagePoint pt1, vpImagePoint pt2);
  void sample(const vpImage<unsigned char>&image);
  void reSample(const vpImage<unsigned char> &I) ;
  void leastSquare() ;
  void updateTheta();
  void suppressPoints() ;
  void seekExtremities(const vpImage<unsigned char> &I) ;
  void setExtremities();
  void getParameters() ;
  void computeMoments();

#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
  /*!
    @name Deprecated functions
  */
  //@{
  void computeAngle(int ip1, int jp1,int ip2, int jp2) ;
  void computeAngle(int ip1, int jp1, double &alpha1,
		    int ip2, int jp2, double &alpha2) ;
  //@}
#endif //VISP_BUILD_DEPRECATED_FUNCTIONS

//Static Function
public:	
  static void display(const vpImage<unsigned char>& I, const vpImagePoint &center,
                      const double &A, const double &B, const double &E,
                      const double & smallalpha, const double &highalpha,
                      vpColor color = vpColor::green);
  static void display(const vpImage<vpRGBa>& I, const vpImagePoint &center,
                      const double &A, const double &B, const double &E,
                      const double & smallalpha, const double &highalpha,
                      vpColor color = vpColor::green);

};

#endif