ViSP
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Functions
Variables
Enumerations
Enumerator
Friends
Groups
Pages
vpMbEdgeKltTracker.h
1
/****************************************************************************
2
*
3
* $Id: vpMbEdgeKltTracker.h 4338 2013-07-23 14:29:30Z 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
* Description:
34
* Hybrid tracker based on edges (vpMbt) and points of interests (KLT)
35
*
36
* Authors:
37
* Romain Tallonneau
38
* Aurelien Yol
39
*
40
*****************************************************************************/
41
47
#ifndef vpMbEdgeKltTracker_HH
48
#define vpMbEdgeKltTracker_HH
49
50
#include <visp/vpConfig.h>
51
52
#ifdef VISP_HAVE_OPENCV
53
54
#include <visp/vpRobust.h>
55
#include <visp/vpSubMatrix.h>
56
#include <visp/vpSubColVector.h>
57
#include <visp/vpExponentialMap.h>
58
#include <visp/vpMbtXmlParser.h>
59
#include <visp/vpMbTracker.h>
60
#include <visp/vpKltOpencv.h>
61
#include <visp/vpMbEdgeTracker.h>
62
#include <visp/vpPoseVector.h>
63
#include <visp/vpMbKltTracker.h>
64
226
class
VISP_EXPORT
vpMbEdgeKltTracker
:
public
vpMbKltTracker
,
public
vpMbEdgeTracker
227
{
228
protected
:
230
bool
compute_interaction
;
232
double
lambda
;
234
double
thresholdKLT
;
236
double
thresholdMBT
;
238
unsigned
int
maxIter
;
239
240
public
:
241
242
vpMbEdgeKltTracker
();
243
virtual
~
vpMbEdgeKltTracker
();
244
245
virtual
void
display
(
const
vpImage<unsigned char>
& I,
const
vpHomogeneousMatrix
&cMo,
const
vpCameraParameters
&cam,
246
const
vpColor
& col ,
const
unsigned
int
thickness=1,
const
bool
displayFullModel =
false
);
247
virtual
void
display
(
const
vpImage<vpRGBa>
& I,
const
vpHomogeneousMatrix
&cMo,
const
vpCameraParameters
&cam,
248
const
vpColor
& col ,
const
unsigned
int
thickness=1,
const
bool
displayFullModel =
false
);
249
251
virtual
inline
double
getAngleAppear
()
const
{
return
vpMbKltTracker::getAngleAppear
(); }
252
254
virtual
inline
double
getAngleDisappear
()
const
{
return
vpMbKltTracker::getAngleDisappear
(); }
255
263
virtual
inline
unsigned
int
getClipping
()
const
{
return
vpMbKltTracker::clippingFlag
; }
264
266
inline
vpMbHiddenFaces<vpMbtKltPolygon>
&
getFaces
() {
return
vpMbKltTracker::faces
;}
267
273
virtual
inline
double
getFarClippingDistance
()
const
{
return
vpMbKltTracker::getFarClippingDistance
(); }
274
280
virtual
inline
double
getLambda
()
const
{
return
lambda
;}
281
287
virtual
inline
unsigned
int
getMaxIter
()
const
{
return
maxIter
;}
288
294
virtual
inline
double
getNearClippingDistance
()
const
{
return
vpMbKltTracker::getNearClippingDistance
(); }
295
296
void
loadConfigFile
(
const
char
* configFile);
297
virtual
void
loadConfigFile
(
const
std::string& configFile);
298
virtual
void
loadModel
(
const
std::string& modelFile);
299
300
void
resetTracker
();
301
311
virtual
inline
void
setAngleAppear
(
const
double
&a) {
vpMbKltTracker::setAngleAppear
(a); }
312
322
virtual
inline
void
setAngleDisappear
(
const
double
&a) {
vpMbKltTracker::setAngleDisappear
(a); }
323
324
virtual
void
setCameraParameters
(
const
vpCameraParameters
& cam);
325
333
virtual
void
setClipping
(
const
unsigned
int
&flags) {
vpMbEdgeTracker::setClipping
(flags);
vpMbKltTracker::setClipping
(flags);}
334
340
virtual
void
setFarClippingDistance
(
const
double
&dist) {
vpMbEdgeTracker::setFarClippingDistance
(dist);
vpMbKltTracker::setFarClippingDistance
(dist); }
341
347
virtual
inline
void
setLambda
(
const
double
lambda) {this->lambda =
lambda
;
vpMbEdgeTracker::setLambda
(lambda);
vpMbKltTracker::setLambda
(lambda);}
348
354
virtual
inline
void
setMaxIter
(
const
unsigned
int
max) {maxIter = max;}
355
361
virtual
void
setNearClippingDistance
(
const
double
&dist) {
vpMbEdgeTracker::setNearClippingDistance
(dist);
vpMbKltTracker::setNearClippingDistance
(dist); }
362
370
virtual
inline
void
setOgreVisibilityTest
(
const
bool
&v) {
vpMbKltTracker::setOgreVisibilityTest
(v); }
371
372
virtual
void
setPose
(
const
vpImage<unsigned char>
&I,
const
vpHomogeneousMatrix
& cdMo);
373
374
virtual
void
testTracking
(){};
375
virtual
void
track
(
const
vpImage<unsigned char>
& I);
376
377
protected
:
378
void
computeVVS
(
const
vpImage<unsigned char>
& I,
const
unsigned
int
&nbInfos,
vpColVector
&w_mbt,
379
vpColVector
&w_klt,
const
unsigned
int
lvl=0);
380
381
virtual
void
init
(
const
vpImage<unsigned char>
& I);
382
virtual
void
initCylinder
(
const
vpPoint
& ,
const
vpPoint
,
const
double
,
const
unsigned
int
);
383
virtual
void
initFaceFromCorners
(
const
std::vector<vpPoint>& corners,
const
unsigned
int
indexFace = -1);
384
unsigned
int
initMbtTracking(
const
unsigned
int
level=0);
385
386
bool
postTracking
(
const
vpImage<unsigned char>
& I,
vpColVector
&w_mbt,
vpColVector
&w_klt,
387
const
unsigned
int
lvl=0);
388
void
postTrackingMbt(
vpColVector
&w,
const
unsigned
int
level=0);
389
390
unsigned
int
trackFirstLoop(
const
vpImage<unsigned char>
& I,
vpColVector
&factor,
const
unsigned
int
lvl = 0);
391
void
trackSecondLoop(
const
vpImage<unsigned char>
& I,
vpMatrix
&L,
vpColVector
&_error,
392
vpHomogeneousMatrix
& cMo,
const
unsigned
int
lvl=0);
393
};
394
395
#endif
396
397
#endif //VISP_HAVE_OPENCV
src
tracking
mbt
hybrid
vpMbEdgeKltTracker.h
Generated on Thu Nov 7 2013 03:14:08 for ViSP by
1.8.4