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/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);