Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpMomentCInvariant.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
* Descriptor for various invariants used to drive space rotations around X and
32
* Y axis.
33
*/
34
40
#ifndef VP_MOMENT_CINVARIANT_H
41
#define VP_MOMENT_CINVARIANT_H
42
43
#include <visp3/core/vpConfig.h>
44
#include <visp3/core/vpMoment.h>
45
#include <visp3/core/vpMomentDatabase.h>
46
47
BEGIN_VISP_NAMESPACE
48
class
vpMomentCentered
;
49
class
vpMomentBasic
;
50
128
class
VISP_EXPORT
vpMomentCInvariant
:
public
vpMoment
129
{
130
private
:
131
std::vector<double> I;
132
std::vector<double> II;
133
std::vector<double> c;
134
std::vector<double> s;
135
double
K;
136
void
computeI(
const
vpMomentCentered
&momentCentered, std::vector<double> &I);
137
138
/* To calculate Sx and Sy from normalized moments */
139
void
calcSxSy(
double
&sx,
double
&sy)
const
;
140
void
calcSxSyNormalized(
double
&sx,
double
&sy)
const
;
141
std::vector<double> cn;
// same as s above but calculated from normalized moments
142
std::vector<double> sn;
// same as c above but calculated from normalized moments
143
double
In1;
// same as I1 in Sx,Sy formulae but calculated from normalized
144
// moments
145
bool
flg_sxsynormalization_;
146
147
public
:
148
VP_EXPLICIT
vpMomentCInvariant
(
bool
flg_sxsynormalization =
false
);
149
153
double
C1
()
const
{
return
values
[0]; }
157
double
C2
()
const
{
return
values
[1]; }
161
double
C3
()
const
{
return
values
[2]; }
165
double
C4
()
const
{
return
values
[3]; }
169
double
C5
()
const
{
return
values
[4]; }
173
double
C6
()
const
{
return
values
[5]; }
177
double
C7
()
const
{
return
values
[6]; }
181
double
C8
()
const
{
return
values
[7]; }
185
double
C9
()
const
{
return
values
[8]; }
189
double
C10
()
const
{
return
values
[9]; }
190
191
void
compute
() VP_OVERRIDE;
192
199
double
get
(
unsigned
int
i)
const
{
return
values
[i]; }
200
204
double
getC
(
unsigned
int
i)
const
{
return
c[i]; }
208
double
getI
(
unsigned
int
index)
const
{
return
I[index]; }
209
213
void
printInvariants(std::ostream &os)
const
;
214
218
double
getII
(
unsigned
int
i)
const
{
return
II[i]; }
222
double
getK
()
const
{
return
K; }
223
227
double
getS
(
unsigned
int
i)
const
{
return
s[i]; }
228
232
const
std::string
name
() const VP_OVERRIDE {
return
"vpMomentCInvariant"
; }
233
237
void
printI(
unsigned
int
index);
238
242
double
Px
() {
return
values
[12]; }
246
double
Py
() {
return
values
[13]; }
247
251
double
Sx
()
const
{
return
values
[10]; }
255
double
Sy
()
const
{
return
values
[11]; }
256
261
double
getIn1
()
const
{
return
In1; }
262
267
double
getCN
(
unsigned
int
i)
const
{
return
cn[i]; }
268
273
double
getSN
(
unsigned
int
i)
const
{
return
sn[i]; }
274
278
bool
isSxSyfromNormalizedMoments
()
const
{
return
flg_sxsynormalization_; }
279
283
inline
const
std::vector<double> &
getMomentVector
()
const
{
return
values
; }
284
285
friend
VISP_EXPORT std::ostream &
operator<<
(std::ostream &os,
const
vpMomentCInvariant
&v);
286
};
287
END_VISP_NAMESPACE
288
#endif
vpMomentBasic
This class defines the 2D basic moment . This class is a wrapper for vpMomentObject which allows to u...
Definition
vpMomentBasic.h:73
vpMomentCInvariant
Definition
vpMomentCInvariant.h:129
vpMomentCInvariant::vpMomentCInvariant
VP_EXPLICIT vpMomentCInvariant(bool flg_sxsynormalization=false)
Definition
vpMomentCInvariant.cpp:44
vpMomentCInvariant::getMomentVector
const std::vector< double > & getMomentVector() const
Definition
vpMomentCInvariant.h:283
vpMomentCInvariant::C4
double C4() const
Definition
vpMomentCInvariant.h:165
vpMomentCInvariant::C10
double C10() const
Definition
vpMomentCInvariant.h:189
vpMomentCInvariant::get
double get(unsigned int i) const
Definition
vpMomentCInvariant.h:199
vpMomentCInvariant::C8
double C8() const
Definition
vpMomentCInvariant.h:181
vpMomentCInvariant::C6
double C6() const
Definition
vpMomentCInvariant.h:173
vpMomentCInvariant::getI
double getI(unsigned int index) const
Definition
vpMomentCInvariant.h:208
vpMomentCInvariant::Py
double Py()
Definition
vpMomentCInvariant.h:246
vpMomentCInvariant::getS
double getS(unsigned int i) const
Definition
vpMomentCInvariant.h:227
vpMomentCInvariant::isSxSyfromNormalizedMoments
bool isSxSyfromNormalizedMoments() const
Definition
vpMomentCInvariant.h:278
vpMomentCInvariant::name
const std::string name() const VP_OVERRIDE
Definition
vpMomentCInvariant.h:232
vpMomentCInvariant::getIn1
double getIn1() const
Definition
vpMomentCInvariant.h:261
vpMomentCInvariant::Px
double Px()
Definition
vpMomentCInvariant.h:242
vpMomentCInvariant::C9
double C9() const
Definition
vpMomentCInvariant.h:185
vpMomentCInvariant::getK
double getK() const
Definition
vpMomentCInvariant.h:222
vpMomentCInvariant::getCN
double getCN(unsigned int i) const
Definition
vpMomentCInvariant.h:267
vpMomentCInvariant::C7
double C7() const
Definition
vpMomentCInvariant.h:177
vpMomentCInvariant::getC
double getC(unsigned int i) const
Definition
vpMomentCInvariant.h:204
vpMomentCInvariant::Sy
double Sy() const
Definition
vpMomentCInvariant.h:255
vpMomentCInvariant::C3
double C3() const
Definition
vpMomentCInvariant.h:161
vpMomentCInvariant::C2
double C2() const
Definition
vpMomentCInvariant.h:157
vpMomentCInvariant::getSN
double getSN(unsigned int i) const
Definition
vpMomentCInvariant.h:273
vpMomentCInvariant::C1
double C1() const
Definition
vpMomentCInvariant.h:153
vpMomentCInvariant::Sx
double Sx() const
Definition
vpMomentCInvariant.h:251
vpMomentCInvariant::getII
double getII(unsigned int i) const
Definition
vpMomentCInvariant.h:218
vpMomentCInvariant::C5
double C5() const
Definition
vpMomentCInvariant.h:169
vpMomentCentered
This class defines the double-indexed centered moment descriptor .
Definition
vpMomentCentered.h:77
vpMoment::values
std::vector< double > values
Definition
vpMoment.h:113
vpMoment::compute
virtual void compute()=0
vpMoment::operator<<
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpMoment &m)
Definition
vpMoment.cpp:50
vpMoment::vpMoment
vpMoment(const vpMoment &)=delete
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
core
include
visp3
core
vpMomentCInvariant.h
Generated by
1.17.0