ViSP
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Functions
Variables
Enumerations
Enumerator
Friends
Groups
Pages
vpMeEllipse.h
1
/****************************************************************************
2
*
3
* $Id: vpMeEllipse.h 4062 2013-01-09 10:30:06Z fspindle $
4
*
5
* This file is part of the ViSP software.
6
* Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7
*
8
* This software is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* ("GPL") version 2 as published by the Free Software Foundation.
11
* See the file LICENSE.txt at the root directory of this source
12
* distribution for additional information about the GNU GPL.
13
*
14
* For using ViSP with software that can not be combined with the GNU
15
* GPL, please contact INRIA about acquiring a ViSP Professional
16
* Edition License.
17
*
18
* See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19
*
20
* This software was developed at:
21
* INRIA Rennes - Bretagne Atlantique
22
* Campus Universitaire de Beaulieu
23
* 35042 Rennes Cedex
24
* France
25
* http://www.irisa.fr/lagadic
26
*
27
* If you have questions regarding the use of this file, please contact
28
* INRIA at visp@inria.fr
29
*
30
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32
*
33
*
34
* Description:
35
* Moving edges.
36
*
37
* Authors:
38
* Eric Marchand
39
*
40
*****************************************************************************/
41
47
#ifndef vpMeEllipse_HH
48
#define vpMeEllipse_HH
49
50
#include <visp/vpMatrix.h>
51
#include <visp/vpColVector.h>
52
53
#include <visp/vpMeTracker.h>
54
#include <visp/vpMeSite.h>
55
#include <visp/vpImagePoint.h>
56
57
#include <visp/vpImage.h>
58
#include <visp/vpColor.h>
59
60
#include <math.h>
61
#include <list>
62
135
class
VISP_EXPORT
vpMeEllipse
:
public
vpMeTracker
136
{
137
public
:
138
vpMeEllipse
() ;
139
vpMeEllipse
(
const
vpMeEllipse
&meellipse) ;
140
virtual
~
vpMeEllipse
() ;
141
142
void
track
(
const
vpImage<unsigned char>
& Im);
143
144
void
initTracking
(
const
vpImage<unsigned char>
&I) ;
145
void
initTracking
(
const
vpImage<unsigned char>
&I,
const
unsigned
int
n,
146
vpImagePoint
* iP) ;
147
void
display
(
const
vpImage<unsigned char>
&I,
vpColor
col) ;
148
void
printParameters() ;
149
150
#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
151
155
void
initTracking
(
const
vpImage<unsigned char>
&I,
const
unsigned
int
n,
156
unsigned
*i,
unsigned
*j) ;
158
#endif //VISP_BUILD_DEPRECATED_FUNCTIONS
159
173
void
setCircle
(
bool
circle) { this->circle = circle ; }
174
180
inline
double
get_m00
()
const
{
return
m00;}
181
187
inline
double
get_m10
()
const
{
return
m10;}
188
194
inline
double
get_m01
()
const
{
return
m01;}
195
201
inline
double
get_m11
()
const
{
return
m11;}
202
208
inline
double
get_m20
()
const
{
return
m20;}
209
215
inline
double
get_m02
()
const
{
return
m02;}
216
222
inline
double
get_mu11
()
const
{
return
mu11;}
223
229
inline
double
get_mu02
()
const
{
return
mu02;}
230
236
inline
double
get_mu20
()
const
{
return
mu20;}
237
241
inline
vpImagePoint
getCenter
()
const
{
return
iPc; }
242
246
inline
double
getA
()
const
{
return
a; }
247
251
inline
double
getB
()
const
{
return
b; }
252
256
inline
double
getE
()
const
{
return
e; }
257
261
void
getEquationParam
(
double
&A,
double
&B,
double
&E) { A = a; B = b; E = e; }
262
266
inline
double
getSmallestAngle
() {
return
alpha1; }
267
271
inline
double
getHighestAngle
() {
return
alpha2; }
272
282
void
setThresholdRobust
(
const
double
threshold){
283
if
(threshold<0){
284
thresholdWeight = 0;
285
}
else
if
(threshold>1){
286
thresholdWeight = 1;
287
}
else
{
288
thresholdWeight = threshold;
289
}
290
}
291
292
293
294
#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
295
public
:
296
#else
297
protected
:
298
#endif
299
302
vpColVector
K
;
304
vpImagePoint
iPc
;
306
double
a
;
308
double
b
;
310
double
e
;
311
312
protected
:
314
vpImagePoint
iP1
;
316
vpImagePoint
iP2
;
318
double
alpha1
;
320
double
alpha2
;
322
double
ce
;
324
double
se
;
326
std::list<double>
angle
;
328
double
m00
;
330
double
mu11,
mu20
, mu02;
332
double
m10
,m01;
334
double
m11,m02,
m20
;
336
double
thresholdWeight
;
337
338
private
:
340
bool
circle ;
341
342
void
computeAngle(
vpImagePoint
pt1,
vpImagePoint
pt2);
343
void
sample
(
const
vpImage<unsigned char>
&image);
344
void
reSample(
const
vpImage<unsigned char>
&I) ;
345
void
leastSquare() ;
346
void
updateTheta();
347
void
suppressPoints() ;
348
void
seekExtremities(
const
vpImage<unsigned char>
&I) ;
349
void
setExtremities();
350
void
getParameters() ;
351
void
computeMoments();
352
353
#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
354
358
void
computeAngle(
int
ip1,
int
jp1,
int
ip2,
int
jp2) ;
359
void
computeAngle(
int
ip1,
int
jp1,
double
&alpha1,
360
int
ip2,
int
jp2,
double
&alpha2) ;
362
#endif //VISP_BUILD_DEPRECATED_FUNCTIONS
363
364
//Static Function
365
public
:
366
static
void
display
(
const
vpImage<unsigned char>
& I,
const
vpImagePoint
¢er,
367
const
double
&A,
const
double
&B,
const
double
&E,
368
const
double
& smallalpha,
const
double
&highalpha,
369
vpColor
color =
vpColor::green
);
370
static
void
display
(
const
vpImage<vpRGBa>
& I,
const
vpImagePoint
¢er,
371
const
double
&A,
const
double
&B,
const
double
&E,
372
const
double
& smallalpha,
const
double
&highalpha,
373
vpColor
color =
vpColor::green
);
374
375
};
376
377
#endif
src
tracking
moving-edges
vpMeEllipse.h
Generated on Fri Apr 26 2013 19:54:36 for ViSP by
1.8.1.2