iVS3D v2.0.0
Loading...
Searching...
No Matches
FlowCalculator Class Referenceabstract

The FlowCalculator class is an interface which defines the structure for the hardware specific algorithm. 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 <flowcalculator.h>

Inheritance diagram for FlowCalculator:
FlowCalculatorCpu FlowCalculatorCpu FlowCalculatorCuda FlowCalculatorCuda

Public Member Functions

virtual double calculateFlow (cv::Mat fromMat, cv::Mat toMat)=0
 calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
 
virtual double calculateFlow (cv::Mat fromMat, cv::Mat toMat)=0
 calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value
 

Protected Member Functions

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
 

Private Member Functions

double median (std::vector< double > vec)
 median calculates the median of a double vector in place
 
double median (std::vector< double > vec)
 median calculates the median of a double vector in place
 

Detailed Description

The FlowCalculator class is an interface which defines the structure for the hardware specific algorithm. 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

Member Function Documentation

◆ calculateFlow() [1/2]

virtual double FlowCalculator::calculateFlow ( cv::Mat  fromMat,
cv::Mat  toMat 
)
pure virtual

calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value

Parameters
fromMatcv::Mat which is the image before the posible movement
toMatcv::Mat which is the image after the posible movement
Returns
doubel which represents the movement between the images

Implemented in FlowCalculatorCpu, FlowCalculatorCuda, FlowCalculatorCpu, and FlowCalculatorCuda.

◆ calculateFlow() [2/2]

virtual double FlowCalculator::calculateFlow ( cv::Mat  fromMat,
cv::Mat  toMat 
)
pure virtual

calculateFlow computes the flow between two images and reduces the resulting flow-matrix to a single floating point value

Parameters
fromMatcv::Mat which is the image before the posible movement
toMatcv::Mat which is the image after the posible movement
Returns
doubel which represents the movement between the images

Implemented in FlowCalculatorCpu, FlowCalculatorCuda, FlowCalculatorCpu, and FlowCalculatorCuda.

◆ flowMatToDouble() [1/2]

double FlowCalculator::flowMatToDouble ( cv::Mat  mat)
protected

flowMatToDouble reduces a flow-matrix to a single floating point value, if that mat was empty return -1.0

Parameters
matcv::Mat which hold represents the flow-matrix
Returns
double which represents the reduced flow-matrix

◆ flowMatToDouble() [2/2]

double FlowCalculator::flowMatToDouble ( cv::Mat  mat)
protected

flowMatToDouble reduces a flow-matrix to a single floating point value, if that mat was empty return -1.0

Parameters
matcv::Mat which hold represents the flow-matrix
Returns
double which represents the reduced flow-matrix

◆ median() [1/2]

double FlowCalculator::median ( std::vector< double >  vec)
private

median calculates the median of a double vector in place

Parameters
vecis a double vector
Returns
the median of the double vector

◆ median() [2/2]

double FlowCalculator::median ( std::vector< double >  vec)
private

median calculates the median of a double vector in place

Parameters
vecis a double vector
Returns
the median of the double vector

The documentation for this class was generated from the following files: