IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseEstimator.h
1 // BaseEstimator.h:
3 // ----------------
4 //
15 
16 #ifndef __IPSDKMATH_BASEESTIMATOR_H__
17 #define __IPSDKMATH_BASEESTIMATOR_H__
18 
19 // suppression warnings
20 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::math::BaseEstimator'
21 #pragma warning (push)
22 #pragma warning (disable : 4275)
23 
26 #include <IPSDKUtil/Tools/ProcessingResult.h>
27 #include <boost/noncopyable.hpp>
28 
29 namespace ipsdk {
30 namespace math {
31 
34 
35 class IPSDKMATH_API BaseEstimator : public boost::noncopyable
36 {
37  // friend class for protected members acccess
38  friend class BaseRobustEstimator;
39 
40 public:
43  BaseEstimator();
44  virtual ~BaseEstimator() = 0;
46 
47 // methods
48 public:
50  bool isInit() const;
51 
54  ipUInt32 getNbMinRequestedData() const;
55 
58  ipUInt32 getNbEstimParams() const;
59 
62  ipUInt32 getDataSize() const;
63 
67  BoolResult computeEstimation(const DataSet& dataSet,
68  ParameterType& estimParams);
69 
76  BoolResult computeResiduals(const DataSet& dataSet,
77  const ParameterType& estimParams,
78  ResidualsSet& residualsSet) const;
79 
80 protected:
88  void initBase(const ipUInt32 nbMinRequestedData,
89  const ipUInt32 nbEstimParams,
90  const ipUInt32 dataSize);
91 
95  BoolResult checkData(const DataSet& dataSet,
96  const ParameterType& estimParams) const;
97 
100  virtual BoolResult processEstimation(const DataSet& dataSet,
101  ParameterType& estimParams) = 0;
102 
105  virtual BoolResult processResiduals(const DataSet& dataSet,
106  const ParameterType& estimParams,
107  ResidualsSet& residualsSet) const = 0;
108 
109 // attributes
110 private:
112  ipUInt32 _nbMinRequestedData;
113 
115  ipUInt32 _nbEstimParams;
116 
118  ipUInt32 _dataSize;
119 
121  bool _bInit;
122 };
123 
126 
127 inline bool
129 {
130  return _bInit;
131 }
132 
135 
136 } // end of namespace math
137 } // end of namespace ipsdk
138 
139 #pragma warning (pop)
140 
141 #endif // __IPSDKMATH_BASEESTIMATOR_H__
Vector ParameterType
parameter type resulting from estimation
Definition: EstimationTypes.h:61
Definition of import/export macro for library.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Base class for parametric estimation from data set.
Definition: BaseEstimator.h:35
std::vector< DataType > DataSet
collection of data associated to estimation
Definition: EstimationTypes.h:67
bool isInit() const
check for object initialization
Definition: BaseEstimator.h:128
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
Base class for parametric robust estimation from data set.
Definition: BaseRobustEstimator.h:36
Predefined types for parametric estimation from data set.
Vector ResidualsSet
residuals type resulting from estimation
Definition: EstimationTypes.h:64
IPSDKMATH_API void processEstimation(const EstimationConfig &config, const EstimatorPtr &pEstimator, const DataSet &inputDataSet, EstimationResults &results)
function allowing to launch a robust estimation process
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53