Commit 61f7a72a20bb78851b30dbb4fc1f1fd8ace1c44d

Authored by Scott Klum
1 parent b9566820

Moved MUCT abbrievations to algorithms.cpp, added note, added fatal if list size is inconsistent

openbr/plugins/algorithms.cpp
... ... @@ -79,6 +79,10 @@ class AlgorithmsInitializer : public Initializer
79 79 Globals->abbreviations.insert("RegisterAffine", "Open+Affine(256,256,0.37,0.45)");
80 80 Globals->abbreviations.insert("ContrastEnhanced", "Open+Affine(256,256,0.37,0.45)+Cvt(Gray)+Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)");
81 81 Globals->abbreviations.insert("ColoredLBP", "Open+Affine(128,128,0.37,0.45)+Cvt(Gray)+Blur(1.1)+Gamma(0.2)+DoG(1,2)+ContrastEq(0.1,10)+LBP(1,2)+ColoredU2");
  82 + Globals->abbreviations.insert("FlipMUCT","Flip(from=[ 0, 1, 2, 3, 4, 5, 6, 7, 17,18,19,20,21,31,32,36,37,38,39,40,41,48,49,50,55,56,60,61,65], \
  83 + to=[16,15,14,13,12,11,10, 9, 26,25,24,23,22,35,34,45,44,43,42,47,46,54,53,52,59,58,64,63,67])");
  84 + Globals->abbreviations.insert("FlipMUCTNoJaw","Flip(from=[0,1,2,3,4,14,15,19,20,21,22,23,24,31,32,33,38,39,43,44,48], \
  85 + to=[9,8,7,6,5,18,17,28,27,26,25,30,29,37,36,35,42,41,47,46,50])");
82 86  
83 87 // Transforms
84 88 Globals->abbreviations.insert("FaceDetection", "Open+Cvt(Gray)+Cascade(FrontalFace)");
... ...
openbr/plugins/register.cpp
... ... @@ -121,27 +121,12 @@ private:
121 121 BR_REGISTER(Transform, AffineTransform)
122 122  
123 123 /*!
124   - * \ingroup initializers
125   - * \brief Initialize Stasm
126   - * \author Scott Klum \cite sklum
127   - */
128   -class FlipInitializer : public Initializer
129   -{
130   - Q_OBJECT
131   -
132   - void initialize() const
133   - {
134   - Globals->abbreviations.insert("FlipMUCT","Flip(from=[ 0, 1, 2, 3, 4, 5, 6, 7, 17,18,19,20,21,31,32,36,37,38,39,40,41,48,49,50,55,56,60,61,65], \
135   - to=[16,15,14,13,12,11,10, 9, 26,25,24,23,22,35,34,45,44,43,42,47,46,54,53,52,59,58,64,63,67])");
136   - }
137   -};
138   -
139   -BR_REGISTER(Initializer, FlipInitializer)
140   -
141   -/*!
142 124 * \ingroup transforms
143 125 * \brief Flips the image about an axis.
144 126 * \author Josh Klontz \cite jklontz
  127 + * \note In the case that you would like to flip both the image and the template's points but keep the indices for
  128 + * the points consistent between flipped an unflipped images, the to and from variables specify which indices
  129 + * to swap (i.e. points[from[0]] becomes points[to[0]]).
145 130 */
146 131 class FlipTransform : public UntrainableMetaTransform
147 132 {
... ... @@ -186,7 +171,7 @@ private:
186 171 std::swap(flippedPoints[from[j]],flippedPoints[to[j]]);
187 172  
188 173 dst.last().file.setPoints(flippedPoints);
189   - }
  174 + } else qFatal("Inconsistent sizes for to and from index lists.");
190 175 }
191 176 }
192 177  
... ...