Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpFeatureMomentCInvariant.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See https://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Implementation for all supported moment features.
33 *
34 * Authors:
35 * Filip Novotny
36 *
37*****************************************************************************/
43#ifndef _vpFeatureMomentCInvariant_h_
44#define _vpFeatureMomentCInvariant_h_
45
46#include <visp3/visual_features/vpFeatureMoment.h>
47
48#ifdef VISP_MOMENTS_COMBINE_MATRICES
95class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment
96{
97public:
109 vpFeatureMomentCInvariant(vpMomentDatabase &moments, double A, double B, double C,
110 vpFeatureMomentDatabase *featureMoments = NULL)
111 : vpFeatureMoment(moments, A, B, C, featureMoments, 16)
112 {
113 }
114 void compute_interaction();
118 const char *momentName() const { return "vpMomentCInvariant"; }
122 const char *name() const { return "vpFeatureMomentCInvariant"; }
123
127 static unsigned int selectC1() { return 1 << 0; }
131 static unsigned int selectC2() { return 1 << 1; }
135 static unsigned int selectC3() { return 1 << 2; }
139 static unsigned int selectC4() { return 1 << 3; }
143 static unsigned int selectC5() { return 1 << 4; }
147 static unsigned int selectC6() { return 1 << 5; }
151 static unsigned int selectC7() { return 1 << 6; }
155 static unsigned int selectC8() { return 1 << 7; }
159 static unsigned int selectC9() { return 1 << 8; }
163 static unsigned int selectC10() { return 1 << 9; }
167 static unsigned int selectSx() { return 1 << 10; }
171 static unsigned int selectSy() { return 1 << 11; }
175 static unsigned int selectPx() { return 1 << 12; }
179 static unsigned int selectPy() { return 1 << 13; }
180};
181
182#else
183class vpMomentDatabase;
184
232{
233private:
234 std::vector<vpMatrix> LI;
235
236public:
248 vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_,
249 vpFeatureMomentDatabase *featureMoments = NULL)
250 : vpFeatureMoment(data_base, A_, B_, C_, featureMoments, 16), LI(16)
251 {
252 }
253
254 void compute_interaction();
258 const char *momentName() const { return "vpMomentCInvariant"; }
262 const char *name() const { return "vpFeatureMomentCInvariant"; }
263
267 static unsigned int selectC1() { return 1 << 0; }
271 static unsigned int selectC2() { return 1 << 1; }
275 static unsigned int selectC3() { return 1 << 2; }
279 static unsigned int selectC4() { return 1 << 3; }
283 static unsigned int selectC5() { return 1 << 4; }
287 static unsigned int selectC6() { return 1 << 5; }
291 static unsigned int selectC7() { return 1 << 6; }
295 static unsigned int selectC8() { return 1 << 7; }
299 static unsigned int selectC9() { return 1 << 8; }
303 static unsigned int selectC10() { return 1 << 9; }
307 static unsigned int selectSx() { return 1 << 10; }
311 static unsigned int selectSy() { return 1 << 11; }
315 static unsigned int selectPx() { return 1 << 12; }
319 static unsigned int selectPy() { return 1 << 13; }
320
324 void printLsofInvariants(std::ostream &os) const;
325
326 friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpFeatureMomentCInvariant &featcinv);
327};
328#endif
329#endif
Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature....
vpFeatureMomentCInvariant(vpMomentDatabase &data_base, double A_, double B_, double C_, vpFeatureMomentDatabase *featureMoments=NULL)
This class allows to register all feature moments (implemented in vpFeatureMoment....
This class defines shared system methods/attributes for 2D moment features but no functional code....
virtual const char * momentName() const =0
virtual const char * name() const =0
friend VISP_EXPORT std::ostream & operator<<(std::ostream &os, const vpFeatureMoment &featM)
virtual void compute_interaction(void)
This class allows to register all vpMoments so they can access each other according to their dependen...