Visual Servoing Platform  version 3.0.0
vpFeatureMomentCInvariant.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
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 http://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  * Implementation for all supported moment features.
32  *
33  * Authors:
34  * Filip Novotny
35  *
36  *****************************************************************************/
37 #include <visp3/core/vpMomentObject.h>
38 #ifdef VISP_MOMENTS_COMBINE_MATRICES
39 #include <visp3/visual_features/vpFeatureMomentCInvariant.h>
40 #include <visp3/core/vpMomentCentered.h>
41 #include <visp3/core/vpMomentCInvariant.h>
42 #include <visp3/visual_features/vpFeatureMomentCentered.h>
43 #include <visp3/visual_features/vpFeatureMomentBasic.h>
44 
45 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
46 
47 #include <vector>
48 #include <limits>
49 
50 
61  std::vector<vpMatrix> LI(16);
62  bool found_moment_centered;
63  bool found_moment_cinvariant;
64  bool found_FeatureMoment_centered;
65  bool found_featuremoment_basic;
66 
67  const vpMomentObject& momentObject = moment->getObject();
68  const vpMomentCentered& momentCentered = (static_cast<const vpMomentCentered&>(moments.get("vpMomentCentered",found_moment_centered)));
69  const vpMomentCInvariant& momentCInvariant = (static_cast<const vpMomentCInvariant&>(moments.get("vpMomentCInvariant",found_moment_cinvariant)));
70  vpFeatureMomentCentered& featureMomentCentered = (static_cast<vpFeatureMomentCentered&>(featureMomentsDataBase->get("vpFeatureMomentCentered",found_FeatureMoment_centered)));
71 
72  vpFeatureMomentBasic& featureMomentBasic= (static_cast<vpFeatureMomentBasic&>(featureMomentsDataBase->get("vpFeatureMomentBasic",found_featuremoment_basic)));
73 
74  if(!found_featuremoment_basic) throw vpException(vpException::notInitialized,"vpFeatureMomentBasic not found");
75 
76 
77  if(!found_moment_centered) throw vpException(vpException::notInitialized,"vpMomentCentered not found");
78  if(!found_moment_cinvariant) throw vpException(vpException::notInitialized,"vpMomentCInvariant not found");
79  if(!found_FeatureMoment_centered) throw vpException(vpException::notInitialized,"vpFeatureMomentCentered not found");
80 
81  vpMatrix zeros(1,6);
82  for(int i=0;i<6;i++) zeros[0][i]=0;
83 
84 
85  LI[1]=-featureMomentCentered.interaction(2, 0) * momentCentered.get(0, 2) - momentCentered.get(2, 0) * featureMomentCentered.interaction(0, 2) + 2 * momentCentered.get(1, 1) * featureMomentCentered.interaction(1, 1);
86 
87 
88  LI[2]=2 * (momentCentered.get(2, 0) - momentCentered.get(0, 2)) * (featureMomentCentered.interaction(2, 0) - featureMomentCentered.interaction(0, 2)) + 8 * momentCentered.get(1, 1) * featureMomentCentered.interaction(1, 1);
89 
90 
91  LI[3]=2 * (momentCentered.get(3, 0) - 3 * momentCentered.get(1, 2)) * (featureMomentCentered.interaction(3, 0) - 3 * featureMomentCentered.interaction(1, 2)) + 2 * (3 * momentCentered.get(2, 1) - momentCentered.get(0, 3)) * (3 * featureMomentCentered.interaction(2, 1) - featureMomentCentered.interaction(0, 3));
92 
93 
94  LI[4]=2 * (momentCentered.get(3, 0) + momentCentered.get(1, 2)) * (featureMomentCentered.interaction(3, 0) + featureMomentCentered.interaction(1, 2)) + 2 * (momentCentered.get(2, 1) + momentCentered.get(0, 3)) * (featureMomentCentered.interaction(2, 1) + featureMomentCentered.interaction(0, 3));
95 
96  LI[5]=-2*pow(momentCentered.get(0,3),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)+6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(3,0)-4*pow(momentCentered.get(1,2),3)*featureMomentCentered.interaction(3,0)+6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)-12*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(2,1)+6*pow(momentCentered.get(1,2),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(2,1)+6*momentCentered.get(0,3)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)-12*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)+6*momentCentered.get(1,2)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(1,2)-2*momentCentered.get(0,3)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(0,3)+6*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)-4*pow(momentCentered.get(2,1),3)*featureMomentCentered.interaction(0,3);
97 
98 
99  LI[6]=6*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)+4*pow(momentCentered.get(0,3),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)-6*momentCentered.get(1,2)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(3,0)-6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(3,0)+2*pow(momentCentered.get(1,2),3)*featureMomentCentered.interaction(3,0)-12*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)-6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)+12*pow(momentCentered.get(2,1),3)*featureMomentCentered.interaction(2,1)+6*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(2,1)+6*pow(momentCentered.get(0,3),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(2,1)-6*momentCentered.get(0,3)*pow(momentCentered.get(1,2),2)*featureMomentCentered.interaction(2,1)+6*momentCentered.get(1,2)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(1,2)-6*pow(momentCentered.get(2,1),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)-6*momentCentered.get(0,3)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)+6*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)-12*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(1,2)+12*pow(momentCentered.get(1,2),3)*featureMomentCentered.interaction(1,2)+4*momentCentered.get(0,3)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(0,3)-6*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)+2*pow(momentCentered.get(2,1),3)*featureMomentCentered.interaction(0,3)+6*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(0,3)-6*pow(momentCentered.get(1,2),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(0,3);
100 
101 
102  LI[7] = -3*momentCentered.get(0,3)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(3,0)+6*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)-2*pow(momentCentered.get(2,1),3)*featureMomentCentered.interaction(3,0)-3*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(3,0)+6*pow(momentCentered.get(1,2),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(3,0)+3*momentCentered.get(0,3)*pow(momentCentered.get(1,2),2)*featureMomentCentered.interaction(3,0)+pow(momentCentered.get(0,3),3)*featureMomentCentered.interaction(3,0)+3*momentCentered.get(1,2)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(2,1)-6*pow(momentCentered.get(2,1),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)-6*momentCentered.get(0,3)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)+6*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)-9*momentCentered.get(1,2)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(2,1)-12*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(2,1)+3*pow(momentCentered.get(1,2),3)*featureMomentCentered.interaction(2,1)-3*pow(momentCentered.get(0,3),2)*momentCentered.get(1,2)*featureMomentCentered.interaction(2,1)+3*momentCentered.get(2,1)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(1,2)+12*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)+6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)-3*pow(momentCentered.get(2,1),3)*featureMomentCentered.interaction(1,2)-6*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(1,2)+9*pow(momentCentered.get(1,2),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(1,2)-3*pow(momentCentered.get(0,3),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(1,2)+6*momentCentered.get(0,3)*pow(momentCentered.get(1,2),2)*featureMomentCentered.interaction(1,2)-pow(momentCentered.get(3,0),3)*featureMomentCentered.interaction(0,3)-3*pow(momentCentered.get(2,1),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)+3*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)+3*pow(momentCentered.get(0,3),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)-6*momentCentered.get(1,2)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(0,3)-6*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(0,3)+2*pow(momentCentered.get(1,2),3)*featureMomentCentered.interaction(0,3);
103 
104  LI[8]=-2 * momentCentered.get(3, 0) * momentCentered.get(2, 1) * momentCentered.get(0, 3) * featureMomentCentered.interaction(3, 0) + 6 * momentCentered.get(3, 0) * momentCentered.get(2, 1) * momentCentered.get(1, 2) * featureMomentCentered.interaction(2, 1) - 6 * featureMomentCentered.interaction(3, 0) * momentCentered.get(2, 1) * momentCentered.get(0, 3) * momentCentered.get(1, 2) - 6 * momentCentered.get(3, 0) * featureMomentCentered.interaction(2, 1) * momentCentered.get(0, 3) * momentCentered.get(1, 2) - 6 * momentCentered.get(3, 0) * momentCentered.get(2, 1) * featureMomentCentered.interaction(0, 3) * momentCentered.get(1, 2) - 6 * momentCentered.get(3, 0) * momentCentered.get(2, 1) * momentCentered.get(0, 3) * featureMomentCentered.interaction(1, 2) - 2 * momentCentered.get(3, 0) * momentCentered.get(1, 2) * momentCentered.get(0, 3) * featureMomentCentered.interaction(0, 3) + 6 * momentCentered.get(2, 1) * momentCentered.get(1, 2) * momentCentered.get(0, 3) * featureMomentCentered.interaction(1, 2) - pow((double) momentCentered.get(3, 0), (double) 3) * featureMomentCentered.interaction(1, 2) + 3 * featureMomentCentered.interaction(3, 0) * pow((double) momentCentered.get(1, 2), (double) 3) + 6 * pow((double) momentCentered.get(2, 1), (double) 3) * featureMomentCentered.interaction(0, 3) - featureMomentCentered.interaction(2, 1) * pow((double) momentCentered.get(0, 3), (double) 3) + 3 * featureMomentCentered.interaction(2, 1) * pow((double) momentCentered.get(1, 2), (double) 2) * momentCentered.get(0, 3) + 18 * pow((double) momentCentered.get(2, 1), (double) 2) * momentCentered.get(0, 3) * featureMomentCentered.interaction(2, 1) - pow((double) momentCentered.get(3, 0), (double) 2) * featureMomentCentered.interaction(2, 1) * momentCentered.get(0, 3) + 9 * momentCentered.get(3, 0) * pow((double) momentCentered.get(1, 2), (double) 2) * featureMomentCentered.interaction(1, 2) - 4 * pow((double) momentCentered.get(3, 0), (double) 2) * momentCentered.get(1, 2) * featureMomentCentered.interaction(1, 2) + 2 * pow((double) momentCentered.get(1, 2), (double) 2) * momentCentered.get(0, 3) * featureMomentCentered.interaction(0, 3) - 4 * momentCentered.get(3, 0) * pow((double) momentCentered.get(1, 2), (double) 2) * featureMomentCentered.interaction(3, 0) + 2 * momentCentered.get(1, 2) * pow((double) momentCentered.get(0, 3), (double) 2) * featureMomentCentered.interaction(1, 2) - 4 * momentCentered.get(2, 1) * pow((double) momentCentered.get(0, 3), (double) 2) * featureMomentCentered.interaction(2, 1) + 3 * momentCentered.get(3, 0) * pow((double) momentCentered.get(2, 1), (double) 2) * featureMomentCentered.interaction(1, 2) - 3 * pow((double) momentCentered.get(3, 0), (double) 2) * momentCentered.get(1, 2) * featureMomentCentered.interaction(3, 0) - momentCentered.get(3, 0) * featureMomentCentered.interaction(1, 2) * pow((double) momentCentered.get(0, 3), (double) 2) - 4 * pow((double) momentCentered.get(2, 1), (double) 2) * momentCentered.get(0, 3) * featureMomentCentered.interaction(0, 3) - 3 * momentCentered.get(2, 1) * pow((double) momentCentered.get(0, 3), (double) 2) * featureMomentCentered.interaction(0, 3) + 2 * momentCentered.get(3, 0) * pow((double) momentCentered.get(2, 1), (double) 2) * featureMomentCentered.interaction(3, 0) + 2 * pow((double) momentCentered.get(3, 0), (double) 2) * momentCentered.get(2, 1) * featureMomentCentered.interaction(2, 1) + 3 * featureMomentCentered.interaction(3, 0) * pow((double) momentCentered.get(2, 1), (double) 2) * momentCentered.get(1, 2) - pow((double) momentCentered.get(3, 0), (double) 2) * momentCentered.get(2, 1) * featureMomentCentered.interaction(0, 3) + 3 * momentCentered.get(2, 1) * pow((double) momentCentered.get(1, 2), (double) 2) * featureMomentCentered.interaction(0, 3) - featureMomentCentered.interaction(3, 0) * momentCentered.get(1, 2) * pow((double) momentCentered.get(0, 3), (double) 2);
105 
106  LI[9] = 4*pow(momentCentered.get(3,0),3)*featureMomentCentered.interaction(3,0)+18*momentCentered.get(1,2)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(3,0)+12*momentCentered.get(0,3)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)+18*pow(momentCentered.get(1,2),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)+4*pow(momentCentered.get(0,3),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(3,0)+18*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(2,1)*featureMomentCentered.interaction(3,0)+6*pow(momentCentered.get(0,3),2)*momentCentered.get(1,2)*featureMomentCentered.interaction(3,0)+6*momentCentered.get(0,3)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(2,1)+18*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(3,0)*featureMomentCentered.interaction(2,1)+18*pow(momentCentered.get(0,3),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(2,1)+6*pow(momentCentered.get(0,3),3)*featureMomentCentered.interaction(2,1)+6*pow(momentCentered.get(3,0),3)*featureMomentCentered.interaction(1,2)+18*momentCentered.get(1,2)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(1,2)+18*momentCentered.get(0,3)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)+6*pow(momentCentered.get(0,3),2)*momentCentered.get(3,0)*featureMomentCentered.interaction(1,2)+6*momentCentered.get(2,1)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(0,3)+4*momentCentered.get(0,3)*pow(momentCentered.get(3,0),2)*featureMomentCentered.interaction(0,3)+18*momentCentered.get(1,2)*momentCentered.get(2,1)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)+12*momentCentered.get(0,3)*momentCentered.get(1,2)*momentCentered.get(3,0)*featureMomentCentered.interaction(0,3)+18*momentCentered.get(0,3)*pow(momentCentered.get(2,1),2)*featureMomentCentered.interaction(0,3)+18*pow(momentCentered.get(0,3),2)*momentCentered.get(2,1)*featureMomentCentered.interaction(0,3)+4*pow(momentCentered.get(0,3),3)*featureMomentCentered.interaction(0,3);
107 
108 
109  LI[10]=featureMomentCentered.interaction(4, 0) * momentCentered.get(0, 4) + momentCentered.get(4, 0) * featureMomentCentered.interaction(0, 4) - 4 * featureMomentCentered.interaction(3, 1) * momentCentered.get(1, 3) - 4 * momentCentered.get(3, 1) * featureMomentCentered.interaction(1, 3) + 6 * momentCentered.get(2, 2) * featureMomentCentered.interaction(2, 2);
110 
111  LI[11]=-3 * featureMomentCentered.interaction(4, 0) * momentCentered.get(2, 2) - 3 * momentCentered.get(4, 0) * featureMomentCentered.interaction(2, 2) - 2 * featureMomentCentered.interaction(4, 0) * momentCentered.get(0, 4) - 2 * momentCentered.get(4, 0) * featureMomentCentered.interaction(0, 4) + 6 * momentCentered.get(3, 1) * featureMomentCentered.interaction(3, 1) + 2 * featureMomentCentered.interaction(3, 1) * momentCentered.get(1, 3) + 2 * momentCentered.get(3, 1) * featureMomentCentered.interaction(1, 3) - 3 * featureMomentCentered.interaction(2, 2) * momentCentered.get(0, 4) - 3 * momentCentered.get(2, 2) * featureMomentCentered.interaction(0, 4) + 6 * momentCentered.get(1, 3) * featureMomentCentered.interaction(1, 3);
112 
113 
114  LI[12]=6 * momentCentered.get(4, 0) * featureMomentCentered.interaction(4, 0) + 12 * featureMomentCentered.interaction(4, 0) * momentCentered.get(2, 2) + 12 * momentCentered.get(4, 0) * featureMomentCentered.interaction(2, 2) + 2 * featureMomentCentered.interaction(4, 0) * momentCentered.get(0, 4) + 2 * momentCentered.get(4, 0) * featureMomentCentered.interaction(0, 4) + 16 * featureMomentCentered.interaction(3, 1) * momentCentered.get(1, 3) + 16 * momentCentered.get(3, 1) * featureMomentCentered.interaction(1, 3) + 12 * featureMomentCentered.interaction(2, 2) * momentCentered.get(0, 4) + 12 * momentCentered.get(2, 2) * featureMomentCentered.interaction(0, 4) + 6 * momentCentered.get(0, 4) * featureMomentCentered.interaction(0, 4);
115 
116 
117  LI[13]=2 * (momentCentered.get(5, 0) + 2 * momentCentered.get(3, 2) + momentCentered.get(1, 4)) * (featureMomentCentered.interaction(5, 0) + 2 * featureMomentCentered.interaction(3, 2) + featureMomentCentered.interaction(1, 4)) + 2 * (momentCentered.get(0, 5) + 2 * momentCentered.get(2, 3) + momentCentered.get(4, 1)) * (featureMomentCentered.interaction(0, 5) + 2 * featureMomentCentered.interaction(2, 3) + featureMomentCentered.interaction(4, 1));
118 
119  LI[14]=2 * (momentCentered.get(5, 0) - 2 * momentCentered.get(3, 2) - 3 * momentCentered.get(1, 4)) * (featureMomentCentered.interaction(5, 0) - 2 * featureMomentCentered.interaction(3, 2) - 3 * featureMomentCentered.interaction(1, 4)) + 2 * (momentCentered.get(0, 5) - 2 * momentCentered.get(2, 3) - 3 * momentCentered.get(4, 1)) * (featureMomentCentered.interaction(0, 5) - 2 * featureMomentCentered.interaction(2, 3) - 3 * featureMomentCentered.interaction(4, 1));
120 
121  LI[15]=2 * (momentCentered.get(5, 0) - 10 * momentCentered.get(3, 2) + 5 * momentCentered.get(1, 4)) * (featureMomentCentered.interaction(5, 0) - 10 * featureMomentCentered.interaction(3, 2) + 5 * featureMomentCentered.interaction(1, 4)) + 2 * (momentCentered.get(0, 5) - 10 * momentCentered.get(2, 3) + 5 * momentCentered.get(4, 1)) * (featureMomentCentered.interaction(0, 5) - 10 * featureMomentCentered.interaction(2, 3) + 5 * featureMomentCentered.interaction(4, 1));
122 
123  double s3 = momentCInvariant.getS(3);
124  double s2 = momentCInvariant.getS(2);
125  double c3 = momentCInvariant.getC(3);
126  double c2 = momentCInvariant.getC(2);
127  double I1 = momentCInvariant.getII(1);
128  double I2 = momentCInvariant.getII(2);
129  double I3 = momentCInvariant.getII(3);
130 
131  vpMatrix Lc2 = featureMomentCentered.interaction(0,3) - 3 * featureMomentCentered.interaction(2,1);
132  vpMatrix Ls2 = featureMomentCentered.interaction(3,0) - 3 * featureMomentCentered.interaction(1,2);
133  vpMatrix Lc3 = 2 * (momentCentered.get(2,0) - momentCentered.get(0,2)) * (featureMomentCentered.interaction(2,0) - featureMomentCentered.interaction(0,2)) - 8 * momentCentered.get(1,1) * featureMomentCentered.interaction(1,1);
134  vpMatrix Ls3 = 4 * featureMomentCentered.interaction(1,1) * (momentCentered.get(2,0) - momentCentered.get(0,2)) + 4 * momentCentered.get(1,1) * (featureMomentCentered.interaction(2,0) - featureMomentCentered.interaction(0,2));
135  vpMatrix LI1 = 2 * (momentCentered.get(2,0) - momentCentered.get(0,2)) * (featureMomentCentered.interaction(2,0) - featureMomentCentered.interaction(0,2)) + 8 * momentCentered.get(1,1) * featureMomentCentered.interaction(1,1);
136  vpMatrix LI2 = 2 * (momentCentered.get(0,3) - 3 * momentCentered.get(2,1)) * (featureMomentCentered.interaction(0,3) - 3 * featureMomentCentered.interaction(2,1)) + 2 * (momentCentered.get(3,0) - 3 * momentCentered.get(1,2)) * (featureMomentCentered.interaction(3,0) - 3 * featureMomentCentered.interaction(1,2));
137  vpMatrix LI3 = featureMomentCentered.interaction(2,0) + featureMomentCentered.interaction(0,2);
138 
139 
140  vpMatrix La(1,6);
141  double a;
142  if(momentObject.getType()==vpMomentObject::DISCRETE){
143  a = momentCentered.get(2,0)+momentCentered.get(0,2);
144  La = (featureMomentCentered.interaction(2,0)+featureMomentCentered.interaction(0,2));
145  }else{
146  a = momentObject.get(0,0);
147  La = featureMomentBasic.interaction(0,0);
148  }
149  interaction_matrices.resize(14);
150 
151 
152  interaction_matrices[0] = (1./(momentCInvariant.getI(2)*momentCInvariant.getI(2)))*(momentCInvariant.getI(2)*LI[1]-momentCInvariant.getI(1)*LI[2]);
153  interaction_matrices[1] = (1./(momentCInvariant.getI(4)*momentCInvariant.getI(4)))*(momentCInvariant.getI(4)*LI[3]-momentCInvariant.getI(3)*LI[4]);
154 
155  interaction_matrices[2] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[5]-momentCInvariant.getI(5)*LI[6]);
156 
157  interaction_matrices[3] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[7]-momentCInvariant.getI(7)*LI[6]);
158 
159  interaction_matrices[4] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[8]-momentCInvariant.getI(8)*LI[6]);
160 
161  interaction_matrices[5] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[9]-momentCInvariant.getI(9)*LI[6]);
162 
163 
164  interaction_matrices[6] = (1./(momentCInvariant.getI(10)*momentCInvariant.getI(10)))*(momentCInvariant.getI(10)*LI[11]-momentCInvariant.getI(11)*LI[10]);
165 
166  interaction_matrices[7] = (1./(momentCInvariant.getI(10)*momentCInvariant.getI(10)))*(momentCInvariant.getI(10)*LI[12]-momentCInvariant.getI(12)*LI[10]);
167 
168  interaction_matrices[8] = (1./(momentCInvariant.getI(15)*momentCInvariant.getI(15)))*(momentCInvariant.getI(15)*LI[13]-momentCInvariant.getI(13)*LI[15]);
169 
170  interaction_matrices[9] = (1./(momentCInvariant.getI(15)*momentCInvariant.getI(15)))*(momentCInvariant.getI(15)*LI[14]-momentCInvariant.getI(14)*LI[15]);
171 
172 
173  interaction_matrices[10] = (Lc2 * c3 + c2 * Lc3 + Ls2 * s3 + s2 * Ls3) * sqrt(a) / I1 * pow(I3, -0.3e1 / 0.2e1) + (c2 * c3 + s2 * s3) * pow(a, -0.1e1 / 0.2e1) / I1 * pow(I3, -0.3e1 / 0.2e1) * La / 0.2e1 - (c2 * c3 + s2 * s3) * sqrt(a) * pow(I1, -0.2e1) * pow(I3, -0.3e1 / 0.2e1) * LI1 - 0.3e1 / 0.2e1 * (c2 * c3 + s2 * s3) * sqrt(a) / I1 * pow(I3, -0.5e1 / 0.2e1) * LI3;
174 
175  interaction_matrices[11] = (Ls2 * c3 + s2 * Lc3 - Lc2 * s3 - c2 * Ls3) * sqrt(a) / I1 * pow(I3, -0.3e1 / 0.2e1) + (s2 * c3 - c2 * s3) * pow(a, -0.1e1 / 0.2e1) / I1 * pow(I3, -0.3e1 / 0.2e1) * La / 0.2e1 - (s2 * c3 - c2 * s3) * sqrt(a) * pow(I1, -0.2e1) * pow(I3, -0.3e1 / 0.2e1) * LI1 - 0.3e1 / 0.2e1 * (s2 * c3 - c2 * s3) * sqrt(a) / I1 * pow(I3, -0.5e1 / 0.2e1) * LI3;
176 
177  interaction_matrices[12] = (1/(I3*I3))*LI1-(2*I1/(I3*I3*I3))*LI3;
178  interaction_matrices[13] = (I2/(I3*I3*I3))*La+(a/(I3*I3*I3))*LI2-(3*a*I2/(I3*I3*I3*I3))*LI3;
179 }
180 
181 #else
182 #include <visp3/visual_features/vpFeatureMomentCInvariant.h>
183 #include <visp3/core/vpMomentCentered.h>
184 #include <visp3/core/vpMomentCInvariant.h>
185 #include <visp3/visual_features/vpFeatureMomentCentered.h>
186 #include <visp3/visual_features/vpFeatureMomentBasic.h>
187 
188 #include <visp3/visual_features/vpFeatureMomentDatabase.h>
189 
190 #include <vector>
191 #include <iostream>
192 #include <limits>
193 #include <cmath>
194 
205 
206  //std::vector<vpMatrix> LI(16);
207  LI.resize(16); // LI made class member
208 
209  bool found_moment_centered;
210  bool found_moment_cinvariant;
211  bool found_FeatureMoment_centered;
212  bool found_featuremoment_basic;
213 
214  const vpMomentObject& momentObject = moment->getObject();
215  const vpMomentCentered& momentCentered = (static_cast<const vpMomentCentered&>(moments.get("vpMomentCentered",found_moment_centered)));
216  const vpMomentCInvariant& momentCInvariant = (static_cast<const vpMomentCInvariant&>(moments.get("vpMomentCInvariant",found_moment_cinvariant)));
217 
218  vpFeatureMomentCentered& featureMomentCentered = (static_cast<vpFeatureMomentCentered&>(featureMomentsDataBase->get("vpFeatureMomentCentered",found_FeatureMoment_centered)));
219 
220  vpFeatureMomentBasic& featureMomentBasic= (static_cast<vpFeatureMomentBasic&>(featureMomentsDataBase->get("vpFeatureMomentBasic",found_featuremoment_basic)));
221 
222  if(!found_featuremoment_basic) throw vpException(vpException::notInitialized,"vpFeatureMomentBasic not found");
223  if(!found_moment_centered) throw vpException(vpException::notInitialized,"vpMomentCentered not found");
224  if(!found_moment_cinvariant) throw vpException(vpException::notInitialized,"vpMomentCInvariant not found");
225  if(!found_FeatureMoment_centered) throw vpException(vpException::notInitialized,"vpFeatureMomentCentered not found");
226 
227  vpMatrix zeros(1,6);
228  for(int i=0;i<6;i++) zeros[0][i]=0;
229 
230  double mu30 = momentCentered.get(3,0);
231  double mu30_2 = mu30*mu30;
232  double mu30_3 = mu30_2*mu30;
233 
234  double mu03 = momentCentered.get(0,3);
235  double mu03_2 = mu03*mu03;
236  double mu03_3 = mu03*mu03_2;
237 
238  double mu20 = momentCentered.get(2,0);
239  double mu02 = momentCentered.get(0,2);
240  double mu50 = momentCentered.get(5,0);
241  double mu32 = momentCentered.get(3,2);
242  double mu14 = momentCentered.get(1,4);
243  double mu05 = momentCentered.get(0,5);
244  double mu23 = momentCentered.get(2,3);
245  double mu41 = momentCentered.get(4,1);
246  double mu40 = momentCentered.get(4,0);
247  double mu04 = momentCentered.get(0,4);
248  double mu31 = momentCentered.get(3,1);
249  double mu13 = momentCentered.get(1,3);
250  double mu22 = momentCentered.get(2,2);
251  double mu21 = momentCentered.get(2,1);
252  double mu12 = momentCentered.get(1,2);
253  double mu11 = momentCentered.get(1,1);
254 
255  double mu12_2 = mu12*mu12;
256  double mu21_2 = mu21*mu21;
257  double mu21_3 = mu21*mu21_2;
258  double mu12_3 = mu12_2*mu12;
259 
260  vpMatrix Lmu20 = featureMomentCentered.interaction(2,0);
261  vpMatrix Lmu02 = featureMomentCentered.interaction(0,2);
262  vpMatrix Lmu11 = featureMomentCentered.interaction(1,1);
263  vpMatrix Lmu12 = featureMomentCentered.interaction(1,2);
264  vpMatrix Lmu03 = featureMomentCentered.interaction(0,3);
265  vpMatrix Lmu21 = featureMomentCentered.interaction(2,1);
266  vpMatrix Lmu30 = featureMomentCentered.interaction(3,0);
267  vpMatrix Lmu40 = featureMomentCentered.interaction(4,0);
268  vpMatrix Lmu04 = featureMomentCentered.interaction(0,4);
269  vpMatrix Lmu31 = featureMomentCentered.interaction(3,1);
270  vpMatrix Lmu13 = featureMomentCentered.interaction(1,3);
271  vpMatrix Lmu22 = featureMomentCentered.interaction(2,2);
272  vpMatrix Lmu05 = featureMomentCentered.interaction(0,5);
273  vpMatrix Lmu14 = featureMomentCentered.interaction(1,4);
274  vpMatrix Lmu23 = featureMomentCentered.interaction(2,3);
275  vpMatrix Lmu32 = featureMomentCentered.interaction(3,2);
276  vpMatrix Lmu41 = featureMomentCentered.interaction(4,1);
277  vpMatrix Lmu50 = featureMomentCentered.interaction(5,0);
278 
279  LI[1]= -Lmu20*mu02-mu20*Lmu02+2*mu11*Lmu11;
280 
281  LI[2]= (-2*mu20+2*mu02)*Lmu02+8*mu11*Lmu11+(2*mu20-2*mu02)*Lmu20;
282 
283  LI[3]= (-6*mu21+2*mu03)*Lmu03+(-6*mu30+18*mu12)*Lmu12+(18*mu21-6*mu03)*Lmu21+(2*mu30-6*mu12)*Lmu30;
284 
285  LI[4]= (2*mu21+2*mu03)*Lmu03+(2*mu30+2*mu12)*Lmu12+(2*mu21+2*mu03)*Lmu21+(2*mu30+2*mu12)*Lmu30;
286 
287  LI[5]= (-2*mu30_2*mu03+6*mu30*mu21*mu12-4*mu21_3)*Lmu03+(6*mu30*mu21*mu03-12*mu30*mu12_2+6*mu21_2*mu12)*Lmu12+(6*mu30*mu12*mu03-12*mu21_2*mu03+6*mu21*mu12_2)*Lmu21+(-2*mu30*mu03_2-4*mu12_3+6*mu21*mu12*mu03)*Lmu30;
288 
289  LI[6]= (-6*mu30*mu21*mu12-6*mu21*mu12_2+6*mu21_2*mu03+2*mu21_3+4*mu30_2*mu03)*Lmu03+(-6*mu30*mu21_2-6*mu30*mu21*mu03+12*mu12_3+6*mu30_2*mu12-12*mu21*mu12*mu03+6*mu30*mu12_2)*Lmu12+(6*mu21*mu03_2+6*mu21_2*mu03-6*mu30*mu12*mu03+12*mu21_3-12*mu30*mu21*mu12-6*mu12_2*mu03)*Lmu21+(6*mu30*mu12_2+2*mu12_3+4*mu30*mu03_2-6*mu21_2*mu12-6*mu21*mu12*mu03)*Lmu30;
290 
291  LI[7] = (-6*mu21_2*mu12+3*mu30*mu03_2-mu30_3-3*mu30*mu21_2-6*mu21*mu12*mu03+3*mu30*mu12_2+2*mu12_3)*Lmu03+(-3*mu21*mu03_2+12*mu30*mu21*mu12+6*mu30*mu12*mu03+3*mu30_2*mu21+9*mu21*mu12_2-6*mu21_2*mu03-3*mu21_3+6*mu12_2*mu03)*Lmu12+(3*mu30_2*mu12-9*mu21_2*mu12-12*mu21*mu12*mu03-6*mu30*mu21*mu03-6*mu30*mu21_2+6*mu30*mu12_2+3*mu12_3-3*mu12*mu03_2)*Lmu21+(6*mu21*mu12_2+6*mu30*mu21*mu12-3*mu30_2*mu03+3*mu12_2*mu03-3*mu21_2*mu03-2*mu21_3+mu03_3)*Lmu30;
292 
293  LI[8]= (6*mu21_3-2*mu30*mu12*mu03+2*mu12_2*mu03+3*mu21*mu12_2-6*mu30*mu21*mu12-mu30_2*mu21-4*mu21_2*mu03-3*mu21*mu03_2)*Lmu03+(2*mu12*mu03_2-4*mu30_2*mu12+9*mu30*mu12_2-mu30*mu03_2-6*mu30*mu21*mu03+3*mu30*mu21_2+6*mu21*mu12*mu03-mu30_3)*Lmu12+(18*mu21_2*mu03+6*mu30*mu21*mu12-4*mu21*mu03_2-mu03_3-mu30_2*mu03-6*mu30*mu12*mu03+3*mu12_2*mu03+2*mu30_2*mu21)*Lmu21+(-6*mu21*mu12*mu03-4*mu30*mu12_2-2*mu30*mu21*mu03+2*mu30*mu21_2+3*mu12_3+3*mu21_2*mu12-3*mu30_2*mu12-mu12*mu03_2)*Lmu30;
294 
295  LI[9] = (2*(2*mu03+3*mu21))*(3*mu03*mu21+3*mu30*mu12+mu30_2+mu03_2)*Lmu03+6*mu30*(3*mu03*mu21+3*mu30*mu12+mu30_2+mu03_2)*Lmu12+6*mu03*(3*mu03*mu21+3*mu30*mu12+mu30_2+mu03_2)*Lmu21+(2*(2*mu30+3*mu12))*(3*mu03*mu21+3*mu30*mu12+mu30_2+mu03_2)*Lmu30;
296 
297  LI[10]= Lmu40*mu04+mu40*Lmu04-4*Lmu31*mu13-4*mu31*Lmu13+6*mu22*Lmu22;
298 
299  LI[11]= (-2*mu40-3*mu22)*Lmu04+(2*mu31+6*mu13)*Lmu13+(-3*mu04-3*mu40)*Lmu22+(2*mu13+6*mu31)*Lmu31+(-3*mu22-2*mu04)*Lmu40;
300 
301  LI[12]= (2*mu40+12*mu22+6*mu04)*Lmu04+16*mu31*Lmu13+(12*mu40+12*mu04)*Lmu22+16*Lmu31*mu13+(6*mu40+12*mu22+2*mu04)*Lmu40;
302 
303  LI[13]=(2*mu05+4*mu23+2*mu41)*Lmu05+(2*mu50+4*mu32+2*mu14)*Lmu14+(4*mu05+8*mu23+4*mu41)*Lmu23+(4*mu50+8*mu32+4*mu14)*Lmu32+(2*mu05+4*mu23+2*mu41)*Lmu41+(2*mu50+4*mu32+2*mu14)*Lmu50 ;
304 
305  LI[14]= (2*mu05-4*mu23-6*mu41)*Lmu05+(-6*mu50+12*mu32+18*mu14)*Lmu14+(-4*mu05+8*mu23+12*mu41)*Lmu23+(-4*mu50+8*mu32+12*mu14)*Lmu32+(-6*mu05+12*mu23+18*mu41)*Lmu41+(2*mu50-4*mu32-6*mu14)*Lmu50;
306 
307  LI[15]= (2*mu05-20*mu23+10*mu41)*Lmu05+(10*mu50-100*mu32+50*mu14)*Lmu14+(-20*mu05+200*mu23-100*mu41)*Lmu23+(-20*mu50+200*mu32-100*mu14)*Lmu32+(10*mu05-100*mu23+50*mu41)*Lmu41+(2*mu50-20*mu32+10*mu14)*Lmu50;
308 
309  double s3 = momentCInvariant.getS(3);
310  double s2 = momentCInvariant.getS(2);
311  double c3 = momentCInvariant.getC(3);
312  double c2 = momentCInvariant.getC(2);
313 
314  double I1 = momentCInvariant.getII(1);
315  double I2 = momentCInvariant.getII(2);
316  double I3 = momentCInvariant.getII(3);
317 
318  vpMatrix Lmu20__Lmu02 = Lmu20 - Lmu02;
319  double mu20__mu02 = mu20 - mu02;
320  vpMatrix Lc2 = Lmu03 - 3 * Lmu21;
321  vpMatrix Ls2 = Lmu30 - 3 * Lmu12;
322  vpMatrix Lc3 = 2 * (mu20__mu02) * (Lmu20__Lmu02) - 8. * mu11 * Lmu11;
323  vpMatrix Ls3 = 4 * Lmu11 * (mu20__mu02) + 4 * mu11 * (Lmu20__Lmu02);
324  vpMatrix LI1 = 2 * (mu20__mu02) * (Lmu20__Lmu02) + 8 * mu11 * Lmu11;
325  vpMatrix LI2 = 2 * (mu03 - 3 * mu21) * (Lc2) + 2 * (mu30 - 3 * mu12) * (Ls2);
326  vpMatrix LI3 = Lmu20 + Lmu02;
327 
328  vpMatrix La(1,6);
329  double a;
330  if(momentObject.getType()==vpMomentObject::DISCRETE){
331  a = momentCentered.get(2,0)+momentCentered.get(0,2);
332  La = (featureMomentCentered.interaction(2,0)+featureMomentCentered.interaction(0,2));
333  }else{
334  a = momentObject.get(0,0);
335  La = featureMomentBasic.interaction(0,0);
336  }
337 
338  interaction_matrices.resize(14);
339 
340  /*
341  momentCInvariant.printInvariants(std::cout);
342  printLsofInvariants(std::cout);
343  */
344 
345  interaction_matrices[0] = (1./(momentCInvariant.getI(2)*momentCInvariant.getI(2)))*(momentCInvariant.getI(2)*LI[1]-momentCInvariant.getI(1)*LI[2]);
346 
347  interaction_matrices[1] = (1./(momentCInvariant.getI(4)*momentCInvariant.getI(4)))*(momentCInvariant.getI(4)*LI[3]-momentCInvariant.getI(3)*LI[4]);
348 
349  interaction_matrices[2] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[5]-momentCInvariant.getI(5)*LI[6]);
350 
351  interaction_matrices[3] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[7]-momentCInvariant.getI(7)*LI[6]);
352 
353  interaction_matrices[4] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[8]-momentCInvariant.getI(8)*LI[6]);
354 
355  interaction_matrices[5] = (1./(momentCInvariant.getI(6)*momentCInvariant.getI(6)))*(momentCInvariant.getI(6)*LI[9]-momentCInvariant.getI(9)*LI[6]);
356 
357  interaction_matrices[6] = (1./(momentCInvariant.getI(10)*momentCInvariant.getI(10)))*(momentCInvariant.getI(10)*LI[11]-momentCInvariant.getI(11)*LI[10]);
358 
359  interaction_matrices[7] = (1./(momentCInvariant.getI(10)*momentCInvariant.getI(10)))*(momentCInvariant.getI(10)*LI[12]-momentCInvariant.getI(12)*LI[10]);
360 
361  interaction_matrices[8] = (1./(momentCInvariant.getI(15)*momentCInvariant.getI(15)))*(momentCInvariant.getI(15)*LI[13]-momentCInvariant.getI(13)*LI[15]);
362 
363  interaction_matrices[9] = (1./(momentCInvariant.getI(15)*momentCInvariant.getI(15)))*(momentCInvariant.getI(15)*LI[14]-momentCInvariant.getI(14)*LI[15]);
364 
365  interaction_matrices[10] = (Lc2 * c3 + c2 * Lc3 + Ls2 * s3 + s2 * Ls3) * sqrt(a) / I1 * pow(I3, -0.3e1 / 0.2e1) + (c2 * c3 + s2 * s3) * pow(a, -0.1e1 / 0.2e1) / I1 * pow(I3, -0.3e1 / 0.2e1) * La / 0.2e1 - (c2 * c3 + s2 * s3) * sqrt(a) * pow(I1, -0.2e1) * pow(I3, -0.3e1 / 0.2e1) * LI1 - 0.3e1 / 0.2e1 * (c2 * c3 + s2 * s3) * sqrt(a) / I1 * pow(I3, -0.5e1 / 0.2e1) * LI3;
366 
367  interaction_matrices[11] = (Ls2 * c3 + s2 * Lc3 - Lc2 * s3 - c2 * Ls3) * sqrt(a) / I1 * pow(I3, -0.3e1 / 0.2e1) + (s2 * c3 - c2 * s3) * pow(a, -0.1e1 / 0.2e1) / I1 * pow(I3, -0.3e1 / 0.2e1) * La / 0.2e1 - (s2 * c3 - c2 * s3) * sqrt(a) * pow(I1, -0.2e1) * pow(I3, -0.3e1 / 0.2e1) * LI1 - 0.3e1 / 0.2e1 * (s2 * c3 - c2 * s3) * sqrt(a) / I1 * pow(I3, -0.5e1 / 0.2e1) * LI3;
368 
369  interaction_matrices[12] = (1/(I3*I3))*LI1-(2*I1/(I3*I3*I3))*LI3;
370 
371  interaction_matrices[13] = (I2/(I3*I3*I3))*La+(a/(I3*I3*I3))*LI2-(3*a*I2/(I3*I3*I3*I3))*LI3;
372 
373  /*
374  std::cout << (*this);
375  vpTRACE("Done.");
376  std::exit(-1);
377  */
378 }
379 
386  for (unsigned int i = 1; i < 15; ++i){
387  os << "LI[" << i << "] = ";
388  LI[i].matlabPrint(os);
389  os << std::endl;
390  }
391 }
392 
393 VISP_EXPORT std::ostream& operator<<(std::ostream & os, const vpFeatureMomentCInvariant& featcinv)
394 {
395  //Print L for c1 .. c10
396  for (unsigned int i = 0; i < 10; ++i){
397  os << "L_c[" << i << "] = ";
398  featcinv.interaction_matrices[i].matlabPrint(os);
399  os << std::endl;
400  }
401 
402  // sx, sy
403  os << "L_sx = ";
404  featcinv.interaction_matrices[10].matlabPrint(os);
405  os << std::endl;
406  os << "L_sy = ";
407  featcinv.interaction_matrices[11].matlabPrint(os);
408  os << std::endl;
409  // Px,Py
410  os << "L_Px = ";
411  featcinv.interaction_matrices[12].matlabPrint(os);
412  os << std::endl;
413  os << "L_Py = ";
414  featcinv.interaction_matrices[13].matlabPrint(os);
415  os << std::endl;
416 
417  return os;
418 
419 }
420 #endif
Functionality computation for basic moment feature. Computes the interaction matrix associated with v...
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:92
double getS(unsigned int i) const
const vpMoment * moment
Functionality computation for centered moment feature. Computes the interaction matrix associated wit...
error that can be emited by ViSP classes.
Definition: vpException.h:73
Class for generic objects.
const std::vector< double > & get() const
std::vector< vpMatrix > interaction_matrices
vpMatrix interaction(unsigned int select_one, unsigned int select_two) const
vpMatrix interaction(unsigned int select_one, unsigned int select_two) const
double getI(unsigned int index) const
double getC(unsigned int i) const
const vpMoment & get(const char *type, bool &found) const
vpMomentDatabase & moments
This class defines the double-indexed centered moment descriptor .
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Definition: vpArray2D.h:267
double get(unsigned int i, unsigned int j) const
double getII(unsigned int i) const
vpObjectType getType() const
void printLsofInvariants(std::ostream &os) const
vpFeatureMomentDatabase * featureMomentsDataBase
Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature...
const vpMomentObject & getObject() const
Definition: vpMoment.h:143
vpFeatureMoment & get(const char *type, bool &found)