Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpBasicFeature.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2025 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
* Visual feature.
32
*
33
* Authors:
34
* Nicolas Mansard
35
*/
36
41
42
#ifndef vpBasicFeature_H
43
#define vpBasicFeature_H
44
45
#include <visp3/core/vpConfig.h>
46
#include <visp3/core/vpColVector.h>
47
#include <visp3/core/vpMatrix.h>
48
49
// Display Issue
50
51
// Meter/pixel conversion
52
#include <visp3/core/vpCameraParameters.h>
53
54
// Color / image / display
55
#include <visp3/core/vpColor.h>
56
#include <visp3/core/vpImage.h>
57
#include <visp3/core/vpRGBa.h>
58
59
// #define FEATURE_ALL 0xff
60
61
// #define FEATURE_LINE1 0x1
62
// #define FEATURE_LINE2 0x2
63
// #define FEATURE_LINE3 0x4
64
// #define FEATURE_LINE4 0x8
65
// #define FEATURE_LINE5 0x10
66
// #define FEATURE_LINE6 0x20
67
// #define FEATURE_LINE7 0x40
68
// #define FEATURE_LINE8 0x80
69
70
BEGIN_VISP_NAMESPACE
76
class
VISP_EXPORT
vpBasicFeature
77
{
78
public
:
79
static
const
unsigned
int
FEATURE_LINE
[32];
80
81
enum
vpBasicFeatureSelect
{
FEATURE_ALL
= 0xffff };
86
typedef
enum
{
user
,
vpServo
} vpBasicFeatureDeallocatorType;
87
88
protected
:
90
vpColVector
s
;
92
unsigned
int
dim_s
;
93
// int featureLine[8] ;
96
bool
*
flags
;
98
unsigned
int
nbParameters
;
99
100
public
:
101
vpBasicFeature
();
102
vpBasicFeature
(
const
vpBasicFeature
&f);
103
virtual
~vpBasicFeature
();
104
107
108
unsigned
int
dimension_s
() {
return
dim_s
; }
109
110
virtual
void
display
(
const
vpCameraParameters
&cam,
const
vpImage<unsigned char>
&I,
111
const
vpColor
&color =
vpColor::green
,
unsigned
int
thickness = 1)
const
= 0;
112
virtual
void
display
(
const
vpCameraParameters
&cam,
const
vpImage<vpRGBa>
&I,
const
vpColor
&color =
vpColor::green
,
113
unsigned
int
thickness = 1)
const
= 0;
114
115
virtual
void
init
() = 0;
116
117
virtual
vpColVector
error
(
const
vpBasicFeature
&s_star,
unsigned
int
select =
FEATURE_ALL
);
118
119
// Get the feature vector.
120
vpColVector
get_s
(
unsigned
int
select =
FEATURE_ALL
)
const
;
121
vpBasicFeatureDeallocatorType
getDeallocate
() {
return
deallocate
; }
122
123
// Get the feature vector dimension.
124
unsigned
int
getDimension(
unsigned
int
select = FEATURE_ALL)
const
;
126
virtual
vpMatrix
interaction
(
unsigned
int
select =
FEATURE_ALL
) = 0;
128
virtual
inline
double
operator[]
(
unsigned
int
i)
const
{
return
s
[i]; }
129
vpBasicFeature
&operator=(
const
vpBasicFeature
&f);
131
virtual
void
print
(
unsigned
int
select =
FEATURE_ALL
)
const
= 0;
132
133
virtual
vpBasicFeature
*
duplicate
()
const
= 0;
134
135
void
setDeallocate
(
vpBasicFeatureDeallocatorType
d) {
deallocate
= d; }
136
void
setFlags();
138
140
static
unsigned
int
selectAll
() {
return
FEATURE_ALL
; }
141
142
protected
:
143
void
resetFlags();
144
145
protected
:
146
vpBasicFeatureDeallocatorType
deallocate
;
147
};
148
END_VISP_NAMESPACE
149
#endif
vpBasicFeature
class that defines what is a visual feature
Definition
vpBasicFeature.h:77
vpBasicFeature::error
virtual vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
Definition
vpBasicFeature.cpp:150
vpBasicFeature::flags
bool * flags
Definition
vpBasicFeature.h:96
vpBasicFeature::vpBasicFeatureDeallocatorType
vpBasicFeatureDeallocatorType
Definition
vpBasicFeature.h:86
vpBasicFeature::user
@ user
Definition
vpBasicFeature.h:86
vpBasicFeature::vpServo
@ vpServo
Definition
vpBasicFeature.h:86
vpBasicFeature::s
vpColVector s
State of the visual feature.
Definition
vpBasicFeature.h:90
vpBasicFeature::getDeallocate
vpBasicFeatureDeallocatorType getDeallocate()
Definition
vpBasicFeature.h:121
vpBasicFeature::init
virtual void init()=0
vpBasicFeature::nbParameters
unsigned int nbParameters
Number of parameters needed to compute the interaction matrix.
Definition
vpBasicFeature.h:98
vpBasicFeature::display
virtual void display(const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
vpBasicFeature::interaction
virtual vpMatrix interaction(unsigned int select=FEATURE_ALL)=0
Compute the interaction matrix from a subset of the possible features.
vpBasicFeature::selectAll
static unsigned int selectAll()
Select all the features.
Definition
vpBasicFeature.h:140
vpBasicFeature::setDeallocate
void setDeallocate(vpBasicFeatureDeallocatorType d)
Definition
vpBasicFeature.h:135
vpBasicFeature::print
virtual void print(unsigned int select=FEATURE_ALL) const =0
Print the name of the feature.
vpBasicFeature::operator[]
virtual double operator[](unsigned int i) const
Return element i in the state vector (usage : x = s[i] ).
Definition
vpBasicFeature.h:128
vpBasicFeature::get_s
vpColVector get_s(unsigned int select=FEATURE_ALL) const
Get the feature vector .
Definition
vpBasicFeature.cpp:113
vpBasicFeature::display
virtual void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const =0
vpBasicFeature::dimension_s
unsigned int dimension_s()
Definition
vpBasicFeature.h:108
vpBasicFeature::duplicate
virtual vpBasicFeature * duplicate() const =0
vpBasicFeature::dim_s
unsigned int dim_s
Dimension of the visual feature.
Definition
vpBasicFeature.h:92
vpBasicFeature::FEATURE_LINE
static const unsigned int FEATURE_LINE[32]
Definition
vpBasicFeature.h:45
vpBasicFeature::deallocate
vpBasicFeatureDeallocatorType deallocate
Definition
vpBasicFeature.h:146
vpBasicFeature::vpBasicFeatureSelect
vpBasicFeatureSelect
Definition
vpBasicFeature.h:81
vpBasicFeature::FEATURE_ALL
@ FEATURE_ALL
Definition
vpBasicFeature.h:81
vpBasicFeature::vpBasicFeature
vpBasicFeature()
Definition
vpBasicFeature.cpp:59
vpCameraParameters
Generic class defining intrinsic camera parameters.
Definition
vpCameraParameters.h:311
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpColor
Class to define RGB colors available for display functionalities.
Definition
vpColor.h:157
vpColor::green
static const vpColor green
Definition
vpColor.h:201
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
vpMatrix
Implementation of a matrix and operations on matrices.
Definition
vpMatrix.h:175
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
visual_features
include
visp3
visual_features
vpBasicFeature.h
Generated by
1.17.0