diff --git a/openbr/plugins/algorithms.cpp b/openbr/plugins/algorithms.cpp index 1d1e2fb..5526c33 100644 --- a/openbr/plugins/algorithms.cpp +++ b/openbr/plugins/algorithms.cpp @@ -52,7 +52,7 @@ class AlgorithmsInitializer : public Initializer Globals->abbreviations.insert("HOG", "Stream(DropFrames(5)+Cvt(Gray)+KeyPointDetector(SIFT)+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)+SVM"); Globals->abbreviations.insert("HOF", "Stream(DropFrames(5)+KeyPointDetector(SIFT)+AggregateFrames(2)+OpticalFlow+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat)+Contract+CatRows+KMeans(500)+Hist(500)"); - Globals->abbreviations.insert("HOGHOF", "Stream(DropFrames(5)+Cvt(Gray),KeyPointDetector(SIFT)+AggregateFrames(2)+(OpticalFlow+Gradient+Bin(0,360,8)+ROI+Hist(8))/(First+Gradient+Bin(0,360,8)+ROI+Hist(8))+CatCols)+Contract+CatRows+KMeans(500)+Hist(500)"); + Globals->abbreviations.insert("HOGHOF", "Stream(DropFrames(5)+KeyPointDetector(SIFT)+AggregateFrames(2)+(OpticalFlow++ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat+Contract)/(First+Cvt(Gray)+ROI+Expand+Resize(32,32)+Gradient+RectRegions+Bin(0,360,8)+Hist(8)+Cat+Contract)+CatCols)+Contract+CatRows+KMeans(500)+Hist(500)+SVM"); // Generic Image Processing Globals->abbreviations.insert("SIFT", "Open+KeyPointDetector(SIFT)+KeyPointDescriptor(SIFT):KeyPointMatcher(BruteForce)"); diff --git a/openbr/plugins/frames.cpp b/openbr/plugins/frames.cpp index f5f8609..fb7f507 100644 --- a/openbr/plugins/frames.cpp +++ b/openbr/plugins/frames.cpp @@ -27,12 +27,14 @@ private: (void) data; } - void projectUpdate(const Template &src, Template &dst) + void projectUpdate(const TemplateList &src, TemplateList &dst) { buffer.append(src); if (buffer.size() < n) return; - foreach (const Template &t, buffer) dst.append(t); - dst.file = buffer.takeFirst().file; + Template out; + foreach (const Template &t, buffer) out.append(t); + out.file = buffer.takeFirst().file; + dst.append(out); } void finalize(TemplateList & output) diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index 5905c31..1cfd271 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -265,6 +265,7 @@ class ContractTransform : public UntrainableMetaTransform virtual void project(const TemplateList &src, TemplateList &dst) const { //dst = Expanded(src); + if (src.empty()) return; Template out; foreach (const Template & t, src) { diff --git a/openbr/plugins/opticalflow.cpp b/openbr/plugins/opticalflow.cpp index 5246ad5..89c2044 100644 --- a/openbr/plugins/opticalflow.cpp +++ b/openbr/plugins/opticalflow.cpp @@ -34,7 +34,7 @@ class OpticalFlowTransform : public UntrainableMetaTransform void project(const Template &src, Template &dst) const { // get the two images put there by AggregateFrames - if (src.size() < 2) return; + if (src.size() != 2) qFatal("Optical Flow requires two images."); Mat prevImg = src[0], nextImg = src[1], flow, flowOneCh; if (src[0].channels() != 1) OpenCVUtils::cvtGray(src[0], prevImg); if (src[1].channels() != 1) OpenCVUtils::cvtGray(src[1], nextImg); diff --git a/openbr/plugins/regions.cpp b/openbr/plugins/regions.cpp index e6c30fa..d4363b5 100644 --- a/openbr/plugins/regions.cpp +++ b/openbr/plugins/regions.cpp @@ -141,7 +141,6 @@ class CatColsTransform : public UntrainableMetaTransform void project(const Template &src, Template &dst) const { - if (src.empty()) return; dst.file = src.file; Mat m = OpenCVUtils::toMatByRow(src); // right now this just splits src in half and joins them horizontally