24 #ifndef CCORRELATION_OPTICALFLOW_FEM
25 #define CCORRELATION_OPTICALFLOW_FEM
42 template<
typename T,
typename Timg>
51 this->class_name =
"Correlation : Optical Flow Finite Element Method";
55 virtual void init(CParameterNetCDF &fp)
64 std::string attribute_name =
"median_filter";
65 int error = fp.loadAttribute(attribute_name,this->m_medianFilter);
66 if (this->m_verbose){printf(
"\t\t median filter over following domain -> %i\n",this->m_medianFilter);}
70 virtual void assignL(
const Cmesh<T,Timg> &oMesh, CImgList<T> &Ve)
73 Ve.assign(oMesh.num_var(), oMesh.num_mod(),1,1,1, 0);
77 virtual void evalGN(
const std::vector<T> &grad,
const CImgList<T> &N, CImgList<T> &Ve)
82 cimg_forX(N[dim], mode)
84 Ve[dim][mode] = grad[dim] * N[dim][mode];
93 cimglist_for(oMesh.m_node, dim)
95 ref[dim] = oMesh.m_node[dim][oMesh.m_connect[elem].front()]*oImage.m_pix[dim] ;
100 virtual void evalShape(
const CImg<Timg> &list,
const Cimage<Timg> &oImage,
const Cfield<T,Timg> &oField,
const std::vector<T> &ref,
const std::vector<T> &lCoor,
const std::vector<T> &gCoor, CImgList<T> &N)
106 (oField.m_pShape)->exec(list, coor, N);
110 virtual void evalU(
const CImgList<T> &solution,
const Cmesh<T,Timg> &oMesh,
const int &elem,
const CImgList<T> &N, std::vector<T> &U)
120 cimg_forX(N[dim], mode)
122 U[dim] += solution[dim][oMesh.m_connect[elem][mode]] * N[dim][mode];
virtual void init(CParameterNetCDF &fp)
Definition: Ccorrelation_opticalFlow_fem.h:55
This is the mother class of Optical Flow strategies: It implements different steps required for the i...
Definition: Ccorrelation_opticalFlow.h:53
It implements optical flow strategy.
Definition: Ccorrelation_opticalFlow_fem.h:43
virtual void init(CParameterNetCDF &fp)
Definition: Ccorrelation_opticalFlow.h:69