Commit b544cef503b39f0552c932a194438a6556c6f5b7
1 parent
bdf861b4
Incomplete OF transform
Showing
1 changed file
with
27 additions
and
0 deletions
openbr/plugins/opticalflow.cpp
0 → 100644
| 1 | +#include <opencv2/video/tracking.hpp> | |
| 2 | +#include "openbr_internal.h" | |
| 3 | + | |
| 4 | +using namespace cv; | |
| 5 | + | |
| 6 | +namespace br | |
| 7 | +{ | |
| 8 | + | |
| 9 | +class OpticalFlowTransform : public UntrainableTransform | |
| 10 | +{ | |
| 11 | + Q_OBJECT | |
| 12 | + Q_PROPERTY(QDouble pyr_scale READ get_pyr_scale WRITE set_pyr_scale RESET reset_pyr_scale STORE false) | |
| 13 | + BR_PROPERTY(double, pyr_scale, 0.5) | |
| 14 | + Q_PROPERTY(QString pyr_scale READ get_pyr_scale WRITE set_pyr_scale RESET reset_pyr_scale STORE false) | |
| 15 | + BR_PROPERTY(double, pyr_scale, 0.5) | |
| 16 | + | |
| 17 | + void project(const Template &src, Template &dst) const | |
| 18 | + { | |
| 19 | + // get the two images | |
| 20 | + // these were the best parameters on KTH | |
| 21 | + calcOpticalFlowFarneback(prevImg, nextImg, dst, 0.1, 1, 5, 10, 7, 1.1, 0); | |
| 22 | + } | |
| 23 | +} | |
| 24 | + | |
| 25 | +} // namespace br | |
| 26 | + | |
| 27 | +#include | ... | ... |