YaDICs  V04.14.a
Yet another Digital Image Correlation software: platform dedicated to 2/3D Fluid and Solid kinematics field measurements.
 All Classes Files Functions Variables Pages
Ccorrelation.h
Go to the documentation of this file.
1 /**********************************************************************
2  * Copyright (C) 2012, The YaDICs Project Developers.
3  * See the COPYRIGHT file at the top-level directory of this distribution ./COPYRIGHT.
4  * See ./COPYING file for copying and redistribution conditions.
5  *
6  * This file is part of YaDICs.
7  * YaDICs is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * YaDICs is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with YaDICs. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Information about how to use the software are provided at http://yadic.univ-lille1.fr/
21  **********************************************************************/
22 
23 
24 #ifndef CCORRELATION
25 #define CCORRELATION
26 
35 //-----------------------------CIMG_NETCDF-------------------------------
36 #define cimg_plugin "plugins/add_fileformat.h"
37 #define cimg_use_netcdf
38 
39 #ifdef cimg_use_netcdf
40  #include "../NetCDF.Tool/struct_parameter_NetCDF.h"
41 // #define cimg_plugin1 "plugins/netcdf_file_format4CImg1.h"
42 // #define cimglist_plugin1 "plugins/netcdf_file_format4CImgList1.h"
43  #define cimg_plugin2 "plugins/netcdf_file_format4CImg2.h"
44  #define cimglist_plugin2 "plugins/netcdf_file_format4CImgList2.h"
45  #include "../CImg.Tool/CImg_NetCDF.h"
46 #endif
47 //-----------------------------CIMG_NETCDF-------------------------------
48 
49 
50 #include "Cimage.h"
51 #include "Cfield.h"
52 #include "Cmesh_factory.h"
53 #include "CNpeak.h"
54 #include "CshapeFunction_factory.h"
55 
64 template<typename T, typename Timg>
66 {
67 
68  public:
69 
70  std::string class_name, m_correl_type, m_correl_name;
71  T m_current_res;// mean residue between ref and corrected deformed image
72  int m_threadNB, _3D;// storage mode activation, thread number & if 3D
73  int m_medianFilter;
74 
75  bool m_verbose;
76 
77 
78  Ccorrelation()
79  {// constructor
80 
81  class_name = "Correlation : mother";
82 
83  #pragma omp parallel
84  {//total number of thread required for reduction process
85  m_threadNB = omp_get_num_threads();
86  }
87 
88  }
89 
90 
91 
92  virtual void init(CParameterNetCDF &fp) = 0;
93 
94  virtual void exec(const Cimage<Timg> &oImage, const Cmesh<T,Timg> &oMesh, Cfield<T,Timg> &oField) = 0;//launch correlation method
95 
96  virtual void regularize(const Cmesh<T,Timg> &oMesh, const Cimage<Timg> &oImage, CImgList<T> &solution)
97  {// apply median filter to intermediate fields
98 
101  cimglist_for(solution,var)
102  {//median filter on fields
103  solution[var].blur_median(m_medianFilter);
104  }
105 
106  }
107 
108  void count(const int &increment, const int &dim, int &counter)
109  {// counter
110 
111  if (100-increment*100/dim<=counter-10)
112  {
113  std::cout<<"remaining : "<<(int)(100.-increment*100./dim)<<"\%\n";
114  counter = 100-increment*100/dim;
115  }
116 
117  }
118 
119 
120 
121 };
122 
123 #endif
virtual void regularize(const Cmesh< T, Timg > &oMesh, const Cimage< Timg > &oImage, CImgList< T > &solution)
Definition: Ccorrelation.h:96
load image and mask from cdl and store fields. It also creates a resized version of data in the case ...
this is the mother class of every correlation classes. m_correl_type refers to the the type of correl...
Definition: Ccorrelation.h:65
Definition: Cmesh.h:61
Definition: Cfield.h:51
It implements a vector of n pointer toward a specific Cpeak class to detected successive peaks within...
Definition: Cimage.h:57