From 11c4e3a981b412848c7df204818825b676a791b8 Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Mon, 29 Jul 2013 14:31:23 -0400 Subject: [PATCH] Get the two images for OF --- openbr/plugins/opticalflow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/opticalflow.cpp b/openbr/plugins/opticalflow.cpp index dcd434e..4409ada 100644 --- a/openbr/plugins/opticalflow.cpp +++ b/openbr/plugins/opticalflow.cpp @@ -8,7 +8,7 @@ namespace br /*! * \ingroup transforms - * \brief Gets a two-channel dense optical flow from an image + * \brief Gets a two-channel dense optical flow from two images * \author Austin Blanton \cite imaus10 */ class OpticalFlowTransform : public UntrainableTransform @@ -32,8 +32,12 @@ class OpticalFlowTransform : public UntrainableTransform void project(const Template &src, Template &dst) const { - // TODO: get the two images from AggregateFrames - calcOpticalFlowFarneback(prevImg, nextImg, dst, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags); + // get the two images put there by AggregateFrames + Mat prevImg = src[0]; + Mat nextImg = src[1]; + Mat flow; + calcOpticalFlowFarneback(prevImg, nextImg, flow, pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags); + dst += flow; } }; -- libgit2 0.21.4