diff --git a/openbr/plugins/algorithms.cpp b/openbr/plugins/algorithms.cpp index 8c87c8c..7711f12 100644 --- a/openbr/plugins/algorithms.cpp +++ b/openbr/plugins/algorithms.cpp @@ -50,6 +50,8 @@ class AlgorithmsInitializer : public Initializer Globals->abbreviations.insert("PerFrameDetection", "Stream([SaveMat(original)+Cvt(Gray)+Cascade(FrontalFace)+ASEFEyes+RestoreMat(original)+Draw(inPlace=true),Show(false,[FrameNumber])+Discard])"); Globals->abbreviations.insert("AgeGenderDemo", "Stream([SaveMat(original)+Cvt(Gray)+Cascade(FrontalFace)+Expand+++(+Rename(Subject,Age)+Discard)/(+Rename(Subject,Gender)+Discard)+RestoreMat(original)+Draw(inPlace=true)+DrawPropertiesPoint([Age,Gender],Affine_0,inPlace=true)+SaveMat(original)+Discard+Contract,RestoreMat(original)+FPSCalc+Show(false,[AvgFPS,Age,Gender])+Discard])"); Globals->abbreviations.insert("HoF", "Stream([KeyPointDetector(SIFT),AggregateFrames(2)+OpticalFlow,InterestRegions,Hist+Discard])"); + Globals->abbreviations.insert("HoG", "Stream([KeyPointDetector(SIFT),InterestRegions,HoGDescriptor+Discard])"); + Globals->abbreviations.insert("HoGHoF", "Stream([KeyPointDetector(SIFT),(AggregateFrames(2)+OpticalFlow+InterestRegions+Hist)/(InterestRegions+HoGDescriptor),Cat])"); // Generic Image Processing Globals->abbreviations.insert("SIFT", "Open+KeyPointDetector(SIFT)+KeyPointDescriptor(SIFT):KeyPointMatcher(BruteForce)"); diff --git a/openbr/plugins/keypoint.cpp b/openbr/plugins/keypoint.cpp index 9e936cb..098120a 100644 --- a/openbr/plugins/keypoint.cpp +++ b/openbr/plugins/keypoint.cpp @@ -178,6 +178,31 @@ BR_REGISTER(Transform, SIFTDescriptorTransform) /*! * \ingroup transforms + * \brief OpenCV HOGDescriptor wrapper + * \author Austin Blanton \cite imaus10 + */ +class HoGDescriptorTransform : public UntrainableTransform +{ + Q_OBJECT + + HOGDescriptor hog; + + void project(const Template &src, Template &dst) const + { + std::vector descriptorVals; + std::vector locations; + Size winStride = Size(0,0); + Size padding = Size(0,0); + hog.compute(src, descriptorVals, winStride, padding, locations); + Mat HoGFeats = Mat(descriptorVals, true); + dst += HoGFeats; + } +}; + +BR_REGISTER(Transform, HoGDescriptorTransform) + +/*! + * \ingroup transforms * \brief Add landmarks to the template in a grid layout * \author Josh Klontz \cite jklontz */