IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PythonEstimationUtils.h
Go to the documentation of this file.
1 // PythonEstimationUtils.h:
3 // ------------------------
4 //
14 
15 #ifndef __PYIPSDKBASE_PYTHONESTIMATIONUTILS_H__
16 #define __PYIPSDKBASE_PYTHONESTIMATIONUTILS_H__
17 
19 #include <IPSDKGeometry/Entity/2d/Point/Point2d.h>
20 #include <IPSDKGeometry/Entity/2d/Line/Line2d.h>
21 #include <IPSDKGeometry/Entity/2d/Circle/Circle2d.h>
22 #include <IPSDKGeometry/Entity/2d/Ellipse/Ellipse2d.h>
23 #include <IPSDKMath/Geometry/2d/Transform/Rigid2d.h>
24 #include <IPSDKMath/Geometry/2d/Transform/Similarity2d.h>
25 #include <IPSDKMath/Geometry/2d/Transform/Homography2d.h>
26 #include <IPSDKGeometry/Entity/3d/Point/Point3d.h>
27 #include <IPSDKGeometry/Entity/3d/Ellipsoid/Ellipsoid3d.h>
28 #include <IPSDKGeometry/Entity/3d/Plan/Plan3d.h>
29 #include <IPSDKGeometry/Entity/3d/Sphere/Sphere3d.h>
30 #include <IPSDKMath/Geometry/3d/Transform/Homography3d.h>
31 #include <IPSDKMath/Geometry/3d/Transform/Rigid3d.h>
32 #include <IPSDKMath/Geometry/3d/Transform/Similarity3d.h>
33 #include <IPSDKGeometry/Transform/3d/SimilarityTransform3d.h>
34 #include <IPSDKMath/Estimation/EstimationConfig.h>
35 #include <IPSDKMath/Estimation/EstimationResults.h>
37 #include <boost/python/tuple.hpp>
38 #include <vector>
39 
40 namespace ipsdk {
41 namespace python {
42 
45 
52 template <typename T>
53 PYIPSDKBASE_API boost::python::tuple
54 line2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl,
55  const math::EstimationConfig& config);
56 template <typename T>
57 inline boost::python::tuple
58 line2dSimpleEstimation(const std::vector<geom::Point2dData<T> >& ptColl)
59 {
61  config.initNonRobust();
62 
63  return line2dEstimation(ptColl, config);
64 }
66 
67 
70 
79 template <typename T>
80 PYIPSDKBASE_API boost::python::tuple
81 gaussianCurve2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl,
82  const math::EstimationConfig& config);
83 template <typename T>
84 inline boost::python::tuple
86 {
88  config.initNonRobust();
89 
90  return gaussianCurve2dEstimation(ptColl, config);
91 }
93 
96 
103 PYIPSDKBASE_API boost::python::tuple
104 polynomial2dSurfaceEstimator(const std::vector<geom::Point3dData<ipReal64> >& dataColl,
105  const math::EstimationConfig& config);
106 inline boost::python::tuple
108 {
109  math::EstimationConfig config;
110  config.initNonRobust();
111 
112  return polynomial2dSurfaceEstimator(dataColl, config);
113 }
115 
118 
125 template <typename T>
126 PYIPSDKBASE_API boost::python::tuple
127 circle2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl,
128  const math::EstimationConfig& config,
129  const bool bProcessNonLinearPass);
130 template <typename T>
131 inline boost::python::tuple
132 circle2dSimpleEstimation(const std::vector<geom::Point2dData<T> >& ptColl)
133 {
134  math::EstimationConfig config;
135  config.initNonRobust();
136 
137  return circle2dEstimation(ptColl, config, false);
138 }
140 
143 
150 template <typename T>
151 PYIPSDKBASE_API boost::python::tuple
152 ellipse2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl,
153  const math::EstimationConfig& config);
154 template <typename T>
155 inline boost::python::tuple
157 {
158  math::EstimationConfig config;
159  config.initNonRobust();
160 
161  return ellipse2dEstimation(ptColl, config);
162 }
164 
167 
175 PYIPSDKBASE_API boost::python::tuple
176 intersectionPoint2dEstimation(const std::vector<geom::Line2d>& line2dColl,
177  const math::EstimationConfig& config);
178 inline boost::python::tuple
179 intersectionPoint2dSimpleEstimation(const std::vector<geom::Line2d>& line2dColl)
180 {
181  math::EstimationConfig config;
182  config.initNonRobust();
183 
184  return intersectionPoint2dEstimation(line2dColl, config);
185 }
187 
190 
199 template <typename T>
200 PYIPSDKBASE_API boost::python::tuple
201 homographyTransform2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl1,
202  const std::vector<geom::Point2dData<T> >& ptColl2,
203  const math::EstimationConfig& config);
204 template <typename T>
205 inline boost::python::tuple
207  const std::vector<geom::Point2dData<T> >& ptColl2)
208 {
209  math::EstimationConfig config;
210  config.initNonRobust();
211 
212  return homographyTransform2dEstimation(ptColl1, ptColl2, config);
213 }
215 
218 
227 template <typename T>
228 PYIPSDKBASE_API boost::python::tuple
229 rigidTransform2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl1,
230  const std::vector<geom::Point2dData<T> >& ptColl2,
231  const math::EstimationConfig& config);
232 template <typename T>
233 inline boost::python::tuple
235  const std::vector<geom::Point2dData<T> >& ptColl2)
236 {
237  math::EstimationConfig config;
238  config.initNonRobust();
239 
240  return rigidTransform2dEstimation(ptColl1, ptColl2, config);
241 }
243 
246 
255 template <typename T>
256 PYIPSDKBASE_API boost::python::tuple
257 similarityTransform2dEstimation(const std::vector<geom::Point2dData<T> >& ptColl1,
258  const std::vector<geom::Point2dData<T> >& ptColl2,
259  const math::EstimationConfig& config);
260 template <typename T>
261 inline boost::python::tuple
263  const std::vector<geom::Point2dData<T> >& ptColl2)
264 {
265  math::EstimationConfig config;
266  config.initNonRobust();
267 
268  return similarityTransform2dEstimation(ptColl1, ptColl2, config);
269 }
271 
274 
281 template <typename T>
282 PYIPSDKBASE_API boost::python::tuple
283 plan3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl,
284  const math::EstimationConfig& config);
285 template <typename T>
286 inline boost::python::tuple
287 plan3dSimpleEstimation(const std::vector<geom::Point3dData<T> >& ptColl)
288 {
289  math::EstimationConfig config;
290  config.initNonRobust();
291 
292  return plan3dEstimation(ptColl, config);
293 }
295 
298 
305 template <typename T>
306 PYIPSDKBASE_API boost::python::tuple
307 ellipsoid3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl,
308  const math::EstimationConfig& config);
309 template <typename T>
310 inline boost::python::tuple
312 {
313  math::EstimationConfig config;
314  config.initNonRobust();
315 
316  return ellipsoid3dEstimation(ptColl, config);
317 }
319 
322 
331 template <typename T>
332 PYIPSDKBASE_API boost::python::tuple
333 homographyTransform3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl1,
334  const std::vector<geom::Point3dData<T> >& ptColl2,
335  const math::EstimationConfig& config);
336 template <typename T>
337 inline boost::python::tuple
339  const std::vector<geom::Point3dData<T> >& ptColl2)
340 {
341  math::EstimationConfig config;
342  config.initNonRobust();
343 
344  return homographyTransform3dEstimation(ptColl1, ptColl2, config);
345 }
347 
350 
361 template <typename T>
362 PYIPSDKBASE_API boost::python::tuple
363 gaussianCurve3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl,
364  const math::EstimationConfig& config);
365 template <typename T>
366 inline boost::python::tuple
368 {
369  math::EstimationConfig config;
370  config.initNonRobust();
371 
372  return gaussianCurve3dEstimation(ptColl, config);
373 }
375 
378 
387 template <typename T>
388 PYIPSDKBASE_API boost::python::tuple
389 rigidTransform3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl1,
390  const std::vector<geom::Point3dData<T> >& ptColl2,
391  const math::EstimationConfig& config);
392 template <typename T>
393 inline boost::python::tuple
395  const std::vector<geom::Point3dData<T> >& ptColl2)
396 {
397  math::EstimationConfig config;
398  config.initNonRobust();
399 
400  return rigidTransform3dEstimation(ptColl1, ptColl2, config);
401 }
403 
406 
415 template <typename T>
416 PYIPSDKBASE_API boost::python::tuple
417 similarityTransform3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl1,
418  const std::vector<geom::Point3dData<T> >& ptColl2,
419  const math::EstimationConfig& config);
420 template <typename T>
421 inline boost::python::tuple
423  const std::vector<geom::Point3dData<T> >& ptColl2)
424 {
425  math::EstimationConfig config;
426  config.initNonRobust();
427 
428  return similarityTransform3dEstimation(ptColl1, ptColl2, config);
429 }
431 
434 
441 template <typename T>
442 PYIPSDKBASE_API boost::python::tuple
443 sphere3dEstimation(const std::vector<geom::Point3dData<T> >& ptColl,
444  const math::EstimationConfig& config,
445  const bool bProcessNonLinearPass);
446 template <typename T>
447 inline boost::python::tuple
448 sphere3dSimpleEstimation(const std::vector<geom::Point3dData<T> >& ptColl)
449 {
450  math::EstimationConfig config;
451  config.initNonRobust();
452 
453  return sphere3dEstimation(ptColl, config, false);
454 }
456 
459 
460 } // end of namespace python
461 } // end of namespace ipsdk
462 
463 #endif // __PYIPSDKBASE_PYTHONESTIMATIONUTILS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
PYIPSDKBASE_API boost::python::tuple similarityTransform2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2, const math::EstimationConfig &config)
similarity transformation estimation between two clouds of 2d points
boost::python::tuple homographyTransform2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2)
homography transformation estimation between two clouds of 2d points
Definition: PythonEstimationUtils.h:206
PYIPSDKBASE_API boost::python::tuple ellipse2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl, const math::EstimationConfig &config)
ellipse 2d estimation from a cloud of 2d contour points
PYIPSDKBASE_API boost::python::tuple homographyTransform3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2, const math::EstimationConfig &config)
homography transformation estimation between two clouds of 3d points
#define PYIPSDKBASE_API
Import/Export macro for library PyIPSDKBase.
Definition: PyIPSDKBaseExports.h:25
PYIPSDKBASE_API boost::python::tuple rigidTransform2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2, const math::EstimationConfig &config)
rigid transformation estimation between two clouds of 2d points
boost::python::tuple rigidTransform3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2)
rigid transformation estimation between two clouds of 3d points
Definition: PythonEstimationUtils.h:394
boost::python::tuple plan3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl)
plan 3d estimation from a cloud of 3d points
Definition: PythonEstimationUtils.h:287
boost::python::tuple gaussianCurve2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl)
gaussian curve 2d estimation from a cloud of 2d points
Definition: PythonEstimationUtils.h:85
PYIPSDKBASE_API boost::python::tuple line2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl, const math::EstimationConfig &config)
line 2d estimation from a cloud of 2d points
boost::python::tuple rigidTransform2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2)
rigid transformation estimation between two clouds of 2d points
Definition: PythonEstimationUtils.h:234
PYIPSDKBASE_API boost::python::tuple similarityTransform3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2, const math::EstimationConfig &config)
similarity transformation estimation between two clouds of 3d points
boost::python::tuple circle2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl)
circle 2d estimation from a cloud of 2d contour points
Definition: PythonEstimationUtils.h:132
PYIPSDKBASE_API boost::python::tuple gaussianCurve2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl, const math::EstimationConfig &config)
gaussian curve 2d estimation from a cloud of 2d points
boost::python::tuple ellipsoid3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl)
ellipsoid 3d estimation from a cloud of 3d contour points
Definition: PythonEstimationUtils.h:311
PYIPSDKBASE_API boost::python::tuple rigidTransform3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2, const math::EstimationConfig &config)
rigid transformation estimation between two clouds of 3d points
boost::python::tuple gaussianCurve3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl)
gaussian curve 3d estimation from a cloud of 3d points
Definition: PythonEstimationUtils.h:367
PYIPSDKBASE_API boost::python::tuple polynomial2dSurfaceEstimator(const std::vector< geom::Point3dData< ipReal64 > > &dataColl, const math::EstimationConfig &config)
second order polynomial 2d surface estimation from a set of data such as
PYIPSDKBASE_API boost::python::tuple intersectionPoint2dEstimation(const std::vector< geom::Line2d > &line2dColl, const math::EstimationConfig &config)
intersection point 2d estimation from a data set of 2d lines
Configuration structure used for estimation management.
Definition: EstimationConfig.h:34
boost::python::tuple similarityTransform3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2)
similarity transformation estimation between two clouds of 3d points
Definition: PythonEstimationUtils.h:422
PYIPSDKBASE_API boost::python::tuple circle2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl, const math::EstimationConfig &config, const bool bProcessNonLinearPass)
circle 2d estimation from a cloud of 2d contour points
PYIPSDKBASE_API boost::python::tuple plan3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl, const math::EstimationConfig &config)
plan 3d estimation from a cloud of 3d points
boost::python::tuple intersectionPoint2dSimpleEstimation(const std::vector< geom::Line2d > &line2dColl)
intersection point 2d estimation from a data set of 2d lines
Definition: PythonEstimationUtils.h:179
boost::python::tuple polynomial2dSurfaceSimpleEstimator(const std::vector< geom::Point3dData< ipReal64 > > &dataColl)
second order polynomial 2d surface estimation from a set of data such as
Definition: PythonEstimationUtils.h:107
PYIPSDKBASE_API boost::python::tuple gaussianCurve3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl, const math::EstimationConfig &config)
gaussian curve 3d estimation from a cloud of 3d points
boost::python::tuple similarityTransform2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2)
similarity transformation estimation between two clouds of 2d points
Definition: PythonEstimationUtils.h:262
Definition of import/export macro for library.
PYIPSDKBASE_API boost::python::tuple sphere3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl, const math::EstimationConfig &config, const bool bProcessNonLinearPass)
sphere 3d estimation from a cloud of 3d contour points
boost::python::tuple sphere3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl)
sphere 3d estimation from a cloud of 3d contour points
Definition: PythonEstimationUtils.h:448
Lightweight structure used to store Point2d data.
Definition: GeometryEntity2dTypes.h:26
boost::python::tuple line2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl)
line 2d estimation from a cloud of 2d points
Definition: PythonEstimationUtils.h:58
PYIPSDKBASE_API boost::python::tuple ellipsoid3dEstimation(const std::vector< geom::Point3dData< T > > &ptColl, const math::EstimationConfig &config)
ellipsoid 3d estimation from a cloud of 3d contour points
PYIPSDKBASE_API boost::python::tuple homographyTransform2dEstimation(const std::vector< geom::Point2dData< T > > &ptColl1, const std::vector< geom::Point2dData< T > > &ptColl2, const math::EstimationConfig &config)
homography transformation estimation between two clouds of 2d points
boost::python::tuple ellipse2dSimpleEstimation(const std::vector< geom::Point2dData< T > > &ptColl)
ellipse 2d estimation from a cloud of 2d contour points
Definition: PythonEstimationUtils.h:156
Estimation operators used for estimation management.
boost::python::tuple homographyTransform3dSimpleEstimation(const std::vector< geom::Point3dData< T > > &ptColl1, const std::vector< geom::Point3dData< T > > &ptColl2)
homography transformation estimation between two clouds of 3d points
Definition: PythonEstimationUtils.h:338
void initNonRobust()
method used to initialize object to a non robust configuration