The FlowCalculatorCpu class is a hardware specific implementation of FlowCalculator. The algorithm takes two pictures and calculates a flow matrix using the Farneback algorithm. Than the flow matrix is evalutated and reduced to one single flow value.
More...
#include <flowcalculatorcpu.h>
|
| | FlowCalculatorCpu (int numLevels=5, double pyrScale=0.5, bool fastPyramids=false, int winSize=13, int numIters=10, int polyN=5, double polySigma=1.1, int flags=0) |
| | FlowCalculatorCpu Constructor creates a Farneback object which is used to execute the farneback algortihm later.
|
| |
|
| ~FlowCalculatorCpu () |
| | FlowCalculatorCpu Destructor cleans up left over data and pointers.
|
| |
| double | calculateFlow (cv::Mat fromMat, cv::Mat toMat) override |
| | calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
|
| |
| | FlowCalculatorCpu (int numLevels=5, double pyrScale=0.5, bool fastPyramids=false, int winSize=13, int numIters=10, int polyN=5, double polySigma=1.1, int flags=0) |
| | FlowCalculatorCpu Constructor creates a Farneback object which is used to execute the farneback algortihm later.
|
| |
|
| ~FlowCalculatorCpu () |
| | FlowCalculatorCpu Destructor cleans up left over data and pointers.
|
| |
| double | calculateFlow (cv::Mat fromMat, cv::Mat toMat) override |
| | calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
|
| |
|
| double | flowMatToDouble (cv::Mat mat) |
| | flowMatToDouble reduces a flow-matrix to a single floating point value, if that mat was empty return -1.0
|
| |
| double | flowMatToDouble (cv::Mat mat) |
| | flowMatToDouble reduces a flow-matrix to a single floating point value, if that mat was empty return -1.0
|
| |
The FlowCalculatorCpu class is a hardware specific implementation of FlowCalculator. The algorithm takes two pictures and calculates a flow matrix using the Farneback algorithm. Than the flow matrix is evalutated and reduced to one single flow value.
- Author
- Dominic Zahn
- Date
- 2022/04/12
◆ FlowCalculatorCpu() [1/2]
| FlowCalculatorCpu::FlowCalculatorCpu |
( |
int |
numLevels = 5, |
|
|
double |
pyrScale = 0.5, |
|
|
bool |
fastPyramids = false, |
|
|
int |
winSize = 13, |
|
|
int |
numIters = 10, |
|
|
int |
polyN = 5, |
|
|
double |
polySigma = 1.1, |
|
|
int |
flags = 0 |
|
) |
| |
FlowCalculatorCpu Constructor creates a Farneback object which is used to execute the farneback algortihm later.
- Parameters
-
| numLevels | number of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used |
| pyrScale | parameter, specifying the image scale (<1) to build pyramids for each image; pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. |
| fastPyramids | uses a faster calculation for |
| winSize | averaging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field. |
| numIters | number of iterations the algorithm does at each pyramid level |
| polyN | size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically poly_n =5 or 7. |
| polySigma | standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good value would be poly_sigma=1.5. |
| flags | - OPTFLOW_USE_INITIAL_FLOW uses the input flow as an initial flow approximation.
- OPTFLOW_FARNEBACK_GAUSSIAN uses the Gaussian \texttt{winsize}\times\texttt{winsize} filter instead of a box filter of the same size for optical flow estimation
|
◆ FlowCalculatorCpu() [2/2]
| FlowCalculatorCpu::FlowCalculatorCpu |
( |
int |
numLevels = 5, |
|
|
double |
pyrScale = 0.5, |
|
|
bool |
fastPyramids = false, |
|
|
int |
winSize = 13, |
|
|
int |
numIters = 10, |
|
|
int |
polyN = 5, |
|
|
double |
polySigma = 1.1, |
|
|
int |
flags = 0 |
|
) |
| |
FlowCalculatorCpu Constructor creates a Farneback object which is used to execute the farneback algortihm later.
- Parameters
-
| numLevels | number of pyramid layers including the initial image; levels=1 means that no extra layers are created and only the original images are used |
| pyrScale | parameter, specifying the image scale (<1) to build pyramids for each image; pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous one. |
| fastPyramids | uses a faster calculation for |
| winSize | averaging window size; larger values increase the algorithm robustness to image noise and give more chances for fast motion detection, but yield more blurred motion field. |
| numIters | number of iterations the algorithm does at each pyramid level |
| polyN | size of the pixel neighborhood used to find polynomial expansion in each pixel; larger values mean that the image will be approximated with smoother surfaces, yielding more robust algorithm and more blurred motion field, typically poly_n =5 or 7. |
| polySigma | standard deviation of the Gaussian that is used to smooth derivatives used as a basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a good value would be poly_sigma=1.5. |
| flags | - OPTFLOW_USE_INITIAL_FLOW uses the input flow as an initial flow approximation.
- OPTFLOW_FARNEBACK_GAUSSIAN uses the Gaussian \texttt{winsize}\times\texttt{winsize} filter instead of a box filter of the same size for optical flow estimation
|
◆ calculateFlow() [1/2]
| double FlowCalculatorCpu::calculateFlow |
( |
cv::Mat |
fromMat, |
|
|
cv::Mat |
toMat |
|
) |
| |
|
overridevirtual |
calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
- Parameters
-
| fromMat | cv::Mat which is the image before the posible movement |
| toMat | cv::Mat which is the image after the posible movement |
- Returns
- doubel which represents the movement between the images
Implements FlowCalculator.
◆ calculateFlow() [2/2]
| double FlowCalculatorCpu::calculateFlow |
( |
cv::Mat |
fromMat, |
|
|
cv::Mat |
toMat |
|
) |
| |
|
overridevirtual |
calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
- Parameters
-
| fromMat | cv::Mat which is the image before the posible movement |
| toMat | cv::Mat which is the image after the posible movement |
- Returns
- doubel which represents the movement between the images
Implements FlowCalculator.
The documentation for this class was generated from the following files:
- iVS3D/src/iVS3D-smoothCameraMovementPlugin/flowcalculatorcpu.h
- iVS3D/src/iVS3D-stationaryCameraPlugin/flowcalculatorcpu.h
- iVS3D/src/iVS3D-smoothCameraMovementPlugin/flowcalculatorcpu.cpp
- iVS3D/src/iVS3D-stationaryCameraPlugin/flowcalculatorcpu.cpp