diff --git a/openbr/plugins/algorithms.cpp b/openbr/plugins/algorithms.cpp index 39c4135..f456dac 100644 --- a/openbr/plugins/algorithms.cpp +++ b/openbr/plugins/algorithms.cpp @@ -79,6 +79,10 @@ class AlgorithmsInitializer : public Initializer Globals->abbreviations.insert("RegisterAffine", "Open+Affine(256,256,0.37,0.45)"); 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)"); 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"); + 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], \ + 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])"); + 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], \ + to=[9,8,7,6,5,18,17,28,27,26,25,30,29,37,36,35,42,41,47,46,50])"); // Transforms Globals->abbreviations.insert("FaceDetection", "Open+Cvt(Gray)+Cascade(FrontalFace)"); diff --git a/openbr/plugins/register.cpp b/openbr/plugins/register.cpp index 75b4eec..154a72d 100644 --- a/openbr/plugins/register.cpp +++ b/openbr/plugins/register.cpp @@ -121,27 +121,12 @@ private: BR_REGISTER(Transform, AffineTransform) /*! - * \ingroup initializers - * \brief Initialize Stasm - * \author Scott Klum \cite sklum - */ -class FlipInitializer : public Initializer -{ - Q_OBJECT - - void initialize() const - { - 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], \ - 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])"); - } -}; - -BR_REGISTER(Initializer, FlipInitializer) - -/*! * \ingroup transforms * \brief Flips the image about an axis. * \author Josh Klontz \cite jklontz + * \note In the case that you would like to flip both the image and the template's points but keep the indices for + * the points consistent between flipped an unflipped images, the to and from variables specify which indices + * to swap (i.e. points[from[0]] becomes points[to[0]]). */ class FlipTransform : public UntrainableMetaTransform { @@ -186,7 +171,7 @@ private: std::swap(flippedPoints[from[j]],flippedPoints[to[j]]); dst.last().file.setPoints(flippedPoints); - } + } else qFatal("Inconsistent sizes for to and from index lists."); } }