Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpFeatureMoment.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
* Base for all moment features
32
*/
33
41
#ifndef _vpFeatureMoment_h_
42
#define _vpFeatureMoment_h_
43
44
#include <vector>
45
#include <string>
46
#include <visp3/core/vpConfig.h>
47
#include <visp3/core/vpException.h>
48
#include <visp3/visual_features/vpBasicFeature.h>
49
50
BEGIN_VISP_NAMESPACE
51
class
vpMomentObject
;
52
class
vpMomentDatabase
;
53
class
vpFeatureMomentDatabase
;
54
class
vpMoment
;
55
161
class
VISP_EXPORT
vpFeatureMoment
:
public
vpBasicFeature
162
{
163
protected
:
164
const
vpMoment
*
moment
;
165
const
vpMoment
&
getMoment
()
const
{
return
*
moment
; }
166
vpMomentDatabase
&
moments
;
167
vpFeatureMomentDatabase
*
featureMomentsDataBase
;
168
std::vector<vpMatrix>
interaction_matrices
;
169
170
double
A
;
171
double
B
;
172
double
C
;
173
std::string
m_name
;
174
175
// private:
176
//#ifndef DOXYGEN_SHOULD_SKIP_THIS
177
// vpFeatureMoment(const vpFeatureMoment &fm)
178
// : vpBasicFeature(), moment(nullptr), moments(fm.moments),
179
// featureMomentsDataBase(nullptr),
180
// interaction_matrices(), A(0), B(0), C(0)
181
// {
182
// throw vpException(vpException::functionNotImplementedError, "Not
183
// implemented!");
184
// }
185
// vpFeatureMoment &operator=(const vpFeatureMoment &){
186
// throw vpException(vpException::functionNotImplementedError, "Not
187
// implemented!"); return *this;
188
// }
189
//#endif
190
#if !defined(VISP_MOMENTS_COMBINE_MATRICES)
191
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
192
vpFeatureMoment
(
const
vpFeatureMoment
&) =
delete
;
// non construction-copyable
193
vpFeatureMoment
&
operator=
(
const
vpFeatureMoment
&) =
delete
;
// non copyable
194
#endif
195
#endif
196
197
public
:
212
vpFeatureMoment
(
vpMomentDatabase
&data_base,
double
A_ = 0.0,
double
B_ = 0.0,
double
C_ = 0.0,
213
vpFeatureMomentDatabase
*featureMoments =
nullptr
,
unsigned
int
nbmatrices = 1)
214
:
vpBasicFeature
(),
moment
(nullptr),
moments
(data_base),
featureMomentsDataBase
(featureMoments),
215
interaction_matrices
(nbmatrices),
A
(A_),
B
(B_),
C
(C_),
m_name
()
216
{ }
217
220
virtual
void
compute_interaction(
void
);
221
222
vpBasicFeature
*
duplicate
() const VP_OVERRIDE;
223
void
display(const
vpCameraParameters
&cam, const
vpImage
<
unsigned
char
> &I, const
vpColor
&color =
vpColor
::green,
224
unsigned
int
thickness = 1) const VP_OVERRIDE;
225
void
display(const
vpCameraParameters
&cam, const
vpImage
<
vpRGBa
> &I, const
vpColor
&color =
vpColor
::green,
226
unsigned
int
thickness = 1) const VP_OVERRIDE;
227
228
int
getDimension(
unsigned
int
select = FEATURE_ALL) const;
229
void
init(
void
) VP_OVERRIDE;
230
vpMatrix
interaction(
unsigned
int
select = FEATURE_ALL) VP_OVERRIDE;
231
232
void
linkTo(
vpFeatureMomentDatabase
&featureMoments);
233
238
virtual const std::
string
momentName
() const = 0;
239
243
virtual const std::
string
name
() const = 0;
244
245
void
print
(
unsigned
int
select =
FEATURE_ALL
) const VP_OVERRIDE;
246
virtual
void
printDependencies
(std::ostream &os) const;
247
248
void
update
(
double
A
,
double
B
,
double
C
);
249
251
friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const
vpFeatureMoment
&featM);
252
};
253
271
class VISP_EXPORT
vpMomentGenericFeature
: public
vpFeatureMoment
272
{
273
public
:
274
vpMomentGenericFeature
(
vpMomentDatabase
&data_base,
double
A_,
double
B_,
double
C_,
275
vpFeatureMomentDatabase
*featureMoments,
const
vpMoment
*p_moment)
276
:
vpFeatureMoment
(data_base, A_, B_, C_, featureMoments)
277
{
278
this->moment = p_moment;
279
}
280
284
const
std::string
momentName
()
const
{
return
std::string(); }
285
289
virtual
const
std::string
name
()
const
{
return
std::string(); }
290
};
291
END_VISP_NAMESPACE
292
#endif
vpBasicFeature
class that defines what is a visual feature
Definition
vpBasicFeature.h:77
vpBasicFeature::duplicate
virtual vpBasicFeature * duplicate() const =0
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
vpColor
Class to define RGB colors available for display functionalities.
Definition
vpColor.h:157
vpFeatureMomentDatabase
This class allows to register all feature moments (implemented in vpFeatureMoment....
Definition
vpFeatureMomentDatabase.h:159
vpFeatureMoment::m_name
std::string m_name
Definition
vpFeatureMoment.h:173
vpFeatureMoment::C
double C
Definition
vpFeatureMoment.h:172
vpFeatureMoment::vpFeatureMoment
vpFeatureMoment(vpMomentDatabase &data_base, double A_=0.0, double B_=0.0, double C_=0.0, vpFeatureMomentDatabase *featureMoments=nullptr, unsigned int nbmatrices=1)
Definition
vpFeatureMoment.h:212
vpFeatureMoment::printDependencies
virtual void printDependencies(std::ostream &os) const
Definition
vpFeatureMoment.cpp:259
vpFeatureMoment::B
double B
Definition
vpFeatureMoment.h:171
vpFeatureMoment::interaction_matrices
std::vector< vpMatrix > interaction_matrices
Definition
vpFeatureMoment.h:168
vpFeatureMoment::featureMomentsDataBase
vpFeatureMomentDatabase * featureMomentsDataBase
Definition
vpFeatureMoment.h:167
vpFeatureMoment::moments
vpMomentDatabase & moments
Definition
vpFeatureMoment.h:166
vpFeatureMoment::getMoment
const vpMoment & getMoment() const
Definition
vpFeatureMoment.h:165
vpFeatureMoment::A
double A
Definition
vpFeatureMoment.h:170
vpFeatureMoment::moment
const vpMoment * moment
Definition
vpFeatureMoment.h:164
vpFeatureMoment::vpFeatureMoment
vpFeatureMoment(const vpFeatureMoment &)=delete
vpFeatureMoment::print
void print(unsigned int select=FEATURE_ALL) const VP_OVERRIDE
Definition
vpFeatureMoment.cpp:95
vpFeatureMoment::name
virtual const std::string name() const =0
vpFeatureMoment::update
void update(double A, double B, double C)
Definition
vpFeatureMoment.cpp:148
vpFeatureMoment::momentName
virtual const std::string momentName() const =0
vpFeatureMoment::operator=
vpFeatureMoment & operator=(const vpFeatureMoment &)=delete
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
vpMomentDatabase
This class allows to register all vpMoments so they can access each other according to their dependen...
Definition
vpMomentDatabase.h:133
vpMomentGenericFeature::vpMomentGenericFeature
vpMomentGenericFeature(vpMomentDatabase &data_base, double A_, double B_, double C_, vpFeatureMomentDatabase *featureMoments, const vpMoment *p_moment)
Definition
vpFeatureMoment.h:274
vpMomentGenericFeature::momentName
const std::string momentName() const
Definition
vpFeatureMoment.h:284
vpMomentGenericFeature::name
virtual const std::string name() const
Definition
vpFeatureMoment.h:289
vpMomentObject
Class for generic objects.
Definition
vpMomentObject.h:225
vpMoment
This class defines shared methods/attributes for 2D moments.
Definition
vpMoment.h:106
vpRGBa
Definition
vpRGBa.h:74
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
visual_features
include
visp3
visual_features
vpFeatureMoment.h
Generated by
1.17.0