JeVoisBase  1.21
JeVois Smart Embedded Machine Vision Toolkit Base Modules
Share this page:
Loading...
Searching...
No Matches
FastOpticalFlow Class Reference

Fast optical flow computation using dense inverse search. More...

#include <jevoisbase/Components/OpticalFlow/FastOpticalFlow.H>

Inheritance diagram for FastOpticalFlow:
Collaboration diagram for FastOpticalFlow:

Public Member Functions

 FastOpticalFlow (std::string const &instance)
 Constructor.
 
virtual ~FastOpticalFlow ()
 Destructor.
 
void process (cv::Mat const &src, cv::Mat &dst)
 Process a greyscale image and return flow in a pre-allocated greyscale image of same with and 2x height.
 
- Public Member Functions inherited from jevois::Component
 Component (std::string const &instance)
 
virtual ~Component ()
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
bool initialized () const
 
std::string const & className () const
 
std::string const & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor, bool doit)
 
void freezeAllParams (bool doit)
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 
void removeDynamicParameter (std::string const &name, bool throw_if_not_found=true)
 
void setPath (std::string const &path)
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 
std::shared_ptr< Comp > addSubComponent (std::string const &instance, Args &&...args)
 
void removeSubComponent (std::shared_ptr< Comp > &component)
 
void removeSubComponent (std::string const &instance, bool warnIfNotFound=true)
 
std::shared_ptr< Comp > getSubComponent (std::string const &instance) const
 
bool isTopLevel () const
 
bool initialized () const
 
std::string const & className () const
 
std::string const & instanceName () const
 
std::vector< std::string > setParamVal (std::string const &paramdescriptor, T const &val)
 
void setParamValUnique (std::string const &paramdescriptor, T const &val)
 
std::vector< std::pair< std::string, T > > getParamVal (std::string const &paramdescriptor) const
 
getParamValUnique (std::string const &paramdescriptor) const
 
std::vector< std::string > setParamString (std::string const &paramdescriptor, std::string const &val)
 
void setParamStringUnique (std::string const &paramdescriptor, std::string const &val)
 
std::vector< std::pair< std::string, std::string > > getParamString (std::string const &paramdescriptor) const
 
std::string getParamStringUnique (std::string const &paramdescriptor) const
 
void freezeParam (std::string const &paramdescriptor, bool doit)
 
void freezeAllParams (bool doit)
 
std::string descriptor () const
 
void setParamsFromFile (std::string const &filename)
 
std::istream & setParamsFromStream (std::istream &is, std::string const &absfile)
 
virtual void paramInfo (std::shared_ptr< UserInterface > s, std::map< std::string, std::string > &categs, bool skipFrozen, std::string const &cname="", std::string const &pfx="")
 
void foreachParam (std::function< void(std::string const &compname, ParameterBase *p)> func, std::string const &cname="")
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ParameterCategory const &category)
 
std::shared_ptr< DynamicParameter< T > > addDynamicParameter (std::string const &name, std::string const &description, T const &defaultValue, ValidValuesSpec< T > const &validValuesSpec, ParameterCategory const &category)
 
void setDynamicParameterCallback (std::string const &name, std::function< void(T const &)> cb, bool callnow=true)
 
void removeDynamicParameter (std::string const &name, bool throw_if_not_found=true)
 
void setPath (std::string const &path)
 
std::filesystem::path absolutePath (std::filesystem::path const &path="")
 
- Public Member Functions inherited from jevois::ParameterRegistry
virtual ~ParameterRegistry ()
 

Protected Member Functions

void onParamChange (fastopticalflow::opoint const &param, int const &val) override
 
void onParamChange (fastopticalflow::thetasf const &param, int const &val) override
 
void onParamChange (fastopticalflow::thetaps const &param, int const &val) override
 
void onParamChange (fastopticalflow::thetaov const &param, float const &val) override
 
- Protected Member Functions inherited from jevois::Component
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
virtual void preInit ()
 
virtual void postInit ()
 
virtual void preUninit ()
 
virtual void postUninit ()
 
- Protected Member Functions inherited from jevois::ParameterRegistry
void addParameter (ParameterBase *const param)
 
void removeParameter (ParameterBase *const param)
 
void callbackInitCall ()
 

Protected Attributes

jevois::Profiler itsProfiler
 
std::mutex itsMtx
 
bool itsNuke
 
const float ** img_bo_pyr
 
const float ** img_bo_dx_pyr
 
const float ** img_bo_dy_pyr
 
cv::Mat * img_bo_fmat_pyr
 
cv::Mat * img_bo_dx_fmat_pyr
 
cv::Mat * img_bo_dy_fmat_pyr
 
cv::Mat img_bo_mat
 
cv::Mat img_bo_fmat
 
int itsHeight
 
int itsWidth
 
int itsPyrDepth
 

Related Symbols

(Note that these are not member symbols.)

 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (opoint, int, "Algorithm operating point", 1, jevois::Range< int >(1, 4), ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (factor, float, "Factor to use when converting float velocities to byte", 25.0F, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (thetasf, int, "Finest scale in the pyramid, or -1 for auto", -1, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (thetait, int, "Number of gradient descent iterations, or -1 for auto", 5, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (thetaps, int, "Patch size in pixels, or -1 for auto", -1, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK (thetaov, float, "Patch overlap on each scale, or -1 for auto", 0.1F, ParamCateg)
 Parameter.
 
 JEVOIS_DECLARE_PARAMETER (usevref, bool, "Use variational refinement when true", false, ParamCateg)
 Parameter.
 

Detailed Description

Fast optical flow computation using dense inverse search.

This algorithm computes what moved between two images (optical flow). It is based on the paper "Fast Optical Flow using Dense Inverse Search" by Till Kroeger, Radu Timofte, Dengxin Dai and Luc Van Gool, Proc ECCV, 2016. Also see here: http://www.vision.ee.ethz.ch/~kroegert/OFlow/

Definition at line 61 of file FastOpticalFlow.H.

Constructor & Destructor Documentation

◆ FastOpticalFlow()

FastOpticalFlow::FastOpticalFlow ( std::string const &  instance)

Constructor.

Definition at line 29 of file FastOpticalFlow.C.

◆ ~FastOpticalFlow()

FastOpticalFlow::~FastOpticalFlow ( )
virtual

Member Function Documentation

◆ onParamChange() [1/4]

void FastOpticalFlow::onParamChange ( fastopticalflow::opoint const &  param,
int const &  val 
)
overrideprotected

◆ onParamChange() [2/4]

void FastOpticalFlow::onParamChange ( fastopticalflow::thetaov const &  param,
float const &  val 
)
overrideprotected

◆ onParamChange() [3/4]

void FastOpticalFlow::onParamChange ( fastopticalflow::thetaps const &  param,
int const &  val 
)
overrideprotected

◆ onParamChange() [4/4]

void FastOpticalFlow::onParamChange ( fastopticalflow::thetasf const &  param,
int const &  val 
)
overrideprotected

◆ process()

void FastOpticalFlow::process ( cv::Mat const &  src,
cv::Mat &  dst 
)

Process a greyscale image and return flow in a pre-allocated greyscale image of same with and 2x height.

The results are the concatenation of 2 images: vx on top of vy, both converted to byte.

Definition at line 154 of file FastOpticalFlow.C.

References jevois::Profiler::checkpoint(), img_bo_dx_fmat_pyr, img_bo_dx_pyr, img_bo_dy_fmat_pyr, img_bo_dy_pyr, img_bo_fmat, img_bo_fmat_pyr, img_bo_mat, img_bo_pyr, itsHeight, itsMtx, itsNuke, itsProfiler, itsPyrDepth, itsWidth, LFATAL, jevois::Profiler::start(), and jevois::Profiler::stop().

Friends And Related Symbol Documentation

◆ JEVOIS_DECLARE_PARAMETER() [1/3]

JEVOIS_DECLARE_PARAMETER ( factor  ,
float  ,
"Factor to use when converting float velocities to byte"  ,
25.  0F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [2/3]

JEVOIS_DECLARE_PARAMETER ( thetait  ,
int  ,
"Number of gradient descent  iterations,
or -1 for auto"  ,
,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER() [3/3]

JEVOIS_DECLARE_PARAMETER ( usevref  ,
bool  ,
"Use variational refinement when true"  ,
false  ,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [1/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( opoint  ,
int  ,
"Algorithm operating point"  ,
,
jevois::Range< int >  1, 4,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [2/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( thetaov  ,
float  ,
"Patch overlap on each  scale,
or -1 for auto"  ,
0.  1F,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [3/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( thetaps  ,
int  ,
"Patch size in  pixels,
or -1 for auto"  ,
1,
ParamCateg   
)
related

Parameter.

◆ JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK() [4/4]

JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK ( thetasf  ,
int  ,
"Finest scale in the  pyramid,
or -1 for auto"  ,
1,
ParamCateg   
)
related

Parameter.

Member Data Documentation

◆ img_bo_dx_fmat_pyr

cv::Mat* FastOpticalFlow::img_bo_dx_fmat_pyr
protected

Definition at line 94 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_dx_pyr

const float** FastOpticalFlow::img_bo_dx_pyr
protected

Definition at line 90 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_dy_fmat_pyr

cv::Mat* FastOpticalFlow::img_bo_dy_fmat_pyr
protected

Definition at line 95 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_dy_pyr

const float** FastOpticalFlow::img_bo_dy_pyr
protected

Definition at line 91 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_fmat

cv::Mat FastOpticalFlow::img_bo_fmat
protected

Definition at line 98 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_fmat_pyr

cv::Mat* FastOpticalFlow::img_bo_fmat_pyr
protected

Definition at line 93 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_mat

cv::Mat FastOpticalFlow::img_bo_mat
protected

Definition at line 97 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ img_bo_pyr

const float** FastOpticalFlow::img_bo_pyr
protected

Definition at line 89 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ itsHeight

int FastOpticalFlow::itsHeight
protected

Definition at line 100 of file FastOpticalFlow.H.

Referenced by process().

◆ itsMtx

std::mutex FastOpticalFlow::itsMtx
protected

Definition at line 85 of file FastOpticalFlow.H.

Referenced by process().

◆ itsNuke

bool FastOpticalFlow::itsNuke
protected

Definition at line 87 of file FastOpticalFlow.H.

Referenced by process().

◆ itsProfiler

jevois::Profiler FastOpticalFlow::itsProfiler
protected

Definition at line 84 of file FastOpticalFlow.H.

Referenced by process().

◆ itsPyrDepth

int FastOpticalFlow::itsPyrDepth
protected

Definition at line 101 of file FastOpticalFlow.H.

Referenced by process(), and ~FastOpticalFlow().

◆ itsWidth

int FastOpticalFlow::itsWidth
protected

Definition at line 100 of file FastOpticalFlow.H.

Referenced by process().


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