24 #ifndef CCORRELATION_FACTORY
25 #define CCORRELATION_FACTORY
48 #include "Ccorrelation_intercor.h"
60 template<
typename T,
typename Timg>
67 std::vector<std::string> m_infos;
68 std::string class_name, m_variable, m_type;
69 CParameterNetCDF m_paramFile;
72 const char* m_paramPath;
79 class_name =
"Correlation : factory";
85 m_infos.push_back(
"IC_direct");
86 m_infos.push_back(
"IC_fftw");
87 m_infos.push_back(
"IC_fftw_phase");
88 m_infos.push_back(
"IC_fft");
89 m_infos.push_back(
"IC_fft_phase");
90 m_infos.push_back(
"OFI");
91 m_infos.push_back(
"OFIB");
92 m_infos.push_back(
"OFFEM_newton");
93 m_infos.push_back(
"OFFEM_gradient");
115 std::cerr<<class_name<<
" : "<<number<<
" refers to an unknown or incompatible correlation class"<<std::flush;
120 if (m_verbose){printf(
"%s -> %s class loaded\n",class_name.c_str(), m_type.c_str());}
122 pCorrel->m_verbose = m_verbose;
123 pCorrel->m_correl_type = m_type;
124 pCorrel->m_correl_name = m_variable;
126 pCorrel->init(m_paramFile);
135 if(type==m_infos[0])
return create(0);
136 else if(type==m_infos[1])
return create(1);
137 else if(type==m_infos[2])
return create(2);
138 else if(type==m_infos[3])
return create(3);
139 else if(type==m_infos[4])
return create(4);
140 else if(type==m_infos[5])
return create(5);
141 else if(type==m_infos[6])
return create(6);
142 else if(type==m_infos[7])
return create(7);
143 else if(type==m_infos[8])
return create(8);
146 std::cerr<<class_name<<
" : "<<type<<
" refers to an unknown or incompatible correlation class"<<std::flush;
155 std::string method, m_corType;
157 paramFile.loadAttribute(
"type",m_type, &m_variable);
162 paramFile.loadAttribute(
"method",method, &m_variable);
163 m_corType = m_corType +
"_" + method;
166 return create(m_corType);
173 commandLine(argc,argv);
179 if(m_paramPath!=
"true")
182 NcFile file(m_paramPath,NcFile::ReadOnly);
184 if ( error = m_paramFile.setFile(&file) !=1 )
186 std::cerr<<
"Error while loading"<<m_paramPath<<
" parameter file"<<std::endl;
190 pCorrel = create(m_paramFile);
192 if (pCorrel == NULL){
return NULL;}
200 std::cout<<
" --correlator option : Command line\n";
201 std::cout<<
" --building!!\n";
213 void commandLine(
int argc,
char *argv[])
217 m_paramPath = cimg_option(
"-p",
"./parameters.nc",
"parameter, mesh or true");
219 m_verbose = cimg_option(
"-v",
false,0);
223 printf(
"Mode Verbose\n");
224 printf(
"%s : %s\n",class_name.c_str(),m_paramPath);
229 void stringSplit(std::string manyString, std::vector<std::string> value)
233 char *split=(
char*)(
" ,;");
235 cstr =
new char [manyString.size()+1];
236 strcpy(cstr,manyString.c_str());
237 ptr=strtok(cstr,split);
240 value.push_back(ptr);
241 ptr=strtok(NULL,split);
250 printf(
"\nclass %s\n",class_name.c_str());
251 for (
int i=0; i<m_infos.size(); i++)
254 printf(
"\t(%i) mode : %s\n",i,m_infos[i].c_str());
It implements optical flow strategy for FEM method using newton method.
this branch doesn't requires image size equal to a power of 2 since it uses FFtw which already implem...
It implements optical flow strategy for FEM method.
It returns a pointer toward a specific correlation method according to a parameter.nc file. The parameter file is set by default or could be provide by command line. create function could be called using : int, string = type, CParameterNetCDF, and finally [argv,argc] !!!! The function to get parameters directly from command line doesn't work yet.
Definition: Ccorrelation_factory.h:61
It implements the Optical Flow with Integrated kinematics within independant block such as Block-matc...
Definition: Ccorrelation_opticalFlow_integrated_block.h:43
Definition: Ccorrelation_intercor_direct.h:38
Definition: Ccorrelation_intercor_fftw_phase.h:46
Definition: Ccorrelation_opticalFlow_integrated.h:43
It implements optical flow strategy for global shape functions.
this is the mother class of every correlation classes. m_correl_type refers to the the type of correl...
Definition: Ccorrelation.h:65
It implements optical flow strategy.
Definition: Ccorrelation_opticalFlow_fem_newton.h:43
Definition: Ccorrelation_intercor_fftw.h:39
Definition: Ccorrelation_intercor_fft.h:47
Definition: Ccorrelation_opticalFlow_fem_gradient.h:43
!!!!It implements the zeroPadding but doesn't work with fftw lib and the actual architecture since th...
implement the cross correlation between correlogram[0] and correlogram[1] using CImg function...
it links to zeroPadd method and normalization one of anySize_normalized
It implements optical flow strategy for FEM method using gradient algorithm.
this class implement 2 functions:
Definition: Ccorrelation_intercor_fft_phase.h:45
Ccorrelation_factory(const std::string name)
Definition: Ccorrelation_factory.h:76