diff --git a/openbr/plugins/opticalflow.cpp b/openbr/plugins/opticalflow.cpp new file mode 100644 index 0000000..99ed6e1 --- /dev/null +++ b/openbr/plugins/opticalflow.cpp @@ -0,0 +1,27 @@ +#include +#include "openbr_internal.h" + +using namespace cv; + +namespace br +{ + +class OpticalFlowTransform : public UntrainableTransform +{ + Q_OBJECT + Q_PROPERTY(QDouble pyr_scale READ get_pyr_scale WRITE set_pyr_scale RESET reset_pyr_scale STORE false) + BR_PROPERTY(double, pyr_scale, 0.5) + Q_PROPERTY(QString pyr_scale READ get_pyr_scale WRITE set_pyr_scale RESET reset_pyr_scale STORE false) + BR_PROPERTY(double, pyr_scale, 0.5) + + void project(const Template &src, Template &dst) const + { + // get the two images + // these were the best parameters on KTH + calcOpticalFlowFarneback(prevImg, nextImg, dst, 0.1, 1, 5, 10, 7, 1.1, 0); + } +} + +} // namespace br + +#include