41 #include <visp/vpMomentObject.h>
42 #ifdef VISP_MOMENTS_COMBINE_MATRICES
43 #include <visp/vpFeatureMomentCInvariant.h>
44 #include <visp/vpMomentCentered.h>
45 #include <visp/vpMomentCInvariant.h>
46 #include <visp/vpFeatureMomentCentered.h>
47 #include <visp/vpFeatureMomentBasic.h>
49 #include <visp/vpFeatureMomentDatabase.h>
65 std::vector<vpMatrix> LI(16);
66 bool found_moment_centered;
67 bool found_moment_cinvariant;
68 bool found_FeatureMoment_centered;
69 bool found_featuremoment_basic;
86 for(
int i=0;i<6;i++) zeros[0][i]=0;
89 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);
92 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);
95 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));
98 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));
100 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);
103 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);
106 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);
108 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);
110 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);
113 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);
115 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);
118 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);
121 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));
123 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));
125 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));
127 double s3 = momentCInvariant.
getS(3);
128 double s2 = momentCInvariant.
getS(2);
129 double c3 = momentCInvariant.
getC(3);
130 double c2 = momentCInvariant.
getC(2);
131 double I1 = momentCInvariant.
getII(1);
132 double I2 = momentCInvariant.
getII(2);
133 double I3 = momentCInvariant.
getII(3);
147 a = momentCentered.
get(2,0)+momentCentered.
get(0,2);
150 a = momentObject.
get(0,0);
177 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;
179 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;
186 #include <visp/vpFeatureMomentCInvariant.h>
187 #include <visp/vpMomentCentered.h>
188 #include <visp/vpMomentCInvariant.h>
189 #include <visp/vpFeatureMomentCentered.h>
190 #include <visp/vpFeatureMomentBasic.h>
192 #include <visp/vpFeatureMomentDatabase.h>
210 std::vector<vpMatrix> LI(16);
212 bool found_moment_centered;
213 bool found_moment_cinvariant;
214 bool found_FeatureMoment_centered;
215 bool found_featuremoment_basic;
232 for(
int i=0;i<6;i++) zeros[0][i]=0;
234 double mu30 = momentCentered.
get(3,0);
235 double mu30_2 = mu30*mu30;
236 double mu30_3 = mu30_2*mu30;
238 double mu03 = momentCentered.
get(0,3);
239 double mu03_2 = mu03*mu03;
240 double mu03_3 = mu03*mu03_2;
242 double mu20 = momentCentered.
get(2,0);
243 double mu02 = momentCentered.
get(0,2);
244 double mu50 = momentCentered.
get(5,0);
245 double mu32 = momentCentered.
get(3,2);
246 double mu14 = momentCentered.
get(1,4);
247 double mu05 = momentCentered.
get(0,5);
248 double mu23 = momentCentered.
get(2,3);
249 double mu41 = momentCentered.
get(4,1);
250 double mu40 = momentCentered.
get(4,0);
251 double mu04 = momentCentered.
get(0,4);
252 double mu31 = momentCentered.
get(3,1);
253 double mu13 = momentCentered.
get(1,3);
254 double mu22 = momentCentered.
get(2,2);
255 double mu21 = momentCentered.
get(2,1);
256 double mu12 = momentCentered.
get(1,2);
257 double mu11 = momentCentered.
get(1,1);
261 double mu12_2 = mu12*mu12;
262 double mu21_2 = mu21*mu21;
263 double mu21_3 = mu21*mu21_2;
264 double mu12_3 = mu12_2*mu12;
286 LI[1]= -Lmu20*mu02-mu20*Lmu02+2*mu11*Lmu11;
288 LI[2]= (-2*mu20+2*mu02)*Lmu02+8*mu11*Lmu11+(2*mu20-2*mu02)*Lmu20;
290 LI[3]= (-6*mu21+2*mu03)*Lmu03+(-6*mu30+18*mu12)*Lmu12+(18*mu21-6*mu03)*Lmu21+(2*mu30-6*mu12)*Lmu30;
292 LI[4]= (2*mu21+2*mu03)*Lmu03+(2*mu30+2*mu12)*Lmu12+(2*mu21+2*mu03)*Lmu21+(2*mu30+2*mu12)*Lmu30;
294 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;
296 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;
298 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;
300 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;
302 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;
304 LI[10]= Lmu40*mu04+mu40*Lmu04-4*Lmu31*mu13-4*mu31*Lmu13+6*mu22*Lmu22;
306 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;
308 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;
310 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 ;
312 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;
314 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;
316 double s3 = momentCInvariant.
getS(3);
317 double s2 = momentCInvariant.
getS(2);
318 double c3 = momentCInvariant.
getC(3);
319 double c2 = momentCInvariant.
getC(2);
320 double I1 = momentCInvariant.
getII(1);
321 double I2 = momentCInvariant.
getII(2);
322 double I3 = momentCInvariant.
getII(3);
324 vpMatrix Lmu20__Lmu02 = Lmu20 - Lmu02;
325 double mu20__mu02 = mu20 - mu02;
328 vpMatrix Lc3 = 2 * (mu20__mu02) * (Lmu20__Lmu02) - 8. * mu11 * Lmu11;
329 vpMatrix Ls3 = 4 * Lmu11 * (mu20__mu02) + 4 * mu11 * (Lmu20__Lmu02);
330 vpMatrix LI1 = 2 * (mu20__mu02) * (Lmu20__Lmu02) + 8 * mu11 * Lmu11;
331 vpMatrix LI2 = 2 * (mu03 - 3 * mu21) * (Lc2) + 2 * (mu30 - 3 * mu12) * (Ls2);
338 a = momentCentered.
get(2,0)+momentCentered.
get(0,2);
341 a = momentObject.
get(0,0);
368 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;
370 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;
Functionality computation for basic moment feature. Computes the interaction matrix associated with v...
Definition of the vpMatrix class.
vpMomentObject & getObject() const
Functionality computation for centered moment feature. Computes the interaction matrix associated wit...
double getII(unsigned int i)
double get(unsigned int i, unsigned int j)
error that can be emited by ViSP classes.
Class for generic objects.
std::vector< vpMatrix > interaction_matrices
vpMoment & get(const char *type, bool &found)
std::vector< double > & get()
vpMomentDatabase & moments
double getS(unsigned int i)
This class defines the double-indexed centered moment descriptor .
vpObjectType getType() const
vpMatrix interaction(unsigned int select_one, unsigned int select_two)
vpFeatureMomentDatabase * featureMomentsDataBase
void compute_interaction()
vpMatrix interaction(unsigned int select_one, unsigned int select_two)
double getC(unsigned int i)
double getI(unsigned int index)
This class defines several 2D (translation+rotation+scale) invariants for both symmetric and non-symm...
vpFeatureMoment & get(const char *type, bool &found)