IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Classes | Typedefs | Enumerations | Functions
ipsdk::math Namespace Reference

Namespace agregating IPSDK mathematical routines and classes. More...

Classes

class  AdaptiveGridPartition
 Class allowing to create an adaptive partition of data. More...
 
class  Affine2d
 Transformation class allowing to manage 2d affine transformations. More...
 
class  AnisotropicScale2d
 Transformation class allowing to manage 2d anisotropic scale transformations. More...
 
class  AnisotropicScale3d
 Transformation class allowing to manage 3d anisotropic scale transformations. More...
 
class  BaseCostFunction
 Base class for cost functions used during optimization process. More...
 
class  BaseDataPartition
 Base class for data partitioning. More...
 
class  BaseEstimator
 Base class for parametric estimation from data set. More...
 
class  BaseGaussianCurveEstimator
 Base class allowing to estimate gaussian curve parameters from a set of input data (based on Caruana’s algorithm) More...
 
class  BaseGeometricTransform2d
 Base class for geometric transformation 2d management. More...
 
class  BaseGridPartition
 Base class for object allowing to create data partition based on grid. More...
 
class  BaseHistogram
 Base class for histogram data management. More...
 
class  BaseRobustEstimator
 Base class for parametric robust estimation from data set. More...
 
class  BipartitePartialMatch
 Algorithm allowing to solve a partial graph bipartite assigment problem. More...
 
class  EstimationConfig
 Configuration structure used for estimation management. More...
 
class  EstimationResults
 Structure allowing to encapsulate robust estimation results. More...
 
class  GaussianCurve2dEstimator
 Class allowing to estimate gaussian curve parameters from a set of input data. More...
 
class  GaussianCurve3dEstimator
 Class allowing to estimate gaussian curve parameters from a set of input data. More...
 
class  GaussianCurveNdEstimator
 Class allowing to estimate gaussian curve parameters from a set of input data. More...
 
class  Histogram
 Class allowing to encapsulated histogram data and to compute several associated indicators. More...
 
struct  HistogramExtrema
 structure allowing to encapsulate histogram extrema information More...
 
struct  HistogramGaussianCurveFit
 structure allowing to encapsulate gaussian curve fit information More...
 
class  IPSDKMathException
 Exception class for library IPSDKMath. More...
 
class  KernelKMeansCentroid
 Kernel centroid cluster representation. More...
 
class  KernelKMeansClustering
 Kernel implementation of KMeans algorithm. More...
 
class  KernelKMeansClusteringConfig
 Class allowing to encapsulated Kernel KMeans algorithm configuration. More...
 
class  KMeansClustering
 K-Means clustering algorithm with K-Means++ initialization. More...
 
class  KMeansClusteringConfig
 Class allowing to encapsulated KMeans algorithm configuration. More...
 
class  LinearKernel
 Linear function kernel. More...
 
class  LMSRobustEstimator
 Robust Least Mean Square estimatorThis algorithm do not request any threshold for model estimation. It has an outlier ratio upper bound at 50% (<50%) More...
 
class  MLESACRobustEstimator
 Robust Maximum Likelihood Estimation SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 
class  MSACRobustEstimator
 Robust M-estimator SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 
class  Munkres
 Implementation of munkres algorithm. More...
 
class  NonLinearSolver
 Class implementing a non linear solver based on Levenberg Marquardt algorithm. More...
 
struct  PhiTheta
 structure PhiTheta, containing the angles used for a spheric representation. Angles _phi and _theta are expressed in radians More...
 
class  Polynomial2dSurfaceEstimator
 Class allowing to estimate a second order polynomial 2d surface from a set of data such as $\left\{x_i, y_i, value_i=f(x_i, y_i)\right\}$. More...
 
class  PolynomialKernel
 Polynomial function kernel. More...
 
class  RadialBasisKernel
 radial basis function kernel More...
 
class  RANSACRobustEstimator
 Robust RANdom SAmple Consensus estimatorThis algorithm request a threshold value on residuals of model estimation. It has no outlier ratio upper bound. More...
 
class  RegularGridPartition
 Class allowing to create a regular grid where each axis is divide into _nbBucketsByAxis sub range. More...
 
class  Rigid2d
 Transformation class allowing to manage 2d rigid transformations. More...
 
class  Scale2d
 Transformation class allowing to manage 2d scale transformations. More...
 
class  Scale3d
 Transformation class allowing to manage 3d scale transformations. More...
 
class  SigmoidKernel
 Sigmoid function kernel. More...
 
class  Similarity2d
 Transformation class allowing to manage 2d similarity transformations. More...
 
class  SpectralClustering
 Spectral clustering algorithm associated to a kernel kmeans clustering algorithm. More...
 
class  Transform2dFactory
 Factory used to handle geometric transformation 2d creation. More...
 
class  Transform3dFactory
 Factory used to handle geometric transformation 3d creation. More...
 

Typedefs

typedef boost::shared_ptr< BaseDataPartitionDataPartitionPtr
 shared pointer to BaseDataPartition class
 
typedef boost::shared_ptr< const BaseDataPartitionDataPartitionConstPtr
 shared pointer to const BaseDataPartition class
 
typedef Vector DataType
 data type used for estimation
 
typedef Vector ParameterType
 parameter type resulting from estimation
 
typedef Vector ResidualsSet
 residuals type resulting from estimation
 
typedef std::vector< DataTypeDataSet
 collection of data associated to estimation
 
typedef std::vector< bool > OutlierFlags
 collection of outliers flags
 
typedef boost::shared_ptr< BaseEstimatorEstimatorPtr
 shared pointer to BaseEstimator class
 
typedef boost::shared_ptr< const BaseEstimatorEstimatorConstPtr
 shared pointer to const BaseEstimator class
 
typedef boost::shared_ptr< BaseRobustEstimatorRobustEstimatorPtr
 shared pointer to BaseRobustEstimator class
 
typedef boost::shared_ptr< const BaseRobustEstimatorRobustEstimatorConstPtr
 shared pointer to const BaseRobustEstimator class
 
typedef CostFunctionPtr(* CostFunCreator) (const DataSet &dataSet)
 
typedef std::vector< PhiThetaPhiThetaColl
 collection of phi theta data
 
typedef boost::numeric::ublas::unbounded_array< ipReal64UnBoundedArray
 unbounded array type associated to library
 
typedef boost::numeric::ublas::vector< ipReal64Vector
 vector type associated to library
 
typedef boost::numeric::ublas::bounded_vector< ipReal64, 2 > Vector2d
 2d vector type associated to library
 
typedef boost::numeric::ublas::bounded_vector< ipReal64, 3 > Vector3d
 3d vector type associated to library
 
typedef boost::numeric::ublas::bounded_vector< ipReal64, 4 > Vector4d
 4d vector type associated to library
 
typedef boost::numeric::ublas::matrix< ipReal64Matrix
 matrix type associated to library
 
typedef boost::numeric::ublas::bounded_matrix< ipReal64, 2, 2 > Matrix2d
 2d matrix (2x2) type associated to library
 
typedef boost::numeric::ublas::bounded_matrix< ipReal64, 3, 3 > Matrix3d
 3d matrix (3x3) type associated to library
 
typedef boost::numeric::ublas::bounded_matrix< ipReal64, 4, 4 > Matrix4d
 4d matrix (4x4) type associated to library
 
typedef ProcessingResult< eOptStatusOptResult
 optimization result type
 
typedef boost::shared_ptr< BaseCostFunctionCostFunctionPtr
 shared pointer to cost function
 
typedef boost::shared_ptr< const BaseCostFunctionCostFunctionConstPtr
 shared pointer to const cost function
 
typedef std::pair< ipUInt64, ipUInt64ExtremaRange
 index for dilated local extrema More...
 
typedef std::vector< ExtremaRangeExtremaRangeColl
 collection of indexes for dilated local extrema
 
typedef std::vector< HistogramExtremaHistogramExtremaColl
 collection of histogram extrema
 
typedef boost::shared_ptr< ipsdk::math::BaseHistogramHistogramPtr
 shared pointer to ipsdk::math::BaseHistogram
 
typedef boost::shared_ptr< const ipsdk::math::BaseHistogramHistogramConstPtr
 shared pointer to const ipsdk::math::BaseHistogram
 

Enumerations

enum  eClusteringMessage {
  eClusteringNotDone, eInvalidAccuracyThreshold, eInvalidClusterIndex, eInvalidMaxDictionarySize,
  eInvalidMinChangeRatio, eInvalidNbClusters, eInvalidPolynomialAlpha, eInvalidPolynomialBeta,
  eInvalidPolynomialDegree, eInvalidRBFSigma, eNullNbAttempts, eNullNbClusters,
  eNullNbIteration, eValidityIndexTypeNotYetSupported
}
 Enumerate describing messages. More...
 
enum  eDataPartitionType { eDPT_Regular, eDPT_Adaptive }
 data partition type More...
 
enum  eEstimationMessage {
  eDataPartitionGenerationFailed, eDataPartitionNotInit, eDataSetAndOutlierFlagsSizeMismatch, eEstimationConfigNotInit,
  eEstimationFailedCantGetResults, eEstimationResultsNotInit, eEstimatorNotInit, eGridPartitionNotEnoughBuckets,
  eInvalidDataSize, eInvalidExpectedOutlierRatio, eInvalidGaussianSigma, eInvalidNbEstimParams,
  eInvalidOutlierRangeFactor, eInvalidOutlierThresholdFactor, eInvalidSubSetSize, eInvalidSuccessRatio,
  eNonLinearEstimationPassFailed, eNotEnoughData, eNullCostFunSharedPtr, eNullDataPartitionPtr,
  eNullDataSize, eNullEstimatorSharedPtr, eNullNbBucketsByAxis, eNullNbEstimParams,
  eNullNbMinRequestedData, eNullSubSetRequestedSize, eRegularGridPartitionInvalidRange, eResidualsFailure,
  eResidualsSetAndOutlierFlagsSizeMismatch, eResidualsSizeMismatch, eRobustEstimationFinalEstimationFailed, eRobustEstimationNoValidScore,
  eRobustEstimationNotDone, eRobustEstimationNotEnoughData, eRobustEstimationNotEnoughtSuccessfulRun, eRobustEstimatorNotInit,
  eUnsupportedRobustEstimatorType
}
 
enum  eRobustEstimationType {
  eRET_NonRobust, eRET_LMS, eRET_RANSAC, eRET_MSAC,
  eRET_MLESAC
}
 
enum  eTransform2dMessage { eInvalidNbParams, eTransformAlreadyRegistred, eTransformNotRegistred, eTransformationNotInvertible }
 Enumerate describing messages. More...
 
enum  eTransform3dMessage { eInvalidNbParams, eTransformAlreadyRegistred, eTransformNotRegistred, eTransformationNotInvertible }
 Enumerate describing messages. More...
 
enum  eGraphMessage {
  eAlgorithmNotInit, eAlgorithmNotResolved, eInvalidColumnIdx, eInvalidRowIdx,
  eNotColumnMajor, eNullMatrixSize
}
 Enumerate describing messages. More...
 
enum  eLinearAlgebraMessage {
  eColMatrixColMatrixSizeMismatch, eColMatrixRowMatrixSizeMismatch, eColMatrixVectorSizeMismatch, eExpectingSquareMatrix,
  eInvalidNbEigenValues, eMatrixMatrixSizeMismatch, eOneRankDeficientSystemExpected, eOverConstrainSystemExpected,
  eRowMatrixColMatrixSizeMismatch, eRowMatrixRowMatrixSizeMismatch, eRowMatrixVectorSizeMismatch, eUnknownLaPackError,
  eVectorMatrixSizeMismatch
}
 Enumerate describing messages. More...
 
enum  eIPSDKMathMessage { eNullLineDirection, eObjectNotInit, eUnSupportedEntity, eThomsonNbPointsOutOfRange }
 Enumerate describing messages. More...
 
enum  eOptimizationMessage {
  eCostFunNotInit, eInvalidJacobianSize, eInvalidNbEquations, eInvalidNbParameters,
  eNonLinearSolverNotSolved, eNullCostFunction, eNullNbEquations, eNullNbParameters,
  eOptStatus0, eOptStatus1, eOptStatus2, eOptStatus3,
  eOptStatus4_1, eOptStatus4_2, eOptStatus5, eOptStatus6,
  eOptStatus7, eOptStatusM2, eOptStatusM3, eOptStatusM4,
  eOptStatusOther
}
 Enumerate describing messages. More...
 
enum  eOptStatus { eOS_Succeeded, eOS_Warn, eOS_Failed }
 
enum  eTopHat1DExtremumType { eTH1DET_Center, eTH1DET_Begin, eTH1DET_End, eTH1DET_Extremum }
 Enumerate describing the extremum type to take into account for a 1D top-hat calculation. More...
 
enum  eExtremaType { eET_Minima, eET_Maxima }
 Enumerate allowing to define an extrema type. More...
 
enum  eExtremaBorderPolicy { eEBP_Keeped, eEBP_Skipped, eEBP_MakeRing }
 Enumerate allowing to describe border policy used during extrema extraction processing. More...
 
enum  eHistogramOutOfBoundsPolicy { eHOOBP_Ignored, eHOOBP_Nearest, eHOOBP_Dedicated, eHOOBP_DedicatedUpper }
 enumerate use to describe histogram policy used to process out of bounds data More...
 
enum  eStatisticsMessage {
  eCollSizeMismatch, eFailedToExportHistogram, eGaussianCurveInvalidEstimation, eGaussianCurveInvalidMatrixRank,
  eHistogramBoundsGlobalPolicyNotYetSuported, eHistogramInvalidBinIndex, eHistogramInvalidClassIndex, eHistogramInvalidQuantileValue,
  eHistogramNotInit, eHistogramPopulationSizeMismatch, eInvalidDilateFactor, eInvalidHistogramBinWidth,
  eInvalidHistogramBounds, eInvalidHistogramNbClasses, eInvalidHistogramNbClusters
}
 Enumerate describing messages. More...
 
enum  eToolsMessage { ePolynomial2dSurfaceUndefined }
 

Functions

IPSDKMATH_API std::ostream & operator<< (std::ostream &os, const EstimationConfig &config)
 output operator on EstimationConfig
 
IPSDKMATH_API std::ostream & operator<< (std::ostream &os, const EstimationResults &results)
 output operator on EstimationResults
 
IPSDKMATH_API EstimationConfig createNonRobustConfig ()
 function allowing to create a non robust estimation configuration
 
IPSDKMATH_API void processEstimation (const EstimationConfig &config, const EstimatorPtr &pEstimator, const DataSet &inputDataSet, EstimationResults &results)
 function allowing to launch a robust estimation process More...
 
IPSDKMATH_API void processEstimation (const EstimationConfig &config, const EstimatorPtr &pEstimator, const CostFunCreator &costFunCreator, const DataSet &inputDataSet, EstimationResults &results)
 function allowing to launch a robust estimation process completed with a non linear estimation More...
 
IPSDKMATH_API RobustEstimatorPtr createRobustEstimator (const EstimationConfig &config, const EstimatorPtr &pEstimator)
 function allowing to create and initialize a robust estimator More...
 
IPSDKMATH_API ipReal64 computeRMS (const ResidualsSet &residualsSet)
 function allowing to compute root mean square from a collection of residuals
 
IPSDKMATH_API ipReal64 computeRMS (const ResidualsSet &residualsSet, const OutlierFlags &outlierFlags)
 function allowing to compute root mean square from a collection of residuals with associated outliers flag
 
IPSDKMATH_API DataSet extractInliers (const DataSet &fullDataSet, const OutlierFlags &outlierFlags)
 function allowing to extract an inlier sub data set from a complete data set and a collection of outlier flags More...
 
IPSDKMATH_API ipUInt32 computeNbOutliers (const OutlierFlags &outlierFlags)
 function allowing to compute number of outliers into a collection of outlier flags
 
IPSDKMATH_API ipUInt32 computeNbInliers (const OutlierFlags &outlierFlags)
 function allowing to compute number of inliers into a collection of outlier flags
 
IPSDKMATH_API BoolResult checkDataSize (const DataSet &dataSet, const ipUInt32 dataSize)
 function allowing to check data size among data set
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void cartesianToPolar (const TIn x, const TIn y, TOut &rho, TOut &theta)
 cartesian to polar convertion More...
 
IPSDKMATH_API bool circleFromPoints (const ipReal64 x0, const ipReal64 y0, const ipReal64 x1, const ipReal64 y1, const ipReal64 x2, const ipReal64 y2, ipReal64 &xc, ipReal64 &yc, ipReal64 &radius)
 computation of circle parameters from three points More...
 
IPSDK_FORCEINLINE ipReal64 circlePerimeter (const ipReal64 radius)
 compute circle perimeter
 
IPSDK_FORCEINLINE ipReal64 circleArea (const ipReal64 radius)
 compute circle area
 
IPSDKMATH_API bool convertEllipseFromQuadratic (const ipReal64 a11, const ipReal64 a12, const ipReal64 a22, const ipReal64 b1, const ipReal64 b2, const ipReal64 c, ipReal64 &cx, ipReal64 &cy, ipReal64 &theta, ipReal64 &a, ipReal64 &b)
 function allowing to convert from quadratic to standard representation of ellipse More...
 
IPSDKMATH_API bool convertEllipseToQuadratic (const ipReal64 cx, const ipReal64 cy, const ipReal64 theta, const ipReal64 a, const ipReal64 b, ipReal64 &a11, ipReal64 &a12, ipReal64 &a22, ipReal64 &b1, ipReal64 &b2, ipReal64 &c)
 function allowing to convert from standard to quadratic representation of ellipse More...
 
IPSDKMATH_API ipReal64 ellipsePerimeterLowerBound (const ipReal64 a, const ipReal64 b)
 function allowing to compute lower bound value for an ellipse perimeter More...
 
IPSDKMATH_API ipReal64 ellipsePerimeterUpperBound (const ipReal64 a, const ipReal64 b)
 function allowing to compute upper bound value for an ellipse perimeter More...
 
IPSDKMATH_API ipReal64 ellipseArea (const ipReal64 a, const ipReal64 b)
 function allowing to compute ellipse area More...
 
IPSDKMATH_API ipReal64 ellipseExcentricity (const ipReal64 a, const ipReal64 b)
 function allowing to compute ellipse excentricity More...
 
IPSDKMATH_API bool equivalentEllipse (const ipReal64 perimeter, const ipReal64 area, ipReal64 &a, ipReal64 &b)
 function allowing to compute equivalent ellipse for a given perimeter and area More...
 
IPSDKMATH_API ipReal64 ellipseRadius (const ipReal64 a, const ipReal64 b, const ipReal64 phi)
 function allowing to compute axis aligned ellipse 'radius' for a given angle phi More...
 
IPSDKMATH_API ipReal64 ellipseRadius (const ipReal64 a, const ipReal64 b, const ipReal64 ellipseOrient, const ipReal64 theta)
 function allowing to compute ellipse 'radius' for a given angle More...
 
IPSDKMATH_API void ellipsePoint (const ipReal64 xc, const ipReal64 yc, const ipReal64 a, const ipReal64 b, const ipReal64 ellipseOrient, const ipReal64 theta, ipReal64 &ptX, ipReal64 &ptY)
 function allowing to compute ellipse boundary point for a given angle
 
IPSDKMATH_API bool lineFromPoints (const ipReal64 x0, const ipReal64 y0, const ipReal64 x1, const ipReal64 y1, ipReal64 &rho, ipReal64 &theta)
 computation of line parameters from two points More...
 
template<typename T >
IPSDK_FORCEINLINE ipReal64 distance (const T x1, const T y1, const T x2, const T y2)
 Euclidian distance between 2d points.
 
template<typename T >
IPSDKMATH_API bool segmentsIntersects (const T xSegStart0, const T ySegStart0, const T xSegEnd0, const T ySegEnd0, const T xSegStart1, const T ySegStart1, const T xSegEnd1, const T ySegEnd1)
 check whether two segments intersect
 
template<typename T >
IPSDK_FORCEINLINE ipReal64 normL2 (const T x, const T y)
 L2 norm of a 2d vector.
 
template<typename T >
IPSDK_FORCEINLINE T scalarProduct (const T x1, const T y1, const T x2, const T y2)
 Scalar product of two 2d vectors.
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void cartesianToSpherical (const TIn x, const TIn y, const TIn z, TOut &rho, TOut &theta, TOut &phi)
 cartesian to spherical convertion More...
 
IPSDKMATH_API void eulerToQuaternion (const ipReal64 chi, const ipReal64 beta, const ipReal64 alpha, ipReal64 &q0, ipReal64 &q1, ipReal64 &q2, ipReal64 &q3)
 Convertion from euler angles to a quaternion representation. More...
 
IPSDKMATH_API void quaternionToEuler (const ipReal64 q0, const ipReal64 q1, const ipReal64 q2, const ipReal64 q3, ipReal64 &chi, ipReal64 &beta, ipReal64 &alpha)
 Convertion from quaternion representation to euler angles. More...
 
IPSDKMATH_API bool convertEllipsoidFromQuadratic (const ipReal64 a11, const ipReal64 a12, const ipReal64 a13, const ipReal64 a22, const ipReal64 a23, const ipReal64 a33, const ipReal64 b1, const ipReal64 b2, const ipReal64 b3, const ipReal64 c0, ipReal64 &cx, ipReal64 &cy, ipReal64 &cz, ipReal64 &chi, ipReal64 &beta, ipReal64 &alpha, ipReal64 &a, ipReal64 &b, ipReal64 &c)
 function allowing to convert from quadratic to standard representation of ellipsoid More...
 
IPSDKMATH_API bool convertEllipsoidToQuadratic (const ipReal64 cx, const ipReal64 cy, const ipReal64 cz, const ipReal64 chi, const ipReal64 beta, const ipReal64 alpha, const ipReal64 a, const ipReal64 b, const ipReal64 c, ipReal64 &a11, ipReal64 &a12, ipReal64 &a13, ipReal64 &a22, ipReal64 &a23, ipReal64 &a33, ipReal64 &b1, ipReal64 &b2, ipReal64 &b3, ipReal64 &c0)
 function allowing to convert from standard to quadratic representation of ellipsoid More...
 
IPSDKMATH_API ipReal64 ellipsoidArea (const ipReal64 a, const ipReal64 b, const ipReal64 c)
 function allowing to compute ellipsoid area More...
 
IPSDKMATH_API ipReal64 ellipsoidVolume (const ipReal64 a, const ipReal64 b, const ipReal64 c)
 function allowing to compute ellipsoid volume More...
 
IPSDKMATH_API ipReal64 ellipsoidExcentricity (const ipReal64 a, const ipReal64 b, const ipReal64 c)
 function allowing to compute ellipsoid excentricity More...
 
IPSDKMATH_API ipReal64 ellipsoidRadius (const ipReal64 a, const ipReal64 b, const ipReal64 c, const ipReal64 theta, const ipReal64 phi)
 function allowing to compute axis aligned ellipsoid 'radius' for a given orientation (see Points and vectors 3d representation) More...
 
IPSDKMATH_API ipReal64 ellipsoidRadius (const ipReal64 a, const ipReal64 b, const ipReal64 c, const Matrix3d &matRot, const ipReal64 theta, const ipReal64 phi)
 function allowing to compute ellipsoid 'radius' for a given orientation (see Points and vectors 3d representation) More...
 
IPSDKMATH_API void ellipsoidPoint (const ipReal64 xc, const ipReal64 yc, const ipReal64 zc, const ipReal64 a, const ipReal64 b, const ipReal64 c, const Matrix3d &matRot, const ipReal64 theta, const ipReal64 phi, ipReal64 &ptX, ipReal64 &ptY, ipReal64 &ptZ)
 function allowing to compute ellipsoid boundary point for a given angle
 
IPSDKMATH_API bool planFromPoints (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, ipReal64 &rho, ipReal64 &theta, ipReal64 &phi)
 computation of plan parameters from three points More...
 
template<typename T >
IPSDK_FORCEINLINE ipReal64 distance (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
 Euclidian distance between 3d points.
 
template<typename T >
IPSDKMATH_API bool segmentsIntersects (const T xSegStart0, const T ySegStart0, const T zSegStart0, const T xSegEnd0, const T ySegEnd0, const T zSegEnd0, const T xSegStart1, const T ySegStart1, const T zSegStart1, const T xSegEnd1, const T ySegEnd1, const T zSegEnd1)
 check whether two segments intersect
 
IPSDKMATH_API bool sphereFromPoints (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, const ipReal64 x3, const ipReal64 y3, const ipReal64 z3, ipReal64 &xc, ipReal64 &yc, ipReal64 &zc, ipReal64 &radius)
 computation of sphere parameters from four points More...
 
IPSDKMATH_API bool sphereFromPoints (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, ipReal64 &xc, ipReal64 &yc, ipReal64 &zc, ipReal64 &radius)
 computation of sphere parameters from three points More...
 
IPSDK_FORCEINLINE ipReal64 sphereArea (const ipReal64 radius)
 compute sphere area
 
IPSDK_FORCEINLINE ipReal64 sphereVolume (const ipReal64 radius)
 compute sphere volume
 
IPSDKMATH_API ipReal64 tetrahedronArea (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, const ipReal64 x3, const ipReal64 y3, const ipReal64 z3)
 computation of tetrahedron area from its vertives coordinates
 
IPSDKMATH_API ipReal64 tetrahedronVolume (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, const ipReal64 x3, const ipReal64 y3, const ipReal64 z3)
 computation of tetrahedron volume from its vertives coordinates
 
IPSDKMATH_API ipReal64 tetrahedronSignedVolume (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, const ipReal64 x3, const ipReal64 y3, const ipReal64 z3)
 computation of tetrahedron signed volume from its vertives coordinates
 
IPSDKMATH_API ipReal64 tetrahedronSignedVolume (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2)
 computation of tetrahedron signed volume from its vertives coordinates (last vertice is supposed to be at origin)
 
IPSDKMATH_API void tetrahedronInertia (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, ipReal64 &mxx, ipReal64 &mxy, ipReal64 &mxz, ipReal64 &myy, ipReal64 &myz, ipReal64 &mzz)
 computation of tetrahedron inertia tensor components (last vertice is supposed to be at origin)
 
IPSDK_FORCEINLINE ipReal64 trianglePerimeter (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2)
 computation of triangle perimeter from its vertives coordinates
 
IPSDK_FORCEINLINE ipReal64 triangleArea (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2)
 computation of triangle area from its vertives coordinates
 
IPSDK_FORCEINLINE void triangleNormal (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, ipReal64 &nx, ipReal64 &ny, ipReal64 &nz)
 computation of triangle normal from its vertives coordinates More...
 
IPSDK_FORCEINLINE bool triangleUnitNormal (const ipReal64 x0, const ipReal64 y0, const ipReal64 z0, const ipReal64 x1, const ipReal64 y1, const ipReal64 z1, const ipReal64 x2, const ipReal64 y2, const ipReal64 z2, ipReal64 &nx, ipReal64 &ny, ipReal64 &nz)
 computation of triangle unit normal from its vertives coordinates More...
 
template<typename T >
IPSDK_FORCEINLINE ipReal64 normL2 (const T x, const T y, const T z)
 L2 norm of a 3d vector.
 
template<typename T >
IPSDK_FORCEINLINE T scalarProduct (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2)
 Scalar product of two 3d vectors.
 
template<typename T >
IPSDK_FORCEINLINE void crossProduct (const T x1, const T y1, const T z1, const T x2, const T y2, const T z2, T &xRes, T &yRes, T &zRes)
 Cross product of two 3d vectors.
 
IPSDK_FORCEINLINE ipReal64 modulo (const ipReal64 angle, const ipReal64 modulo)
 function allowing to compute modulo of an angle More...
 
IPSDK_FORCEINLINE ipReal64 centerModulo (const ipReal64 angle, const ipReal64 modulo)
 function allowing to compute centered modulo of an angle More...
 
IPSDK_FORCEINLINE ipReal64 det (const ipReal64 a11, const ipReal64 a12, const ipReal64 a21, const ipReal64 a22)
 computation of a 2x2 matrix determinant
 
IPSDK_FORCEINLINE ipReal64 det (const ipReal64 a11, const ipReal64 a12, const ipReal64 a13, const ipReal64 a21, const ipReal64 a22, const ipReal64 a23, const ipReal64 a31, const ipReal64 a32, const ipReal64 a33)
 computation of a 3x3 matrix determinant
 
IPSDK_FORCEINLINE bool solveLinear (const ipReal64 a11, const ipReal64 a12, const ipReal64 b1, const ipReal64 a21, const ipReal64 a22, const ipReal64 b2, ipReal64 &x1, ipReal64 &x2)
 solve linear system of 2 equations with two unknowns (we solve linear system AX=B) More...
 
IPSDK_FORCEINLINE bool solveLinear (const ipReal64 a11, const ipReal64 a12, const ipReal64 a13, const ipReal64 b1, const ipReal64 a21, const ipReal64 a22, const ipReal64 a23, const ipReal64 b2, const ipReal64 a31, const ipReal64 a32, const ipReal64 a33, const ipReal64 b3, ipReal64 &x1, ipReal64 &x2, ipReal64 &x3)
 solve linear system of 3 equations with three unknowns (we solve linear system AX=B) More...
 
IPSDK_FORCEINLINE bool invertMatrix (ipReal64 &a11, ipReal64 &a12, ipReal64 &a21, ipReal64 &a22)
 inversion of a 2x2 matrix More...
 
IPSDKMATH_API bool choleskyDecomposition (const Matrix &matA, Matrix &matU)
 decomposition of a nxn symetric positive definite matrix using cholesky decomposition More...
 
IPSDKMATH_API bool choleskyInverse (Matrix &matA)
 in situ inversion of a nxn symetric positive definite matrix using cholesky decomposition method More...
 
IPSDKMATH_API bool choleskyInverse (const Matrix &matA, Matrix &matInvA)
 inversion of a nxn symetric positive definite matrix using cholesky decomposition method More...
 
IPSDKMATH_API void eigenDecomposition (const ipReal64 mXX, const ipReal64 mXY, const ipReal64 mYY, ipReal64 &lambdaMin, ipReal64 &lambdaMax, ipReal64 &theta)
 eigen decomposition of symetric 2x2 matrix

\[ \begin{bmatrix} mXX & mXY \\ mXY & mYY \end{bmatrix} \]

On output value are granted such that : More...

 
IPSDKMATH_API ipUInt32 eigenDecomposition (const Matrix &mat, Vector &eigenValues, Matrix &eigenVectors)
 eigen decomposition of symetric NxN matrix On output : More...
 
IPSDKMATH_API void eigenPartialDecomposition (const Matrix &mat, Vector &eigenValues, Matrix &eigenVectors)
 eigen decomposition of symetric NxN matrix with search for only M greatest values On output : More...
 
IPSDK_FORCEINLINE ipReal64 comparable_distance (const ipsdk::math::Vector &v0, const ipsdk::math::Vector &v1)
 function allowing to compute comparable distance between two vectors More...
 
IPSDK_FORCEINLINE ipReal64 euclidian_distance (const ipsdk::math::Vector &v0, const ipsdk::math::Vector &v1)
 function allowing to compute euclidian distance between two vectors More...
 
template<typename ArrayType1 , typename ArrayType2 >
bool equal (const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType1 > &mat1, const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType2 > &mat2)
 check for matrix equality
 
template<typename ArrayType1 , typename ArrayType2 >
bool compare (const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType1 > &mat1, const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType2 > &mat2, const ipReal64 epsilonValue=NumericLimits< ipReal64 >::sqrt_epsilon())
 matrix comparison with tolerance on frobenius norm of difference
 
template<typename ArrayType1 , typename ArrayType2 >
bool compareRelative (const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType1 > &mat1, const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType2 > &mat2, const ipReal64 epsilonValue=NumericLimits< ipReal64 >::sqrt_epsilon())
 
template<typename ArrayType1 , typename ArrayType2 >
bool equal (const boost::numeric::ublas::vector< ipReal64, ArrayType1 > &vec1, const boost::numeric::ublas::vector< ipReal64, ArrayType2 > &vec2)
 check for vector equality
 
template<typename ArrayType1 , typename ArrayType2 >
bool compare (const boost::numeric::ublas::vector< ipReal64, ArrayType1 > &vec1, const boost::numeric::ublas::vector< ipReal64, ArrayType2 > &vec2, const ipReal64 epsilonValue=NumericLimits< ipReal64 >::sqrt_epsilon())
 vector comparison with tolerance on euclidian norm of difference
 
template<typename ArrayType1 , typename ArrayType2 >
bool compareRelative (const boost::numeric::ublas::vector< ipReal64, ArrayType1 > &vec1, const boost::numeric::ublas::vector< ipReal64, ArrayType2 > &vec2, const ipReal64 epsilonValue=NumericLimits< ipReal64 >::sqrt_epsilon())
 
IPSDKMATH_API bool luSolve (const Matrix &matA, const Vector &vecB, Vector &vecX)
 linear system resolution using lu decomposition Solved system is : matA x VecX = vecB with More...
 
IPSDKMATH_API bool luInverse (Matrix &matA)
 in place inversion of a nxn squared matrix using lu decomposition method More...
 
IPSDKMATH_API bool luInverse (const Matrix &matA, Matrix &matInvA)
 inversion of a nxn squared matrix using lu decomposition method With : More...
 
IPSDKMATH_API bool upperTriangularInverse (Matrix &matA)
 inversion of a nxn upper triangular matrix More...
 
IPSDKMATH_API bool lowerTriangularInverse (Matrix &matA)
 inversion of a nxn lower triangular matrix More...
 
IPSDKMATH_API bool qrSolve (const Matrix &matA, const Vector &vecB, Vector &vecX)
 linear system resolution using qr decomposition method Solved system is : matA x VecX = vecB with More...
 
IPSDKMATH_API void qrDecomposition (const Matrix &matA, Matrix &matQ, Matrix &matR)
 QR decomposition of mxn matrix Given mn = min(m,n), we have : More...
 
IPSDKMATH_API ipUInt32 svdSolve (const Matrix &matA, const Vector &vecB, Vector &vecX)
 over constrained linear system resolution using singular value decomposition method Solved system is : matA x vecX = vecB with More...
 
IPSDKMATH_API ipUInt32 svdSolve (const Matrix &matA, const Matrix &matB, Matrix &matX)
 over constrained linear system resolution using singular value decomposition method (case of multiple solved systems AX=B with shared matrix A) Solved system is : matA x matX = matB with More...
 
IPSDKMATH_API ipUInt32 svdSolve (const Matrix &matA, Vector &vecX)
 over constrained linear system resolution using singular value decomposition method Solved system is : matA x VecX = 0 with More...
 
IPSDKMATH_API void svdDecomposition (const Matrix &matA, Matrix &matU, Vector &vecS, Matrix &matVt)
 singular value decomposition of mxn matrix Given mn = min(m,n), we have : More...
 
IPSDKMATH_API ipUInt32 svdInverse (const Matrix &matA, Matrix &matInvA)
 inversion of a mxn rectangular matrix with m >= n using singular value decomposition method. With : More...
 
IPSDKMATH_API const std::string & getIPSDKMathLoggerName ()
 Recovery of logger name associated to library.
 
IPSDKMATH_API log4cplus::Logger & getIPSDKMathLogger ()
 Recovery of logger associated to library.
 
IPSDKMATH_API const LogMessageManagergetIPSDKMathLogMessageManager ()
 Recovery of message manager associated to library.
 
template<typename T >
IPSDKMATH_API ipUInt32 tophatThreshold1D (const std::vector< T > &vInBuf, const ipBool bBlack, const eTopHat1DExtremumType &extremumType, const ipReal32 calibratedHalfSize, const ipReal32 scale, const ipReal32 threshold, std::vector< ipInt32 > &vOutBuf)
 Compute the tophat threshold on a 1D signal stored in a std::vector and returns the number of detected extrama.
 
template<typename T >
IPSDKMATH_API std::vector< ipReal32gaussianSmoothing1D (const std::vector< T > &vInBuf, const ipReal32 stdDev)
 Compute the Gaussian smoothing on a 1D signal stored in a std::vector.
 
IPSDKMATH_API ipUInt32 solveQuadratic (ipReal64 a, ipReal64 b, ipReal64 c, ipReal64 &x1, ipReal64 &x2)
 second order polynomial real roots search More...
 
template<typename T >
median (std::vector< T > &coll)
 function allowing to compute median of a collection More...
 
template<typename T >
IPSDKMATH_API ipReal64 mean (const std::vector< T > &coll)
 function allowing to compute mean for a vector
 
template<typename T >
IPSDKMATH_API ipReal64 variance (const std::vector< T > &coll)
 function allowing to compute variance for a vector
 
template<typename T >
IPSDKMATH_API ipReal64 stdDev (const std::vector< T > &coll)
 function allowing to compute standard deviation for a vector
 
template<typename T >
IPSDKMATH_API std::pair< ipReal64, ipReal64meanAndVariance (const std::vector< T > &coll)
 function allowing to compute mean and variance for a vector
 
template<typename T >
IPSDKMATH_API ipReal64 correlation (const std::vector< T > &coll1, const std::vector< T > &coll2)
 function allowing to compute correlation between two vectors of data More...
 
template<typename T , typename IndexType >
IPSDKMATH_API void findLocalStrictExtrema (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, std::vector< IndexType > &extremaIdxColl)
 generic function allowing to search for local strict extrema into a collection of values More...
 
template<typename T , typename IndexType >
void findLocalStrictMinima (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
 generic function allowing to search for local strict minima into a collection of values More...
 
template<typename T , typename IndexType >
void findLocalStrictMaxima (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
 generic function allowing to search for local strict maxima into a collection of values More...
 
template<typename T >
IPSDKMATH_API void findLocalDilatedExtrema (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, const T &dilateFactor, ExtremaRangeColl &extremaRangeColl)
 generic function allowing to search for local 'dilated' extrema into a collection of values More...
 
template<typename T , typename IndexType >
IPSDKMATH_API void findLocalExtrema (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, std::vector< IndexType > &extremaIdxColl)
 function allowing to search for local extrema into a collection of values (this is the non strict extrema search version) More...
 
template<typename T , typename IndexType >
void findLocalMinima (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
 function allowing to search for local minima into a collection of values More...
 
template<typename T , typename IndexType >
void findLocalMaxima (const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
 function allowing to search for local maxima into a collection of values More...
 
template<typename ExtremaInfo , typename T >
IPSDKMATH_API void filterExtrema (const eExtremaType &extremaType, const ipReal64 minDistance, const T extremaThresholdValue, boost::function< void(const ExtremaInfo &, ipReal64 &, T &)> extractExtremaCoordsWrapper, std::vector< ExtremaInfo > &extremaInfoColl)
 function allowing to filter a collection of extrema using a distance criterion More...
 
template<typename T , typename IndexType >
void extractBasicExtremaCoords (const std::vector< T > &inputColl, const IndexType &dataIdx, ipReal64 &extremaLocation, T &extremaValue)
 
template<typename T >
IPSDKMATH_API void extractBasicExtremaCoords (const std::vector< T > &inputColl, const ExtremaRange &extremaRange, ipReal64 &extremaLocation, T &extremaValue)
 basic function to retrieve extrema coordinates from an extrema range information More...
 
template<typename T , typename IndexType >
void filterMinima (const std::vector< T > &inputColl, const ipReal64 minDistance, std::vector< IndexType > &extremaInfoColl)
 function allowing to filter a collection of minima using a distance criterion Extrema are first sorted in function of there value and then filtered using a distance criterion More...
 
template<typename T , typename IndexType >
void filterMinima (const std::vector< T > &inputColl, const ipReal64 minDistance, const T extremaThresholdValue, std::vector< IndexType > &extremaInfoColl)
 function allowing to filter a collection of minima using a distance criterion and a value threshold Extrema are first sorted in function of there value and then filtered using a distance criterion More...
 
template<typename T , typename IndexType >
void filterMaxima (const std::vector< T > &inputColl, const ipReal64 minDistance, std::vector< IndexType > &extremaInfoColl)
 function allowing to filter a collection of maxima using a distance criterion Extrema are first sorted in function of there value and then filtered using a distance criterion More...
 
template<typename T , typename IndexType >
void filterMaxima (const std::vector< T > &inputColl, const ipReal64 minDistance, const T extremaThresholdValue, std::vector< IndexType > &extremaInfoColl)
 function allowing to filter a collection of maxima using a distance criterion and a value threshold Extrema are first sorted in function of there value and then filtered using a distance criterion More...
 
IPSDKMATH_API ipReal64 computeHistogramRange (const ipBool bDataIntegral, const ipReal64 firstHistoValue, const ipReal64 lastHistoValue)
 function allowing to compute range associated to an histogram More...
 
IPSDKMATH_API ipUInt32 computeHistogramNbClasses (const ipBool bDataIntegral, const ipReal64 firstHistoValue, const ipReal64 lastHistoValue, const ipReal64 binWidth)
 function allowing to compute number of classes associated to an histogram More...
 
IPSDKMATH_API ipReal64 computeHistogramBinWidth (const ipBool bDataIntegral, const ipReal64 firstHistoValue, const ipReal64 lastHistoValue, const ipUInt32 nbClasses)
 function allowing to compute bin width associated to an histogram More...
 
IPSDKMATH_API void computeHistogramBoundsInfo (const ipUInt32 nbClasses, const eHistogramOutOfBoundsPolicy &outOfBoundsPolicy, ipUInt32 &lowerOutOfBoundsBinIdx, ipUInt32 &upperOutOfBoundsBinIdx, ipUInt32 &inBoundsBinOffset, ipUInt32 &nbBins)
 function allowing to deduce histogram bound policies from a global enumerate value More...
 
IPSDKMATH_API ipUInt32 computeHistogramNbBins (const ipUInt32 nbClasses, const eHistogramOutOfBoundsPolicy &outOfBoundsPolicy)
 function allowing to compute number of bins associated to an histogram
 
IPSDKMATH_API void exportToCsv (const boost::filesystem::path &filePath, const ipsdk::math::BaseHistogram &histogram)
 function allowing to export histogram data to a csv file More...
 
IPSDKMATH_API bool operator== (const ipsdk::math::HistogramExtrema &extrema1, const ipsdk::math::HistogramExtrema &extrema2)
 operator allowing to compare histogram extrema
 
IPSDKMATH_API std::ostream & operator<< (std::ostream &os, const ipsdk::math::HistogramExtrema &extrema)
 operator allowing to write histogram extrema to a stream
 
IPSDKMATH_API std::ostream & operator<< (std::ostream &os, const ipsdk::math::HistogramGaussianCurveFit &gaussianCurveFit)
 operator allowing to write histogram gaussian curve fit to a stream
 
IPSDKMATH_API std::ostream & operator<< (std::ostream &os, const ipsdk::math::BaseHistogram &histogram)
 operator allowing to write histogram data to a stream
 
IPSDKMATH_API ipReal64 normalDistribution (const ipReal64 x, const ipReal64 stdDev, const ipReal64 mean=0)
 function allowing to compute normal distribution value More...
 
IPSDKMATH_API ipReal64 normalDistributionFirstDerivative (const ipReal64 x, const ipReal64 stdDev, const ipReal64 mean=0)
 function allowing to compute first derivative value for normal distribution More...
 
IPSDKMATH_API ipReal64 normalDistributionSecondDerivative (const ipReal64 x, const ipReal64 stdDev, const ipReal64 mean=0)
 function allowing to compute second derivative value for normal distribution More...
 
IPSDKMATH_API ipReal64 cumulativeNormalDistribution (const ipReal64 x, const ipReal64 stdDev, const ipReal64 mean=0)
 function allowing to approximate cumulative distribution function value for normal distribution More...
 
ipReal64 normalDistributionCoverage (const ipReal64 dist, const ipReal64 stdDev, const ipReal64 mean=0)
 function allowing to approximate normal distribution ratio coverage of values at a given distance away from the mean More...
 
IPSDK_FORCEINLINE ipReal64 linearInterpolation (const ipReal64 x, const ipReal64 f0, const ipReal64 f1)
 function allowing to compute linear interpolation between two values More...
 
IPSDK_FORCEINLINE ipReal64 biLinearInterpolation (const ipReal64 x, const ipReal64 y, const ipReal64 fX0Y0, const ipReal64 fX1Y0, const ipReal64 fX0Y1, const ipReal64 fX1Y1)
 function allowing to compute a bi linear interpolation More...
 
IPSDK_FORCEINLINE ipReal64 triLinearInterpolation (const ipReal64 x, const ipReal64 y, const ipReal64 z, const ipReal64 fX0Y0Z0, const ipReal64 fX1Y0Z0, const ipReal64 fX0Y1Z0, const ipReal64 fX1Y1Z0, const ipReal64 fX0Y0Z1, const ipReal64 fX1Y0Z1, const ipReal64 fX0Y1Z1, const ipReal64 fX1Y1Z1)
 function allowing to compute a tri linear interpolation More...
 
IPSDK_FORCEINLINE ipReal64 cubicInterpolation (const ipReal64 x, const ipReal64 fM1, const ipReal64 f0, const ipReal64 f1, const ipReal64 f2)
 function allowing to compute cubic interpolation between two values More...
 
IPSDK_FORCEINLINE ipReal64 biCubicInterpolation (const ipReal64 x, const ipReal64 y, const ipReal64 f[4][4])
 function allowing to compute a bi cubic interpolation More...
 
IPSDK_FORCEINLINE ipReal64 triCubicInterpolation (const ipReal64 x, const ipReal64 y, const ipReal64 z, const ipReal64 f[4][4][4])
 function allowing to compute a tri cubic interpolation More...
 
template<typename T >
IPSDKMATH_API void sort (const T &x1, const T &x2, const T &x3, T &y1, T &y2, T &y3)
 function allowing to sort 3 numbers in ascending order More...
 
template<typename OutputType , typename InputType >
IPSDKMATH_API OutputType round (const InputType value)
 function allowing to round number from a type to an other
 
template<typename OutputType , typename InputType >
IPSDKMATH_API OutputType saturatedRound (const InputType value)
 function allowing to round number from a type to an other with overflow management
 
template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type compare (const T val1, const T val2, const T tolerance=NumericLimits< T >::sqrt_epsilon())
 function allowing to compare two values More...
 
template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type compare (const std::vector< T > &vec1, const std::vector< T > &vec2, const T tolerance=NumericLimits< T >::sqrt_epsilon())
 function allowing to compare two values More...
 
template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type compareRelative (const T val1, const T val2, const T tolerance=NumericLimits< T >::sqrt_epsilon())
 function allowing to compare two values More...
 
template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type compareRelative (const std::vector< T > &vec1, const std::vector< T > &vec2, const T tolerance=NumericLimits< T >::sqrt_epsilon())
 function allowing to compare two values More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut polarToXCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta)
 polar to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut polarToYCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta)
 polar to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void polarToCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta, TOut &x, TOut &y)
 polar to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void polarToCartesian (const TIn rho, const TIn theta, TOut &x, TOut &y)
 polar to cartesian convertion More...
 
template<typename T >
IPSDK_FORCEINLINE void angleToMatrix (const T cosTheta, const T sinTheta, T &rxx, T &rxy, T &ryx, T &ryy)
 Convertion from angle to rotation matrix. More...
 
template<typename T >
IPSDK_FORCEINLINE void angleToMatrix (const T theta, T &rxx, T &rxy, T &ryx, T &ryy)
 Convertion from angle to rotation matrix. More...
 
IPSDK_FORCEINLINE Matrix2d angleToMatrix (const ipReal64 theta)
 Convertion from angle to rotation matrix. More...
 
template<typename T >
IPSDK_FORCEINLINE void matrixToAngle (const T rxx, const T rxy, T &theta)
 Convertion from rotation matrix to angle. More...
 
template<typename T >
IPSDK_FORCEINLINE void matrixToAngle (const T rxx, const T rxy, const T ryx, const T ryy, T &theta)
 Convertion from rotation matrix to angle. More...
 
IPSDK_FORCEINLINE ipReal64 matrixToAngle (const Matrix2d &matRot)
 Convertion from rotation matrix to angle. More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate2d (const T xIn, const T yIn, const ipReal64 cosTheta, const ipReal64 sinTheta, T &xOut, T &yOut)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate2dInSitu (const ipReal64 cosTheta, const ipReal64 sinTheta, T &x, T &y)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate2d (const T xIn, const T yIn, const ipReal64 theta, T &xOut, T &yOut)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDKMATH_API ipReal64 pointSegmentDistance (const T xPt, const T yPt, const T xSegStart, const T ySegStart, const T xSegEnd, const T ySegEnd)
 Euclidian distance between a point and a segment.
 
template<typename T >
IPSDKMATH_API ipReal64 pointSegmentDistance (const T xPt, const T yPt, const T xSegStart, const T ySegStart, const T xSegEnd, const T ySegEnd, ipReal64 &xMinDistPt, ipReal64 &yMinDistPtSeg)
 Euclidian distance between a point and a segment.
 
template<typename T >
IPSDKMATH_API ipReal64 segmentsDistance (const T xSegStart0, const T ySegStart0, const T xSegEnd0, const T ySegEnd0, const T xSegStart1, const T ySegStart1, const T xSegEnd1, const T ySegEnd1)
 Euclidian distance between two segments.
 
template<typename T >
IPSDKMATH_API ipReal64 segmentsDistance (const T xSegStart0, const T ySegStart0, const T xSegEnd0, const T ySegEnd0, const T xSegStart1, const T ySegStart1, const T xSegEnd1, const T ySegEnd1, ipReal64 &xMinDistPtSeg0, ipReal64 &yMinDistPtSeg0, ipReal64 &xMinDistPtSeg1, ipReal64 &yMinDistPtSeg1)
 Euclidian distance between two segments.
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut sphericalToXCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta, const TIn cosPhi, const TIn sinPhi)
 spherical to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut sphericalToYCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta, const TIn cosPhi, const TIn sinPhi)
 spherical to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut sphericalToZCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta, const TIn cosPhi, const TIn sinPhi)
 spherical to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void sphericalToCartesian (const TIn rho, const TIn cosTheta, const TIn sinTheta, const TIn cosPhi, const TIn sinPhi, TOut &x, TOut &y, TOut &z)
 spherical to cartesian convertion More...
 
template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void sphericalToCartesian (const TIn rho, const TIn theta, const TIn phi, TOut &x, TOut &y, TOut &z)
 spherical to cartesian convertion More...
 
template<typename T >
IPSDK_FORCEINLINE void eulerToMatrix (const T cosChi, const T sinChi, const T cosBeta, const T sinBeta, const T cosAlpha, const T sinAlpha, T &rxx, T &rxy, T &rxz, T &ryx, T &ryy, T &ryz, T &rzx, T &rzy, T &rzz)
 Convertion from euler angles to rotation matrix. More...
 
template<typename T >
IPSDK_FORCEINLINE void eulerToMatrix (const T chi, const T beta, const T alpha, T &rxx, T &rxy, T &rxz, T &ryx, T &ryy, T &ryz, T &rzx, T &rzy, T &rzz)
 Convertion from euler angles to rotation matrix. More...
 
IPSDK_FORCEINLINE Matrix3d eulerToMatrix (const ipReal64 chi, const ipReal64 beta, const ipReal64 alpha)
 Convertion from euler angles to rotation matrix. More...
 
template<typename T >
IPSDK_FORCEINLINE void matrixToEuler (const T rxx, const T rxy, const T rxz, const T ryx, const T ryy, const T ryz, const T rzx, const T rzy, const T rzz, T &chi, T &beta, T &alpha)
 Convertion from rotation matrix to euler angles. More...
 
IPSDK_FORCEINLINE void matrixToEuler (const Matrix3d &matRot, ipReal64 &chi, ipReal64 &beta, ipReal64 &alpha)
 Convertion from rotation matrix to euler angles. More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate3d (const T xIn, const T yIn, const T zIn, const ipReal64 rxx, const ipReal64 rxy, const ipReal64 rxz, const ipReal64 ryx, const ipReal64 ryy, const ipReal64 ryz, const ipReal64 rzx, const ipReal64 rzy, const ipReal64 rzz, T &xOut, T &yOut, T &zOut)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate3dInSitu (const ipReal64 rxx, const ipReal64 rxy, const ipReal64 rxz, const ipReal64 ryx, const ipReal64 ryy, const ipReal64 ryz, const ipReal64 rzx, const ipReal64 rzy, const ipReal64 rzz, T &x, T &y, T &z)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate3d (const T xIn, const T yIn, const T zIn, const ipReal64 cosChi, const ipReal64 sinChi, const ipReal64 cosBeta, const ipReal64 sinBeta, const ipReal64 cosAlpha, const ipReal64 sinAlpha, T &xOut, T &yOut, T &zOut)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate3dInSitu (const ipReal64 cosChi, const ipReal64 sinChi, const ipReal64 cosBeta, const ipReal64 sinBeta, const ipReal64 cosAlpha, const ipReal64 sinAlpha, T &x, T &y, T &z)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDK_FORCEINLINE void rotate3d (const T xIn, const T yIn, const T zIn, const ipReal64 chi, const ipReal64 beta, const ipReal64 alpha, T &xOut, T &yOut, T &zOut)
 rotation of a point using a rotation angle (rotation around origin) More...
 
template<typename T >
IPSDKMATH_API ipReal64 pointSegmentDistance (const T xPt, const T yPt, const T zPt, const T xSegStart, const T ySegStart, const T zSegStart, const T xSegEnd, const T ySegEnd, const T zSegEnd)
 Euclidian distance between a point and a segment.
 
template<typename T >
IPSDKMATH_API ipReal64 pointSegmentDistance (const T xPt, const T yPt, const T zPt, const T xSegStart, const T ySegStart, const T zSegStart, const T xSegEnd, const T ySegEnd, const T zSegEnd, ipReal64 &xMinDistPt, ipReal64 &yMinDistPtSeg, ipReal64 &zMinDistPtSeg)
 Euclidian distance between a point and a segment.
 
template<typename T >
IPSDKMATH_API ipReal64 segmentsDistance (const T xSegStart0, const T ySegStart0, const T zSegStart0, const T xSegEnd0, const T ySegEnd0, const T zSegEnd0, const T xSegStart1, const T ySegStart1, const T zSegStart1, const T xSegEnd1, const T ySegEnd1, const T zSegEnd1)
 Euclidian distance between two segments.
 
template<typename T >
IPSDKMATH_API ipReal64 segmentsDistance (const T xSegStart0, const T ySegStart0, const T zSegStart0, const T xSegEnd0, const T ySegEnd0, const T zSegEnd0, const T xSegStart1, const T ySegStart1, const T zSegStart1, const T xSegEnd1, const T ySegEnd1, const T zSegEnd1, ipReal64 &xMinDistPtSeg0, ipReal64 &yMinDistPtSeg0, ipReal64 &zMinDistPtSeg0, ipReal64 &xMinDistPtSeg1, ipReal64 &yMinDistPtSeg1, ipReal64 &zMinDistPtSeg1)
 Euclidian distance between two segments.
 
IPSDK_FORCEINLINE ipReal64 degToRad (const ipReal64 angle)
 convertion functions between radians and degrees
 
IPSDK_FORCEINLINE ipReal64 radToDeg (const ipReal64 angle)
 convertion functions between radians and degrees
 
template<typename T >
IPSDKMATH_API void eigenDecomposition (const T mXX, const T mXY, const T mXZ, const T mYY, const T mYZ, const T mZZ, T &lambdaMin, T &lambdaInter, T &lambdaMax, T &vMinX, T &vMinY, T &vMinZ, T &vInterX, T &vInterY, T &vInterZ, T &vMaxX, T &vMaxY, T &vMaxZ)
 eigen decomposition of symetric 3x3 matrix

\[ \begin{bmatrix} mXX & mXY & mXZ \\ mXY & mYY & mYZ \\ mXZ & mYZ & mZZ \end{bmatrix} \]

On output value are granted such that : More...

 
template<typename T >
IPSDKMATH_API void eigenDecomposition (const T mXX, const T mXY, const T mXZ, const T mYY, const T mYZ, const T mZZ, T &lambdaMin, T &lambdaInter, T &lambdaMax, T &chi, T &beta, T &alpha)
 eigen decomposition of symetric 3x3 matrix

\[ \begin{bmatrix} mXX & mXY & mXZ \\ mXY & mYY & mYZ \\ mXZ & mYZ & mZZ \end{bmatrix} \]

On output value are granted such that : More...

 
template<typename ArrayType >
std::vector< ipReal64fromUBlas (const boost::numeric::ublas::vector< ipReal64, ArrayType > &inputVector)
 convert a math Vector from and to an std vector
 
template<typename ArrayType >
void fromUBlas (const boost::numeric::ublas::vector< ipReal64, ArrayType > &inputVector, std::vector< ipReal64 > &outputVector)
 convert a math Vector from and to an std vector
 
IPSDKMATH_API ipsdk::math::Vector toUBlas (const std::vector< ipReal64 > &inputVector)
 convert a math Vector from and to an std vector
 
IPSDKMATH_API void toUBlas (const std::vector< ipReal64 > &inputVector, ipsdk::math::Vector &outputVector)
 convert a math Vector from and to an std vector
 
template<typename ArrayType >
std::vector< ipReal64fromUBlas (const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType > &inputMatrix)
 convert a math Matrix from and to an std vector
 
template<typename ArrayType >
void fromUBlas (const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType > &inputMatrix, std::vector< ipReal64 > &outputVector)
 convert a math Matrix from and to an std vector
 
IPSDKMATH_API ipsdk::math::Matrix toUBlas (const std::vector< ipReal64 > &inputVector, const ipUInt32 sizeX, const ipUInt32 sizeY)
 convert a math Matrix from and to an std vector
 
IPSDKMATH_API void toUBlas (const std::vector< ipReal64 > &inputVector, ipsdk::math::Matrix &outputMatrix)
 convert a math Matrix from and to an std vector
 
template<typename IteratorType >
void extractMinMax (const IteratorType &iterBegin, const IteratorType &iterEnd, typename std::iterator_traits< IteratorType >::value_type &minValue, typename std::iterator_traits< IteratorType >::value_type &maxValue)
 function allowing to compute minimum and maximum value for a collection
 
template<typename ContainerType >
void extractMinMax (const ContainerType &coll, typename ContainerType::value_type &minValue, typename ContainerType::value_type &maxValue)
 function allowing to compute minimum and maximum value for a collection
 

Detailed Description

Namespace agregating IPSDK mathematical routines and classes.

Typedef Documentation

◆ CostFunCreator

typedef CostFunctionPtr(* ipsdk::math::CostFunCreator) (const DataSet &dataSet)

function allowing to initialize a cost function used for non linear processing given a dataset

◆ ExtremaRange

index for dilated local extrema

An extrema can span over several contiguous data (ie. a range). It is represented by a pair containing its starting index and its length

Enumeration Type Documentation

◆ eClusteringMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eClusteringNotDone 

Proceed to clustering before use.

eInvalidAccuracyThreshold 

Invalid accuracy threshold value f, should be strictly positive.

eInvalidClusterIndex 

Invalid cluster index {d} while clustering operation count d clusters.

eInvalidMaxDictionarySize 

Invalid maximum dictionary size, should not be null.

eInvalidMinChangeRatio 

Invalid minimum change ratio f, should be in [0, 1[.

eInvalidNbClusters 

Number of clusters {d} should not be greater than number of input data {d}.

eInvalidPolynomialAlpha 

Invalid polynomial kernel alpha value f, should be strictly positive.

eInvalidPolynomialBeta 

Invalid polynomial kernel beta value f, should be positive.

eInvalidPolynomialDegree 

Invalid polynomial kernel degree f, should be strictly positive.

eInvalidRBFSigma 

Invalid sigma value f for radial basis function, should be strictly positive.

eNullNbAttempts 

Number of attempts parameter should not be null.

eNullNbClusters 

Target number of clusters should not be null.

eNullNbIteration 

Number of iterations parameter should not be null.

eValidityIndexTypeNotYetSupported 

Clustering validity index s is not yet supported.

◆ eDataPartitionType

data partition type

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eDPT_Regular 

Regular partition type (each axis is divide with constant bucket size)

eDPT_Adaptive 

Adaptive partition type (axis are divide using non constant bucket size with respect to a 'by axis' histogram of population)

◆ eEstimationMessage

Enumerator
eDataPartitionGenerationFailed 

Failed to generate a sub set of data using data partition.

eDataPartitionNotInit 

Data partition has not been initialized.

eDataSetAndOutlierFlagsSizeMismatch 

Data set collection size d mismatch with outlier flags collection size d.

eEstimationConfigNotInit 

Estimation configuration has not been initialized.

eEstimationFailedCantGetResults 

Can't get results from a failed estimation.

eEstimationResultsNotInit 

Estimation results have not been initialized.

eEstimatorNotInit 

Estimator has not been initialized.

eGridPartitionNotEnoughBuckets 

Not enough buckets d generated to ensure requested sub sets size d.

eInvalidDataSize 

Invalid data size d into data set, expecting data with size d.

eInvalidExpectedOutlierRatio 

Invalid expected outlier ratio value f, should be in [0, d[.

eInvalidGaussianSigma 

Input gaussian sigma value {f} should be strictly positive.

eInvalidNbEstimParams 

Invalid number of estimated parameters d, expecting d number of estimated parameters.

eInvalidOutlierRangeFactor 

Input outlier range factor value {f} should be strictly greater than outlier threshold factor {f}.

eInvalidOutlierThresholdFactor 

Input outlier threshold factor value {f} should be strictly positive.

eInvalidSubSetSize 

Invalid data sub set size d, exepection sub set with size d.

eInvalidSuccessRatio 

Invalid success ratio value f, should be in ]0, 1[.

eNonLinearEstimationPassFailed 

Non linear estimation pass failed
s.

eNotEnoughData 

Data set with size d do no contains enough data to ensure processing (needs at least d data)

eNullCostFunSharedPtr 

Cost function shared pointer should not be null for estimation.

eNullDataPartitionPtr 

Data partition shared pointer should not be null.

eNullDataSize 

Data size should not be null.

eNullEstimatorSharedPtr 

Estimator shared pointer should not be null for robust estimator initialization.

eNullNbBucketsByAxis 

Number of buckets by axis should not be null.

eNullNbEstimParams 

Number of estimated parameters should not be null.

eNullNbMinRequestedData 

Minimun number of requested data should not be null.

eNullSubSetRequestedSize 

Sub set requested size should not be null.

eRegularGridPartitionInvalidRange 

Data range [f, f] is not sufficient to ensure regular grid bucket partitioning.

eResidualsFailure 

Residuals computation failed while estimation was successful
s.

eResidualsSetAndOutlierFlagsSizeMismatch 

Residuals set collection size d mismatch with outlier flags collection size d.

eResidualsSizeMismatch 

Residuals collection size d mismatch with data set size d.

eRobustEstimationFinalEstimationFailed 

Robust estimation final estimation failed
s.

eRobustEstimationNoValidScore 

Robust estimation failed, no valid estimation score computed, outlier threshold may be to high.

eRobustEstimationNotDone 

Robust estimation has not been proceeded, can't retrieve results.

eRobustEstimationNotEnoughData 

Not enough data d to ensure robust estimation (need at least d data)

eRobustEstimationNotEnoughtSuccessfulRun 

Robust estimation failed after d runs (with d successful runs), while expecting d successful runs.

eRobustEstimatorNotInit 

Robust estimator has not been initialized.

eUnsupportedRobustEstimatorType 

Robust estimator s is not yet supported.

◆ eRobustEstimationType

Enumerator
eRET_NonRobust 

Non robust estimation is used.

eRET_LMS 

Least Median of square robust estimation.

eRET_RANSAC 

RANdom SAmple Consensus robust estimation.

eRET_MSAC 

M-estimator SAmple Consensus robust estimation.

eRET_MLESAC 

Maximum Likelihood Estimation SAmple Consensus robust estimation.

◆ eTransform2dMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eInvalidNbParams 

Number of parameters d is not valid for transformation type s, expecting d parameters.

eTransformAlreadyRegistred 

Geometric transformation s has already been registred.

eTransformNotRegistred 

Geometric transformation s has not been registred.

eTransformationNotInvertible 

Transformation cannot be inverted.

◆ eTransform3dMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eInvalidNbParams 

Number of parameters d is not valid for transformation type s, expecting d parameters.

eTransformAlreadyRegistred 

Geometric transformation s has already been registred.

eTransformNotRegistred 

Geometric transformation s has not been registred.

eTransformationNotInvertible 

Transformation cannot be inverted.

◆ eGraphMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eAlgorithmNotInit 

Algorithm has not been initialized.

eAlgorithmNotResolved 

Algorithm has not been resolved, can't access associated results.

eInvalidColumnIdx 

Column index d is not valid given total number of matrix columns d.

eInvalidRowIdx 

Row index d is not valid given total number of matrix rows d.

eNotColumnMajor 

Matrix should be column major for munkres processing while input number of rows is d and number of columns is d.

eNullMatrixSize 

Matrix size should not be null for munkres algorithm.

◆ eLinearAlgebraMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eColMatrixColMatrixSizeMismatch 

Matrix col size d mismatch with matrix col size d.

eColMatrixRowMatrixSizeMismatch 

Matrix col size d mismatch with matrix row size d.

eColMatrixVectorSizeMismatch 

Matrix col size d mismatch with vector size d.

eExpectingSquareMatrix 

Algorithm expects a square matrix while matrix size is {d, d}.

eInvalidNbEigenValues 

Number of searched eigen values {d} can't be greater than input matrix size {d}.

eMatrixMatrixSizeMismatch 

Matrix size {d, d} mismatch with matrix size {d, d}.

eOneRankDeficientSystemExpected 

Expecting at least a one rank deficient linear system while d equations for d variables on input.

eOverConstrainSystemExpected 

Invalid input matrix size {d, d}, expecting over constrained system.

eRowMatrixColMatrixSizeMismatch 

Matrix row size d mismatch with matrix col size d.

eRowMatrixRowMatrixSizeMismatch 

Matrix row size d mismatch with matrix row size d.

eRowMatrixVectorSizeMismatch 

Matrix row size d mismatch with vector size d.

eUnknownLaPackError 

LaPack repport an error during execution.

eVectorMatrixSizeMismatch 

Input vector size d mismatch with output matrix global size d (sx=d, sy=d)

◆ eIPSDKMathMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eNullLineDirection 

Invalid line direction, should not be null.

eObjectNotInit 

Object has not been initialized, can't use it.

eUnSupportedEntity 

Geometric processing doesn't support entity.

eThomsonNbPointsOutOfRange 

Number of points passed as argument is out of range (should be between 1 and 400)

◆ eOptimizationMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eCostFunNotInit 

Cost function has not been initialized.

eInvalidJacobianSize 

Invalid input jacobian matrix size {d, d}, while expecting d parameters and d equations.

eInvalidNbEquations 

Input equations vector with size d is invalid regards to expected number of equations s.

eInvalidNbParameters 

Input parameter vector with size d is invalid regards to expected number of parameters s.

eNonLinearSolverNotSolved 

Non linear solver has not been successfully executed.

eNullCostFunction 

Input cost function shared pointer should not be null.

eNullNbEquations 

Number of equations should not be null.

eNullNbParameters 

Number of parameters should not be null.

eOptStatus0 

Improper input parameters.

eOptStatus1 

Algorithm estimates that the relative error in the sum of squares is at most tol.

eOptStatus2 

Algorithm estimates that the relative error between x and the solution is at most tol.

eOptStatus3 

Algorithm estimates that the relative error in the sum of squares and between x and the solution is at most tol.

eOptStatus4_1 

Null residuals on last iteration.

eOptStatus4_2 

Fvec is orthogonal to the columns of the jacobian to machine precision.

eOptStatus5 

Number of calls to fcn has reached or exceeded max number of iterations.

eOptStatus6 

Tol is too small. no further reduction in the sum of squares is possible.

eOptStatus7 

Tol is too small. no further improvement in the approximate solution x is possible.

eOptStatusM2 

Function evaluation failed with following reason
s.

eOptStatusM3 

Jacobian evaluation failed with following reason
s.

eOptStatusM4 

Unexpected input parameters for minpack function wrapper.

eOptStatusOther 

Algorithm ended for an unknown reason.

◆ eOptStatus

Enumerator
eOS_Succeeded 

Optimization has been successfully executed.

eOS_Warn 

Optimization has been executed with warnings.

eOS_Failed 

No successful optimization has been executed.

◆ eTopHat1DExtremumType

Enumerate describing the extremum type to take into account for a 1D top-hat calculation.

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eTH1DET_Center 

Use the center element of the area detected by the top-hay.

eTH1DET_Begin 

Use the first element of the area detected by the top-hay.

eTH1DET_End 

Use the last element of the area detected by the top-hay.

eTH1DET_Extremum 

Take into account the local extrema.

◆ eExtremaType

Enumerate allowing to define an extrema type.

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eET_Minima 

Minima extrema.

eET_Maxima 

Maxima extrema.

◆ eExtremaBorderPolicy

Enumerate allowing to describe border policy used during extrema extraction processing.

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eEBP_Keeped 

Extremal border values are keeped on output.

eEBP_Skipped 

Extremal border values are skipped on output.

eEBP_MakeRing 

Input data are considered as a ring collection Last and first elements are proceeded as adjacent data (for example this can be the case on angular values)

◆ eHistogramOutOfBoundsPolicy

enumerate use to describe histogram policy used to process out of bounds data

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eHOOBP_Ignored 

Data with values not in [firstHistoValue, lastHistoValue] are ignored.

eHOOBP_Nearest 

Data with values :

eHOOBP_Dedicated 
  • lower than firstHistoValue are aggregated with value firstHistoValue- greater than lastHistoValue are aggregated with value lastHistoValue Data with values :
eHOOBP_DedicatedUpper 
  • lower than firstHistoValue are aggregated to a dedicated first bin- greater than lastHistoValue are aggregated to a dedicated last bin Data with values :

◆ eStatisticsMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map
Enumerator
eCollSizeMismatch 

Input collections size should be the same (first collection size is d while second collection size is d)

eFailedToExportHistogram 

Failed to export histogram to file s.

eGaussianCurveInvalidEstimation 

Gaussian curve estimation leads to an invalid solution for estimated parameters.

eGaussianCurveInvalidMatrixRank 

Invalid matrix rank d for gaussian curve estimation, expecting a full matrix rank [d].

eHistogramBoundsGlobalPolicyNotYetSuported 

Histogram global bounds policy s is not yet supported.

eHistogramInvalidBinIndex 

Histogram bin index d is not valid for histogram with d bins.

eHistogramInvalidClassIndex 

Histogram class index d is not valid for histogram with d classes.

eHistogramInvalidQuantileValue 

Invalid quantile value f, should be in [0, 1].

eHistogramNotInit 

Histogram class has not been initialized.

eHistogramPopulationSizeMismatch 

Histogram population with expected size d mismatch from provided collection size d.

eInvalidDilateFactor 

Dilate factor should be positive.

eInvalidHistogramBinWidth 

Histogram bin width f should be greater than zero.

eInvalidHistogramBounds 

First histogram value f should be greater than last one f.

eInvalidHistogramNbClasses 

Histogram number of classes should not be null.

eInvalidHistogramNbClusters 

Number of clusters {d} should not be greater than number of used histogram bins {d}.

◆ eToolsMessage

Enumerator
ePolynomial2dSurfaceUndefined 

Polynomial 2d surface is not well defined by input data, can't estimate it.

Function Documentation

◆ createRobustEstimator()

IPSDKMATH_API RobustEstimatorPtr ipsdk::math::createRobustEstimator ( const EstimationConfig config,
const EstimatorPtr pEstimator 
)

function allowing to create and initialize a robust estimator

Exceptions
ipsdk::math::IPSDKMathExceptionif pEstimator.get() == 0 || pEstimator->isInit() == false
ipsdk::math::IPSDKMathExceptionif config.isInit() == false

◆ extractInliers()

IPSDKMATH_API DataSet ipsdk::math::extractInliers ( const DataSet fullDataSet,
const OutlierFlags outlierFlags 
)

function allowing to extract an inlier sub data set from a complete data set and a collection of outlier flags

Exceptions
ipsdk::math::IPSDKMathExceptionif fullDataSet.size() != outlierFlags.size()

◆ polarToXCartesian()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut ipsdk::math::polarToXCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta 
)

polar to cartesian convertion

For more informations report to Points and vectors 2d representation

◆ polarToYCartesian()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut ipsdk::math::polarToYCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta 
)

polar to cartesian convertion

For more informations report to Points and vectors 2d representation

◆ polarToCartesian() [1/2]

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::polarToCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta,
TOut &  x,
TOut &  y 
)

polar to cartesian convertion

For more informations report to Points and vectors 2d representation

◆ polarToCartesian() [2/2]

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::polarToCartesian ( const TIn  rho,
const TIn  theta,
TOut &  x,
TOut &  y 
)

polar to cartesian convertion

For more informations report to Points and vectors 2d representation

◆ cartesianToPolar()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::cartesianToPolar ( const TIn  x,
const TIn  y,
TOut &  rho,
TOut &  theta 
)

cartesian to polar convertion

For more informations report to Points and vectors 2d representation

◆ angleToMatrix() [1/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::angleToMatrix ( const T  cosTheta,
const T  sinTheta,
T &  rxx,
T &  rxy,
T &  ryx,
T &  ryy 
)

Convertion from angle to rotation matrix.

For more informations report to Rotations 2d

◆ angleToMatrix() [2/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::angleToMatrix ( const T  theta,
T &  rxx,
T &  rxy,
T &  ryx,
T &  ryy 
)

Convertion from angle to rotation matrix.

For more informations report to Rotations 2d

◆ angleToMatrix() [3/3]

IPSDK_FORCEINLINE Matrix2d ipsdk::math::angleToMatrix ( const ipReal64  theta)

Convertion from angle to rotation matrix.

For more informations report to Rotations 2d

◆ matrixToAngle() [1/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::matrixToAngle ( const T  rxx,
const T  rxy,
T &  theta 
)

Convertion from rotation matrix to angle.

Note
On ouput theta belongs to interval ]-Pi, Pi]

For more informations report to Rotations 2d

◆ matrixToAngle() [2/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::matrixToAngle ( const T  rxx,
const T  rxy,
const T  ryx,
const T  ryy,
T &  theta 
)

Convertion from rotation matrix to angle.

Note
On ouput theta belongs to interval ]-Pi, Pi]

For more informations report to Rotations 2d

◆ matrixToAngle() [3/3]

IPSDK_FORCEINLINE ipReal64 ipsdk::math::matrixToAngle ( const Matrix2d matRot)

Convertion from rotation matrix to angle.

Note
On ouput theta belongs to interval ]-Pi, Pi]

For more informations report to Rotations 2d

◆ rotate2d() [1/2]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate2d ( const T  xIn,
const T  yIn,
const ipReal64  cosTheta,
const ipReal64  sinTheta,
T &  xOut,
T &  yOut 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 2d

◆ rotate2dInSitu()

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate2dInSitu ( const ipReal64  cosTheta,
const ipReal64  sinTheta,
T &  x,
T &  y 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 2d

◆ rotate2d() [2/2]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate2d ( const T  xIn,
const T  yIn,
const ipReal64  theta,
T &  xOut,
T &  yOut 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 2d

◆ circleFromPoints()

IPSDKMATH_API bool ipsdk::math::circleFromPoints ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  x2,
const ipReal64  y2,
ipReal64 xc,
ipReal64 yc,
ipReal64 radius 
)

computation of circle parameters from three points

Returns
false if points are aligned

◆ convertEllipseFromQuadratic()

IPSDKMATH_API bool ipsdk::math::convertEllipseFromQuadratic ( const ipReal64  a11,
const ipReal64  a12,
const ipReal64  a22,
const ipReal64  b1,
const ipReal64  b2,
const ipReal64  c,
ipReal64 cx,
ipReal64 cy,
ipReal64 theta,
ipReal64 a,
ipReal64 b 
)

function allowing to convert from quadratic to standard representation of ellipse

Given a quadratic representation of ellipse given by equation $a_{11}x^2+2a_{12}xy+a_{22}y^2+b_{1}x+b_{2}y+c = 0$, function computes standard ellipse parameters used in matrix equation $(X-C)^tRDR^t(X-C)=0$. With :

  • $X=\left(\begin{matrix}x\\y\end{matrix}\right)$
  • $C=\left(\begin{matrix}c_x\\c_y\end{matrix}\right)$ ellipse center coordinates
  • $R$ a rotation matrix defined by angle $\theta$ which give the orientation of ellipse major axis (with $\theta\in[-\frac{\pi}{2},\frac{\pi}{2}]$) See Rotations 2d for more informations on 2d orientations
  • $D=\left(\begin{matrix}\frac{1}{a^2} 0\\0 \frac{1}{b^2}\end{matrix}\right)$ given ( $a$ and $b$ respectivelly semimajor and semiminor axis of the ellipse
    Returns
    false if input quadratic parameters do not correspond to an ellipse (quadratic equation only match an ellipse if $a_{11}a_{22}-a_{12}^2>0$)

◆ convertEllipseToQuadratic()

IPSDKMATH_API bool ipsdk::math::convertEllipseToQuadratic ( const ipReal64  cx,
const ipReal64  cy,
const ipReal64  theta,
const ipReal64  a,
const ipReal64  b,
ipReal64 a11,
ipReal64 a12,
ipReal64 a22,
ipReal64 b1,
ipReal64 b2,
ipReal64 c 
)

function allowing to convert from standard to quadratic representation of ellipse

Given a standard ellipse parameters used in matrix equation $(X-C)^tRDR^t(X-C)=0$. With :

  • $X=\left(\begin{matrix}x\\y\end{matrix}\right)$
  • $C=\left(\begin{matrix}c_x\\c_y\end{matrix}\right)$ ellipse center coordinates
  • $R$ a rotation matrix defined by angle $\theta$ which give the orientation of ellipse major axis (with $\theta\in[-\frac{\pi}{2},\frac{\pi}{2}]$) See Rotations 2d for more informations on 2d orientations
  • $D=\left(\begin{matrix}\frac{1}{a^2} 0\\0 \frac{1}{b^2}\end{matrix}\right)$ given ( $a$ and $b$ respectivelly semimajor and semiminor axis of the ellipse

Function computes a quadratic representation of ellipse given by equation $a_{11}x^2+2a_{12}xy+a_{22}y^2+b_{1}x+b_{2}y+c = 0$

Returns
false if input standard parameters do not correspond to an ellipse (ie if $a<=0$ or if $b<=0$)

◆ ellipsePerimeterLowerBound()

IPSDKMATH_API ipReal64 ipsdk::math::ellipsePerimeterLowerBound ( const ipReal64  a,
const ipReal64  b 
)

function allowing to compute lower bound value for an ellipse perimeter

Ellipse perimeter lower bound is given by $4\sqrt{a^2+b^2}$

See also
https://en.wikipedia.org/wiki/Ellipse

◆ ellipsePerimeterUpperBound()

IPSDKMATH_API ipReal64 ipsdk::math::ellipsePerimeterUpperBound ( const ipReal64  a,
const ipReal64  b 
)

function allowing to compute upper bound value for an ellipse perimeter

Ellipse perimeter upper bound is given by $\pi\sqrt{2(a^2+b^2)}$

Note
This value can also be used as an approximate value for ellipse perimeter
See also
https://en.wikipedia.org/wiki/Ellipse

◆ ellipseArea()

IPSDKMATH_API ipReal64 ipsdk::math::ellipseArea ( const ipReal64  a,
const ipReal64  b 
)

function allowing to compute ellipse area

Ellipse area is given by $\pi a b$

◆ ellipseExcentricity()

IPSDKMATH_API ipReal64 ipsdk::math::ellipseExcentricity ( const ipReal64  a,
const ipReal64  b 
)

function allowing to compute ellipse excentricity

Ellipse excentricity is given by $\frac{\sqrt{A^2-B^2}}{A}$ with $A=max(a, b)$ and $C=min(a, b)$

Returns
0 if $A==0$

◆ equivalentEllipse()

IPSDKMATH_API bool ipsdk::math::equivalentEllipse ( const ipReal64  perimeter,
const ipReal64  area,
ipReal64 a,
ipReal64 b 
)

function allowing to compute equivalent ellipse for a given perimeter and area

Returns
false in case of failure

◆ ellipseRadius() [1/2]

IPSDKMATH_API ipReal64 ipsdk::math::ellipseRadius ( const ipReal64  a,
const ipReal64  b,
const ipReal64  phi 
)

function allowing to compute axis aligned ellipse 'radius' for a given angle phi

Returns
0 if a<=0 || b<=0

◆ ellipseRadius() [2/2]

IPSDKMATH_API ipReal64 ipsdk::math::ellipseRadius ( const ipReal64  a,
const ipReal64  b,
const ipReal64  ellipseOrient,
const ipReal64  theta 
)

function allowing to compute ellipse 'radius' for a given angle

Returns
0 if a<=0 || b<=0

◆ lineFromPoints()

IPSDKMATH_API bool ipsdk::math::lineFromPoints ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  x1,
const ipReal64  y1,
ipReal64 rho,
ipReal64 theta 
)

computation of line parameters from two points

Returns
false if points are equal

◆ sphericalToXCartesian()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut ipsdk::math::sphericalToXCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta,
const TIn  cosPhi,
const TIn  sinPhi 
)

spherical to cartesian convertion

For more informations report to Points and vectors 3d representation

◆ sphericalToYCartesian()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut ipsdk::math::sphericalToYCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta,
const TIn  cosPhi,
const TIn  sinPhi 
)

spherical to cartesian convertion

For more informations report to Points and vectors 3d representation

◆ sphericalToZCartesian()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE TOut ipsdk::math::sphericalToZCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta,
const TIn  cosPhi,
const TIn  sinPhi 
)

spherical to cartesian convertion

For more informations report to Points and vectors 3d representation

◆ sphericalToCartesian() [1/2]

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::sphericalToCartesian ( const TIn  rho,
const TIn  cosTheta,
const TIn  sinTheta,
const TIn  cosPhi,
const TIn  sinPhi,
TOut &  x,
TOut &  y,
TOut &  z 
)

spherical to cartesian convertion

For more informations report to Points and vectors 3d representation

◆ sphericalToCartesian() [2/2]

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::sphericalToCartesian ( const TIn  rho,
const TIn  theta,
const TIn  phi,
TOut &  x,
TOut &  y,
TOut &  z 
)

spherical to cartesian convertion

For more informations report to Points and vectors 3d representation

◆ cartesianToSpherical()

template<typename TOut , typename TIn >
IPSDK_FORCEINLINE void ipsdk::math::cartesianToSpherical ( const TIn  x,
const TIn  y,
const TIn  z,
TOut &  rho,
TOut &  theta,
TOut &  phi 
)

cartesian to spherical convertion

For more informations report to Points and vectors 3d representation

◆ eulerToMatrix() [1/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::eulerToMatrix ( const T  cosChi,
const T  sinChi,
const T  cosBeta,
const T  sinBeta,
const T  cosAlpha,
const T  sinAlpha,
T &  rxx,
T &  rxy,
T &  rxz,
T &  ryx,
T &  ryy,
T &  ryz,
T &  rzx,
T &  rzy,
T &  rzz 
)

Convertion from euler angles to rotation matrix.

For more informations report to Rotations 3d

◆ eulerToMatrix() [2/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::eulerToMatrix ( const T  chi,
const T  beta,
const T  alpha,
T &  rxx,
T &  rxy,
T &  rxz,
T &  ryx,
T &  ryy,
T &  ryz,
T &  rzx,
T &  rzy,
T &  rzz 
)

Convertion from euler angles to rotation matrix.

For more informations report to Rotations 3d

◆ eulerToMatrix() [3/3]

IPSDK_FORCEINLINE Matrix3d ipsdk::math::eulerToMatrix ( const ipReal64  chi,
const ipReal64  beta,
const ipReal64  alpha 
)

Convertion from euler angles to rotation matrix.

For more informations report to Rotations 3d

◆ matrixToEuler() [1/2]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::matrixToEuler ( const T  rxx,
const T  rxy,
const T  rxz,
const T  ryx,
const T  ryy,
const T  ryz,
const T  rzx,
const T  rzy,
const T  rzz,
T &  chi,
T &  beta,
T &  alpha 
)

Convertion from rotation matrix to euler angles.

Note
On ouput chi and alpha belongs to interval [-Pi, Pi]
On ouput beta belongs to interval [-Pi/2, Pi/2]

For more informations report to Rotations 3d

◆ matrixToEuler() [2/2]

IPSDK_FORCEINLINE void ipsdk::math::matrixToEuler ( const Matrix3d matRot,
ipReal64 chi,
ipReal64 beta,
ipReal64 alpha 
)

Convertion from rotation matrix to euler angles.

Note
On ouput chi and alpha belongs to interval [-Pi, Pi]
On ouput beta belongs to interval [-Pi/2, Pi/2]

For more informations report to Rotations 3d

◆ eulerToQuaternion()

IPSDKMATH_API void ipsdk::math::eulerToQuaternion ( const ipReal64  chi,
const ipReal64  beta,
const ipReal64  alpha,
ipReal64 q0,
ipReal64 q1,
ipReal64 q2,
ipReal64 q3 
)

Convertion from euler angles to a quaternion representation.

For more informations report to Rotations 3d

See also
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

◆ quaternionToEuler()

IPSDKMATH_API void ipsdk::math::quaternionToEuler ( const ipReal64  q0,
const ipReal64  q1,
const ipReal64  q2,
const ipReal64  q3,
ipReal64 chi,
ipReal64 beta,
ipReal64 alpha 
)

Convertion from quaternion representation to euler angles.

For more informations report to Rotations 3d

See also
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

◆ rotate3d() [1/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate3d ( const T  xIn,
const T  yIn,
const T  zIn,
const ipReal64  rxx,
const ipReal64  rxy,
const ipReal64  rxz,
const ipReal64  ryx,
const ipReal64  ryy,
const ipReal64  ryz,
const ipReal64  rzx,
const ipReal64  rzy,
const ipReal64  rzz,
T &  xOut,
T &  yOut,
T &  zOut 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 3d

◆ rotate3dInSitu() [1/2]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate3dInSitu ( const ipReal64  rxx,
const ipReal64  rxy,
const ipReal64  rxz,
const ipReal64  ryx,
const ipReal64  ryy,
const ipReal64  ryz,
const ipReal64  rzx,
const ipReal64  rzy,
const ipReal64  rzz,
T &  x,
T &  y,
T &  z 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 3d

◆ rotate3d() [2/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate3d ( const T  xIn,
const T  yIn,
const T  zIn,
const ipReal64  cosChi,
const ipReal64  sinChi,
const ipReal64  cosBeta,
const ipReal64  sinBeta,
const ipReal64  cosAlpha,
const ipReal64  sinAlpha,
T &  xOut,
T &  yOut,
T &  zOut 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 3d

◆ rotate3dInSitu() [2/2]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate3dInSitu ( const ipReal64  cosChi,
const ipReal64  sinChi,
const ipReal64  cosBeta,
const ipReal64  sinBeta,
const ipReal64  cosAlpha,
const ipReal64  sinAlpha,
T &  x,
T &  y,
T &  z 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 3d

◆ rotate3d() [3/3]

template<typename T >
IPSDK_FORCEINLINE void ipsdk::math::rotate3d ( const T  xIn,
const T  yIn,
const T  zIn,
const ipReal64  chi,
const ipReal64  beta,
const ipReal64  alpha,
T &  xOut,
T &  yOut,
T &  zOut 
)

rotation of a point using a rotation angle (rotation around origin)

For more informations report to Rotations 3d

◆ convertEllipsoidFromQuadratic()

IPSDKMATH_API bool ipsdk::math::convertEllipsoidFromQuadratic ( const ipReal64  a11,
const ipReal64  a12,
const ipReal64  a13,
const ipReal64  a22,
const ipReal64  a23,
const ipReal64  a33,
const ipReal64  b1,
const ipReal64  b2,
const ipReal64  b3,
const ipReal64  c0,
ipReal64 cx,
ipReal64 cy,
ipReal64 cz,
ipReal64 chi,
ipReal64 beta,
ipReal64 alpha,
ipReal64 a,
ipReal64 b,
ipReal64 c 
)

function allowing to convert from quadratic to standard representation of ellipsoid

Given a quadratic representation of ellipsoid given by equation $a_{11}x^2+2a_{12}xy+2a_{13}xz+a_{22}y^2+2a_{23}yz+a_{33}z^2+ b_{1}x+b_{2}y+b_{3}z+c0 = 0$, function computes standard ellipsoid parameters used in matrix equation $(X-C)^tRDR^t(X-C)=0$. With :

  • $X=\left(\begin{matrix}x\\y\\z\end{matrix}\right)$
  • $C=\left(\begin{matrix}c_x\\c_y\\c_z\end{matrix}\right)$ ellipsoid center coordinates
  • $R$ a rotation matrix defined by angle $\chi$, $\beta$ and $\phi$ which give the orientation of ellipsoid See Rotations 3d for more informations on 3d orientations
  • $D=\left(\begin{matrix}\frac{1}{a^2} 0 0\\0 \frac{1}{b^2} 0\\0 0 \frac{1}{c^2}\end{matrix}\right)$ given ( $a$ $b$ and $c$ respectivelly semimajor, semiintermediate and semiminor axis of the ellipsoid
    Returns
    false if input quadratic parameters do not correspond to an ellipsoid (quadratic equation only match an ellipsoid if symetric matrix associated to $a_{ij}$ is positive definite)

◆ convertEllipsoidToQuadratic()

IPSDKMATH_API bool ipsdk::math::convertEllipsoidToQuadratic ( const ipReal64  cx,
const ipReal64  cy,
const ipReal64  cz,
const ipReal64  chi,
const ipReal64  beta,
const ipReal64  alpha,
const ipReal64  a,
const ipReal64  b,
const ipReal64  c,
ipReal64 a11,
ipReal64 a12,
ipReal64 a13,
ipReal64 a22,
ipReal64 a23,
ipReal64 a33,
ipReal64 b1,
ipReal64 b2,
ipReal64 b3,
ipReal64 c0 
)

function allowing to convert from standard to quadratic representation of ellipsoid

Given a standard ellipsoid parameters used in matrix equation $(X-C)^tRDR^t(X-C)=0$. With :

  • $X=\left(\begin{matrix}x\\y\\z\end{matrix}\right)$
  • $C=\left(\begin{matrix}c_x\\c_y\\c_z\end{matrix}\right)$ ellipsoid center coordinates
  • $R$ a rotation matrix defined by angle $\chi$, $\beta$ and $\phi$ which give the orientation of ellipsoid See Rotations 3d for more informations on 3d orientations
  • $D=\left(\begin{matrix}\frac{1}{a^2} 0 0\\0 \frac{1}{b^2} 0\\ 0 0 \frac{1}{c^2}\end{matrix}\right)$ given ( $a$ $b$ and $c$ respectivelly semimajor, semiintermediate and semiminor axis of the ellipsoid

Function computes a quadratic representation of ellipsoid given by equation $a_{11}x^2+2a_{12}xy+2a_{13}xz+a_{22}y^2+2a_{23}yz+a_{33}z^2+ b_{1}x+b_{2}y+b_{3}z+c0 = 0$

Returns
false if input standard parameters do not correspond to an ellipsoid (ie if $a<=0$ or if $b<=0$ or if $c<=0$)

◆ ellipsoidArea()

IPSDKMATH_API ipReal64 ipsdk::math::ellipsoidArea ( const ipReal64  a,
const ipReal64  b,
const ipReal64  c 
)

function allowing to compute ellipsoid area

see http://math.wikia.com/wiki/Ellipsoid

Note
this is an approximation of exact ellipsoid area
Returns
0 if min(a, b, c) <= 0

◆ ellipsoidVolume()

IPSDKMATH_API ipReal64 ipsdk::math::ellipsoidVolume ( const ipReal64  a,
const ipReal64  b,
const ipReal64  c 
)

function allowing to compute ellipsoid volume

Ellipsoid volume is given by $\frac{4}{3}\pi a b c$

◆ ellipsoidExcentricity()

IPSDKMATH_API ipReal64 ipsdk::math::ellipsoidExcentricity ( const ipReal64  a,
const ipReal64  b,
const ipReal64  c 
)

function allowing to compute ellipsoid excentricity

Ellipsoid excentricity is given by $\frac{\sqrt{A^2-C^2}}{A}$ with $A=max(a, b, c)$ and $C=min(a, b, c)$

Returns
0 if $A==0$

◆ ellipsoidRadius() [1/2]

IPSDKMATH_API ipReal64 ipsdk::math::ellipsoidRadius ( const ipReal64  a,
const ipReal64  b,
const ipReal64  c,
const ipReal64  theta,
const ipReal64  phi 
)

function allowing to compute axis aligned ellipsoid 'radius' for a given orientation (see Points and vectors 3d representation)

Returns
0 if a<=0 || b<=0 || c<=0

◆ ellipsoidRadius() [2/2]

IPSDKMATH_API ipReal64 ipsdk::math::ellipsoidRadius ( const ipReal64  a,
const ipReal64  b,
const ipReal64  c,
const Matrix3d matRot,
const ipReal64  theta,
const ipReal64  phi 
)

function allowing to compute ellipsoid 'radius' for a given orientation (see Points and vectors 3d representation)

Returns
0 if a<=0 || b<=0 || c<=0

◆ planFromPoints()

IPSDKMATH_API bool ipsdk::math::planFromPoints ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  z0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  z1,
const ipReal64  x2,
const ipReal64  y2,
const ipReal64  z2,
ipReal64 rho,
ipReal64 theta,
ipReal64 phi 
)

computation of plan parameters from three points

Returns
false if points are aligned

◆ sphereFromPoints() [1/2]

IPSDKMATH_API bool ipsdk::math::sphereFromPoints ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  z0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  z1,
const ipReal64  x2,
const ipReal64  y2,
const ipReal64  z2,
const ipReal64  x3,
const ipReal64  y3,
const ipReal64  z3,
ipReal64 xc,
ipReal64 yc,
ipReal64 zc,
ipReal64 radius 
)

computation of sphere parameters from four points

Returns
false if points are coplanar

◆ sphereFromPoints() [2/2]

IPSDKMATH_API bool ipsdk::math::sphereFromPoints ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  z0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  z1,
const ipReal64  x2,
const ipReal64  y2,
const ipReal64  z2,
ipReal64 xc,
ipReal64 yc,
ipReal64 zc,
ipReal64 radius 
)

computation of sphere parameters from three points

Returns
false if points colinear

◆ triangleNormal()

IPSDK_FORCEINLINE void ipsdk::math::triangleNormal ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  z0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  z1,
const ipReal64  x2,
const ipReal64  y2,
const ipReal64  z2,
ipReal64 nx,
ipReal64 ny,
ipReal64 nz 
)

computation of triangle normal from its vertives coordinates

Note
normal is computed such as N = (P1-P0)^(P2-P0)

◆ triangleUnitNormal()

IPSDK_FORCEINLINE bool ipsdk::math::triangleUnitNormal ( const ipReal64  x0,
const ipReal64  y0,
const ipReal64  z0,
const ipReal64  x1,
const ipReal64  y1,
const ipReal64  z1,
const ipReal64  x2,
const ipReal64  y2,
const ipReal64  z2,
ipReal64 nx,
ipReal64 ny,
ipReal64 nz 
)

computation of triangle unit normal from its vertives coordinates

Note
normal is computed such as N = (P1-P0)^(P2-P0)/||(P1-P0)^(P2-P0)||
Returns
false if normal is null sized (case of colinear points)

◆ modulo()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::modulo ( const ipReal64  angle,
const ipReal64  modulo 
)

function allowing to compute modulo of an angle

Returns
a value in interval [0, modulo[

◆ centerModulo()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::centerModulo ( const ipReal64  angle,
const ipReal64  modulo 
)

function allowing to compute centered modulo of an angle

Returns
a value in interval [-modulo/2, modulo/2[

◆ solveLinear() [1/2]

IPSDK_FORCEINLINE bool ipsdk::math::solveLinear ( const ipReal64  a11,
const ipReal64  a12,
const ipReal64  b1,
const ipReal64  a21,
const ipReal64  a22,
const ipReal64  b2,
ipReal64 x1,
ipReal64 x2 
)

solve linear system of 2 equations with two unknowns (we solve linear system AX=B)

Returns
false if system cannot be inverted

◆ solveLinear() [2/2]

IPSDK_FORCEINLINE bool ipsdk::math::solveLinear ( const ipReal64  a11,
const ipReal64  a12,
const ipReal64  a13,
const ipReal64  b1,
const ipReal64  a21,
const ipReal64  a22,
const ipReal64  a23,
const ipReal64  b2,
const ipReal64  a31,
const ipReal64  a32,
const ipReal64  a33,
const ipReal64  b3,
ipReal64 x1,
ipReal64 x2,
ipReal64 x3 
)

solve linear system of 3 equations with three unknowns (we solve linear system AX=B)

Returns
false if system cannot be inverted

◆ invertMatrix()

IPSDK_FORCEINLINE bool ipsdk::math::invertMatrix ( ipReal64 a11,
ipReal64 a12,
ipReal64 a21,
ipReal64 a22 
)

inversion of a 2x2 matrix

Returns
false if matrix cannot be inverted

◆ choleskyDecomposition()

IPSDKMATH_API bool ipsdk::math::choleskyDecomposition ( const Matrix matA,
Matrix matU 
)

decomposition of a nxn symetric positive definite matrix using cholesky decomposition

  • matU : nxn an upper triangular matrix

with :

◆ choleskyInverse() [1/2]

IPSDKMATH_API bool ipsdk::math::choleskyInverse ( Matrix matA)

in situ inversion of a nxn symetric positive definite matrix using cholesky decomposition method

Exceptions
ipsdk::math::IPSDKMathExceptionif matA.size1() != matA.size2()
Returns
false if matA is not positive definite

◆ choleskyInverse() [2/2]

IPSDKMATH_API bool ipsdk::math::choleskyInverse ( const Matrix matA,
Matrix matInvA 
)

inversion of a nxn symetric positive definite matrix using cholesky decomposition method

Exceptions
ipsdk::math::IPSDKMathExceptionif matA.size1() != matA.size2()
ipsdk::math::IPSDKMathExceptionif matInvA.size1() != n || matInvA.size2() != n
Returns
false if matA is not positive definite

◆ eigenDecomposition() [1/4]

IPSDKMATH_API void ipsdk::math::eigenDecomposition ( const ipReal64  mXX,
const ipReal64  mXY,
const ipReal64  mYY,
ipReal64 lambdaMin,
ipReal64 lambdaMax,
ipReal64 theta 
)

eigen decomposition of symetric 2x2 matrix

\[ \begin{bmatrix} mXX & mXY \\ mXY & mYY \end{bmatrix} \]

On output value are granted such that :

  • lambdaMin <= lambdaMax
  • theta belongs to interval ]-Pi, Pi] For more informations on angles report to Rotations 2d

◆ eigenDecomposition() [2/4]

template<typename T >
IPSDKMATH_API void ipsdk::math::eigenDecomposition ( const T  mXX,
const T  mXY,
const T  mXZ,
const T  mYY,
const T  mYZ,
const T  mZZ,
T &  lambdaMin,
T &  lambdaInter,
T &  lambdaMax,
T &  vMinX,
T &  vMinY,
T &  vMinZ,
T &  vInterX,
T &  vInterY,
T &  vInterZ,
T &  vMaxX,
T &  vMaxY,
T &  vMaxZ 
)

eigen decomposition of symetric 3x3 matrix

\[ \begin{bmatrix} mXX & mXY & mXZ \\ mXY & mYY & mYZ \\ mXZ & mYZ & mZZ \end{bmatrix} \]

On output value are granted such that :

  • lambdaMin <= lambdaInter <= lambdaMax
See also
https://en.wikipedia.org/wiki/Eigenvalue_algorithm

◆ eigenDecomposition() [3/4]

template<typename T >
IPSDKMATH_API void ipsdk::math::eigenDecomposition ( const T  mXX,
const T  mXY,
const T  mXZ,
const T  mYY,
const T  mYZ,
const T  mZZ,
T &  lambdaMin,
T &  lambdaInter,
T &  lambdaMax,
T &  chi,
T &  beta,
T &  alpha 
)

eigen decomposition of symetric 3x3 matrix

\[ \begin{bmatrix} mXX & mXY & mXZ \\ mXY & mYY & mYZ \\ mXZ & mYZ & mZZ \end{bmatrix} \]

On output value are granted such that :

  • lambdaMin <= lambdaInter <= lambdaMax
See also
https://en.wikipedia.org/wiki/Eigenvalue_algorithm

◆ eigenDecomposition() [4/4]

ipUInt32 ipsdk::math::eigenDecomposition ( const Matrix mat,
Vector eigenValues,
Matrix eigenVectors 
)

eigen decomposition of symetric NxN matrix On output :

◆ eigenPartialDecomposition()

void ipsdk::math::eigenPartialDecomposition ( const Matrix mat,
Vector eigenValues,
Matrix eigenVectors 
)

eigen decomposition of symetric NxN matrix with search for only M greatest values On output :

◆ comparable_distance()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::comparable_distance ( const ipsdk::math::Vector v0,
const ipsdk::math::Vector v1 
)

function allowing to compute comparable distance between two vectors

Warning
there is no check on vector size consistency

◆ euclidian_distance()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::euclidian_distance ( const ipsdk::math::Vector v0,
const ipsdk::math::Vector v1 
)

function allowing to compute euclidian distance between two vectors

Warning
there is no check on vector size consistency

◆ compareRelative() [1/4]

template<typename ArrayType1 , typename ArrayType2 >
bool ipsdk::math::compareRelative ( const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType1 > &  mat1,
const boost::numeric::ublas::matrix< ipReal64, boost::numeric::ublas::row_major, ArrayType2 > &  mat2,
const ipReal64  epsilonValue = NumericLimits<ipReal64>::sqrt_epsilon() 
)

matrix comparison with tolerance on frobenius norm of difference relatively to maximum input frobenius norm

◆ compareRelative() [2/4]

template<typename ArrayType1 , typename ArrayType2 >
bool ipsdk::math::compareRelative ( const boost::numeric::ublas::vector< ipReal64, ArrayType1 > &  vec1,
const boost::numeric::ublas::vector< ipReal64, ArrayType2 > &  vec2,
const ipReal64  epsilonValue = NumericLimits<ipReal64>::sqrt_epsilon() 
)

vector comparison with tolerance on euclidian norm of difference relatively to maximum input euclidian norm

◆ luSolve()

IPSDKMATH_API bool ipsdk::math::luSolve ( const Matrix matA,
const Vector vecB,
Vector vecX 
)

linear system resolution using lu decomposition Solved system is : matA x VecX = vecB with

◆ luInverse() [1/2]

IPSDKMATH_API bool ipsdk::math::luInverse ( Matrix matA)

in place inversion of a nxn squared matrix using lu decomposition method

Returns
false if input matrix is not full rank (error case) User should check this value to ensure results validity

◆ luInverse() [2/2]

IPSDKMATH_API bool ipsdk::math::luInverse ( const Matrix matA,
Matrix matInvA 
)

inversion of a nxn squared matrix using lu decomposition method With :

  • matInvA a nxn matrix
    Returns
    false if input matrix is not full rank (error case) User should check this value to ensure results validity

◆ upperTriangularInverse()

IPSDKMATH_API bool ipsdk::math::upperTriangularInverse ( Matrix matA)

inversion of a nxn upper triangular matrix

Returns
false if input matrix is not full rank (error case) User should check this value to ensure results validity

◆ lowerTriangularInverse()

IPSDKMATH_API bool ipsdk::math::lowerTriangularInverse ( Matrix matA)

inversion of a nxn lower triangular matrix

Returns
false if input matrix is not full rank (error case) User should check this value to ensure results validity

◆ qrSolve()

IPSDKMATH_API bool ipsdk::math::qrSolve ( const Matrix matA,
const Vector vecB,
Vector vecX 
)

linear system resolution using qr decomposition method Solved system is : matA x VecX = vecB with

◆ qrDecomposition()

IPSDKMATH_API void ipsdk::math::qrDecomposition ( const Matrix matA,
Matrix matQ,
Matrix matR 
)

QR decomposition of mxn matrix Given mn = min(m,n), we have :

◆ svdSolve() [1/3]

IPSDKMATH_API ipUInt32 ipsdk::math::svdSolve ( const Matrix matA,
const Vector vecB,
Vector vecX 
)

over constrained linear system resolution using singular value decomposition method Solved system is : matA x vecX = vecB with

◆ svdSolve() [2/3]

IPSDKMATH_API ipUInt32 ipsdk::math::svdSolve ( const Matrix matA,
const Matrix matB,
Matrix matX 
)

over constrained linear system resolution using singular value decomposition method (case of multiple solved systems AX=B with shared matrix A) Solved system is : matA x matX = matB with

◆ svdSolve() [3/3]

IPSDKMATH_API ipUInt32 ipsdk::math::svdSolve ( const Matrix matA,
Vector vecX 
)

over constrained linear system resolution using singular value decomposition method Solved system is : matA x VecX = 0 with

◆ svdDecomposition()

IPSDKMATH_API void ipsdk::math::svdDecomposition ( const Matrix matA,
Matrix matU,
Vector vecS,
Matrix matVt 
)

singular value decomposition of mxn matrix Given mn = min(m,n), we have :

  • matU : mxmn matrix of left singular vectors
  • vecS : mn vector of singular values associated to decomposition. Singular values are sorted in descending order
  • matVt : mnxn matrix of right singular vectors

with :

◆ svdInverse()

IPSDKMATH_API ipUInt32 ipsdk::math::svdInverse ( const Matrix matA,
Matrix matInvA 
)

inversion of a mxn rectangular matrix with m >= n using singular value decomposition method. With :

  • matInvA a nxm matrix
    Returns
    input matrix rank.

◆ solveQuadratic()

IPSDKMATH_API ipUInt32 ipsdk::math::solveQuadratic ( ipReal64  a,
ipReal64  b,
ipReal64  c,
ipReal64 x1,
ipReal64 x2 
)

second order polynomial real roots search

Second order polynomial resolution for an equation of type : $a \times x^2 + b \times x + c = 0$

Note
  • if no solution are found, x1 and x2 are left unchanged
  • if a unique solution is found then x1 = x2 on output
  • if two soutions are found then x1 < x2 on output
Returns
number of roots found for equation

◆ median()

template<typename T >
T ipsdk::math::median ( std::vector< T > &  coll)

function allowing to compute median of a collection

Warning
input collection is modified (partially sorted)
Returns
median value of collection (nth element of sorted collection with index coll.size() / 2)

◆ correlation()

template<typename T >
IPSDKMATH_API ipReal64 ipsdk::math::correlation ( const std::vector< T > &  coll1,
const std::vector< T > &  coll2 
)

function allowing to compute correlation between two vectors of data

See also
https://en.wikipedia.org/wiki/Correlation_and_dependence
Exceptions
ipsdk::math::IPSDKMathExceptionif coll1.size() != coll2.size()
Returns
a value in interval [-1, 1]

◆ findLocalStrictExtrema()

template<typename T , typename IndexType >
IPSDKMATH_API void ipsdk::math::findLocalStrictExtrema ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
const eExtremaType extremaType,
std::vector< IndexType > &  extremaIdxColl 
)

generic function allowing to search for local strict extrema into a collection of values

Returns
a collection of indexes associated to local extrema positions

◆ findLocalStrictMinima()

template<typename T , typename IndexType >
void ipsdk::math::findLocalStrictMinima ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
std::vector< IndexType > &  extremaIdxColl 
)

generic function allowing to search for local strict minima into a collection of values

Returns
a collection of index which repect following predicate : if we set j = extremaIdxColl[i]
  • inputColl[j] < inputColl[j-1]
  • inputColl[j] < inputColl[j+1]

◆ findLocalStrictMaxima()

template<typename T , typename IndexType >
void ipsdk::math::findLocalStrictMaxima ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
std::vector< IndexType > &  extremaIdxColl 
)

generic function allowing to search for local strict maxima into a collection of values

Returns
a collection of index which repect following predicate : if we set j = extremaIdxColl[i]
  • inputColl[j] > inputColl[j-1]
  • inputColl[j] > inputColl[j+1]

◆ findLocalDilatedExtrema()

template<typename T >
IPSDKMATH_API void ipsdk::math::findLocalDilatedExtrema ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
const eExtremaType extremaType,
const T &  dilateFactor,
ExtremaRangeColl extremaRangeColl 
)

generic function allowing to search for local 'dilated' extrema into a collection of values

Returns
a collection of indexes associated to local extrema positions. An extrema can span over several contiguous data (ie. a range). It is represented by a pair containing its starting index and its length
Warning
in case where extremaBorderPolicy == eExtremaBorderPolicy::eEBP_MakeRing last range can end after input collection last data since in some cases it agregates starting data
Exceptions
ipsdk::math::IPSDKMathExceptionif dilateFactor < 0

◆ findLocalExtrema()

template<typename T , typename IndexType >
IPSDKMATH_API void ipsdk::math::findLocalExtrema ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
const eExtremaType extremaType,
std::vector< IndexType > &  extremaIdxColl 
)

function allowing to search for local extrema into a collection of values (this is the non strict extrema search version)

Returns
a collection of indexes associated to local extrema positions.

◆ findLocalMinima()

template<typename T , typename IndexType >
void ipsdk::math::findLocalMinima ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
std::vector< IndexType > &  extremaIdxColl 
)

function allowing to search for local minima into a collection of values

Returns
a collection of index which repect following predicate : if we set j = extremaIdxColl[i]
  • inputColl[j] <= inputColl[j-1]
  • inputColl[j] <= inputColl[j+1]

◆ findLocalMaxima()

template<typename T , typename IndexType >
void ipsdk::math::findLocalMaxima ( const std::vector< T > &  inputColl,
const eExtremaBorderPolicy extremaBorderPolicy,
std::vector< IndexType > &  extremaIdxColl 
)

function allowing to search for local maxima into a collection of values

Returns
a collection of index which repect following predicate : if we set j = extremaIdxColl[i]
  • inputColl[j] >= inputColl[j-1]
  • inputColl[j] >= inputColl[j+1]

◆ filterExtrema()

template<typename ExtremaInfo , typename T >
IPSDKMATH_API void ipsdk::math::filterExtrema ( const eExtremaType extremaType,
const ipReal64  minDistance,
const T  extremaThresholdValue,
boost::function< void(const ExtremaInfo &, ipReal64 &, T &)>  extractExtremaCoordsWrapper,
std::vector< ExtremaInfo > &  extremaInfoColl 
)

function allowing to filter a collection of extrema using a distance criterion

Extrema are first sorted in function of there value and then filtered using a distance criterion

ExtractExtremaCoords function allows to retrieve extrema location and extrema value from an ExtremaInfo.

  • note on extrema location :
    • In case where ExtremaInfo==ipUInt64, extrema location can simply be equal to ExtremaInfo value
    • In case where ExtremaInfo==ExtremaRange extrema location can be equal to middle of range but can also be ponderated (case of histogram for example)
  • note on extrema value :
    • In case where ExtremaInfo==ipUInt64, extrema value can simply be equal to its associated element into input collection from which extrema have been computed
    • In case where ExtremaInfo==ExtremaRange extrema value can be equal to value of element associated to its location (see previous) into input collection from which extrema have been computed. Note that in case of histogram for example, associated value can be the sum of all population covered by extrema.

On output extrema collection elements are granted to respect following conditions :

  • Given two extrema indexes $i$ and $j$ and associated info $(L(i), V(i))$ and $(L(j), V(j))$ where $L$ stands for extrema location and $V$ for extrema value $\left | L(i) - L(j) \right | > minDistance$
  • Given an extrema index $i$ and associated info $(L(i), V(i))$ :

    \[ \begin{cases} V(i) > extremaThresholdValue & \text{in maxima case} \\ V(i) < extremaThresholdValue & \text{in minima case} \\ \end{cases} \]

On output extrema collection is sorted in ascending order

◆ extractBasicExtremaCoords() [1/2]

template<typename T , typename IndexType >
void ipsdk::math::extractBasicExtremaCoords ( const std::vector< T > &  inputColl,
const IndexType &  dataIdx,
ipReal64 extremaLocation,
T &  extremaValue 
)

basic function to retrieve extrema coordinates from an extrema index

◆ extractBasicExtremaCoords() [2/2]

template<typename T >
IPSDKMATH_API void ipsdk::math::extractBasicExtremaCoords ( const std::vector< T > &  inputColl,
const ExtremaRange extremaRange,
ipReal64 extremaLocation,
T &  extremaValue 
)

basic function to retrieve extrema coordinates from an extrema range information

Extrema location is set as startIdx + length/2.0 and value is averaged on values associated to integer locations startIdx + length/2 and startIdx + (length+1)/2

◆ filterMinima() [1/2]

template<typename T , typename IndexType >
void ipsdk::math::filterMinima ( const std::vector< T > &  inputColl,
const ipReal64  minDistance,
std::vector< IndexType > &  extremaInfoColl 
)

function allowing to filter a collection of minima using a distance criterion Extrema are first sorted in function of there value and then filtered using a distance criterion

On output extrema collection elements are granted to respect following condition :

  • Given two extrema indexes $i$ and $j$ : $\left | i - j \right | > minDistance$

On output extrema collection is sorted in ascending order

◆ filterMinima() [2/2]

template<typename T , typename IndexType >
void ipsdk::math::filterMinima ( const std::vector< T > &  inputColl,
const ipReal64  minDistance,
const T  extremaThresholdValue,
std::vector< IndexType > &  extremaInfoColl 
)

function allowing to filter a collection of minima using a distance criterion and a value threshold Extrema are first sorted in function of there value and then filtered using a distance criterion

On output extrema collection elements are granted to respect following conditions :

  • Given two extrema indexes $i$ and $j$ : $\left | i - j \right | > minDistance$
  • Given an extrema index $i$ : $inputColl[i] < extremaThresholdValue$

On output extrema collection is sorted in ascending order

◆ filterMaxima() [1/2]

template<typename T , typename IndexType >
void ipsdk::math::filterMaxima ( const std::vector< T > &  inputColl,
const ipReal64  minDistance,
std::vector< IndexType > &  extremaInfoColl 
)

function allowing to filter a collection of maxima using a distance criterion Extrema are first sorted in function of there value and then filtered using a distance criterion

On output extrema collection elements are granted to respect following condition :

  • Given two extrema indexes $i$ and $j$ : $\left | i - j \right | > minDistance$

On output extrema collection is sorted in ascending order

◆ filterMaxima() [2/2]

template<typename T , typename IndexType >
void ipsdk::math::filterMaxima ( const std::vector< T > &  inputColl,
const ipReal64  minDistance,
const T  extremaThresholdValue,
std::vector< IndexType > &  extremaInfoColl 
)

function allowing to filter a collection of maxima using a distance criterion and a value threshold Extrema are first sorted in function of there value and then filtered using a distance criterion

On output extrema collection elements are granted to respect following conditions :

  • Given two extrema indexes $i$ and $j$ : $\left | i - j \right | > minDistance$
  • Given an extrema index $i$ : $inputColl[i] > extremaThresholdValue$

On output extrema collection is sorted in ascending order

◆ computeHistogramRange()

IPSDKMATH_API ipReal64 ipsdk::math::computeHistogramRange ( const ipBool  bDataIntegral,
const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue 
)

function allowing to compute range associated to an histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue > lastHistoValue

◆ computeHistogramNbClasses()

IPSDKMATH_API ipUInt32 ipsdk::math::computeHistogramNbClasses ( const ipBool  bDataIntegral,
const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue,
const ipReal64  binWidth 
)

function allowing to compute number of classes associated to an histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue > lastHistoValue
ipsdk::math::IPSDKMathExceptionif binWidth <= 0

◆ computeHistogramBinWidth()

IPSDKMATH_API ipReal64 ipsdk::math::computeHistogramBinWidth ( const ipBool  bDataIntegral,
const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue,
const ipUInt32  nbClasses 
)

function allowing to compute bin width associated to an histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue > lastHistoValue
ipsdk::math::IPSDKMathExceptionif nbClasses == 0

◆ computeHistogramBoundsInfo()

IPSDKMATH_API void ipsdk::math::computeHistogramBoundsInfo ( const ipUInt32  nbClasses,
const eHistogramOutOfBoundsPolicy outOfBoundsPolicy,
ipUInt32 lowerOutOfBoundsBinIdx,
ipUInt32 upperOutOfBoundsBinIdx,
ipUInt32 inBoundsBinOffset,
ipUInt32 nbBins 
)

function allowing to deduce histogram bound policies from a global enumerate value

Exceptions
ipsdk::math::IPSDKMathExceptionif nbClasses == 0

◆ exportToCsv()

IPSDKMATH_API void ipsdk::math::exportToCsv ( const boost::filesystem::path &  filePath,
const ipsdk::math::BaseHistogram histogram 
)

function allowing to export histogram data to a csv file

Exceptions
ipsdk::math::IPSDKMathExceptionif histogram.isInit() == false
ipsdk::math::IPSDKMathExceptionon failure

◆ normalDistribution()

IPSDKMATH_API ipReal64 ipsdk::math::normalDistribution ( const ipReal64  x,
const ipReal64  stdDev,
const ipReal64  mean = 0 
)

function allowing to compute normal distribution value

Returns
0 if stdDev <= 0
See also
https://en.wikipedia.org/wiki/Normal_distribution#General_normal_distribution

◆ normalDistributionFirstDerivative()

IPSDKMATH_API ipReal64 ipsdk::math::normalDistributionFirstDerivative ( const ipReal64  x,
const ipReal64  stdDev,
const ipReal64  mean = 0 
)

function allowing to compute first derivative value for normal distribution

Returns
0 if stdDev <= 0
See also
https://en.wikipedia.org/wiki/Normal_distribution#Symmetries_and_derivatives

◆ normalDistributionSecondDerivative()

IPSDKMATH_API ipReal64 ipsdk::math::normalDistributionSecondDerivative ( const ipReal64  x,
const ipReal64  stdDev,
const ipReal64  mean = 0 
)

function allowing to compute second derivative value for normal distribution

Returns
0 if stdDev <= 0
See also
https://en.wikipedia.org/wiki/Normal_distribution#Symmetries_and_derivatives

◆ cumulativeNormalDistribution()

IPSDKMATH_API ipReal64 ipsdk::math::cumulativeNormalDistribution ( const ipReal64  x,
const ipReal64  stdDev,
const ipReal64  mean = 0 
)

function allowing to approximate cumulative distribution function value for normal distribution

See also
https://en.wikipedia.org/wiki/Normal_distribution#Numerical_approximations_for_the_normal_CDF (Zelen, Marvin; Severo, Norman C. (1964). Probability Functions (chapter 26). Handbook of mathematical functions with formulas, graphs, and mathematical tables, by Abramowitz, M.; and Stegun, I. A.: National Bureau of Standards. New York, NY: Dover. ISBN 0-486-61272-4.)

◆ normalDistributionCoverage()

ipReal64 ipsdk::math::normalDistributionCoverage ( const ipReal64  dist,
const ipReal64  stdDev,
const ipReal64  mean = 0 
)
inline

function allowing to approximate normal distribution ratio coverage of values at a given distance away from the mean

See also
https://en.wikipedia.org/wiki/Normal_distribution#Standard_deviation_and_coverage

◆ linearInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::linearInterpolation ( const ipReal64  x,
const ipReal64  f0,
const ipReal64  f1 
)

function allowing to compute linear interpolation between two values

Parameters
xabscissa of interpolation point in [0, 1] for which we know f(0) and f(1)
f0function value for x=0 (ie f(0))
f1function value for x=1 (ie f(1))

◆ biLinearInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::biLinearInterpolation ( const ipReal64  x,
const ipReal64  y,
const ipReal64  fX0Y0,
const ipReal64  fX1Y0,
const ipReal64  fX0Y1,
const ipReal64  fX1Y1 
)

function allowing to compute a bi linear interpolation

Parameters
xabscissa of interpolation point in [0, 1]
yordinate of interpolation point in [0, 1]
fX0Y0function value for x=0 and y=0 (ie f(0, 0))
fX1Y0function value for x=1 and y=0 (ie f(1, 0))
fX0Y1function value for x=0 and y=1 (ie f(0, 1))
fX1Y1function value for x=1 and y=1 (ie f(1, 1))
See also
https://en.wikipedia.org/wiki/Bilinear_interpolation

◆ triLinearInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::triLinearInterpolation ( const ipReal64  x,
const ipReal64  y,
const ipReal64  z,
const ipReal64  fX0Y0Z0,
const ipReal64  fX1Y0Z0,
const ipReal64  fX0Y1Z0,
const ipReal64  fX1Y1Z0,
const ipReal64  fX0Y0Z1,
const ipReal64  fX1Y0Z1,
const ipReal64  fX0Y1Z1,
const ipReal64  fX1Y1Z1 
)

function allowing to compute a tri linear interpolation

Parameters
xabscissa of interpolation point in [0, 1]
yordinate of interpolation point in [0, 1]
zelevation of interpolation point in [0, 1]
fX0Y0Z0function value for x=0, y=0 and z=0 (ie f(0, 0, 0))
fX1Y0Z0function value for x=1, y=0 and z=0 (ie f(1, 0, 0))
fX0Y1Z0function value for x=0, y=1 and z=0 (ie f(0, 1, 0))
fX1Y1Z0function value for x=1, y=1 and z=0 (ie f(1, 1, 0))
fX0Y0Z1function value for x=0, y=0 and z=1 (ie f(0, 0, 1))
fX1Y0Z1function value for x=1, y=0 and z=1 (ie f(1, 0, 1))
fX0Y1Z1function value for x=0, y=1 and z=1 (ie f(0, 1, 1))
fX1Y1Z1function value for x=1, y=1 and z=1 (ie f(1, 1, 1))
See also
https://en.wikipedia.org/wiki/Trilinear_interpolation

◆ cubicInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::cubicInterpolation ( const ipReal64  x,
const ipReal64  fM1,
const ipReal64  f0,
const ipReal64  f1,
const ipReal64  f2 
)

function allowing to compute cubic interpolation between two values

Parameters
xabscissa of interpolation point in [0, 1] for which we know f(-1), f(0), f(1) and f(2)
fM1function value for x=-1 (ie f(-1))
f0function value for x=0 (ie f(0))
f1function value for x=1 (ie f(1))
f2function value for x=2 (ie f(2))
See also
https://en.wikipedia.org/wiki/Cubic_Hermite_spline
Note
this interpolation is not monotone !

◆ biCubicInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::biCubicInterpolation ( const ipReal64  x,
const ipReal64  y,
const ipReal64  f[4][4] 
)

function allowing to compute a bi cubic interpolation

Parameters
xabscissa of interpolation point in [0, 1]
yordinate of interpolation point in [0, 1]
ffunction values indexed as f[y][x] and where (for example) :
  • f[0][0] = f(x=-1, y=-1)
  • f[1][1] = f(x=0, y=0)
  • f[1][2] = f(x=1, y=0)
  • f[1][3] = f(x=2, y=0)
See also
https://en.wikipedia.org/wiki/Bicubic_interpolation

◆ triCubicInterpolation()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::triCubicInterpolation ( const ipReal64  x,
const ipReal64  y,
const ipReal64  z,
const ipReal64  f[4][4][4] 
)

function allowing to compute a tri cubic interpolation

Parameters
xabscissa of interpolation point in [0, 1]
yordinate of interpolation point in [0, 1]
zelevation of interpolation point in [0, 1]
ffunction values indexed as f[z][y][x] and where (for example) :
  • f[0][0][0] = f(x=-1, y=-1, z=-1)
  • f[1][1][1] = f(x=0, y=0, z=0)
  • f[1][1][2] = f(x=1, y=0, z=0)
  • f[1][1][3] = f(x=2, y=0, z=0)
See also
https://en.wikipedia.org/wiki/Tricubic_interpolation

◆ sort()

template<typename T >
IPSDKMATH_API void ipsdk::math::sort ( const T &  x1,
const T &  x2,
const T &  x3,
T &  y1,
T &  y2,
T &  y3 
)

function allowing to sort 3 numbers in ascending order

On ouput y1 <= y2 <= y3

◆ compare() [1/2]

template<typename T >
IPSDKMATH_API boost::enable_if<typename boost::is_arithmetic<T>::type, bool>::type ipsdk::math::compare ( const T  val1,
const T  val2,
const T  tolerance = NumericLimits< T >::sqrt_epsilon() 
)

function allowing to compare two values

Returns
false if |val1 - val2| > tolerance

◆ compare() [2/2]

template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type ipsdk::math::compare ( const std::vector< T > &  vec1,
const std::vector< T > &  vec2,
const T  tolerance = NumericLimits<T>::sqrt_epsilon() 
)

function allowing to compare two values

Returns
false if :
  • vec1.size() != vec2.size()
  • exists i such that |vec1[i] - vec2[i]| > tolerance

◆ compareRelative() [3/4]

template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type ipsdk::math::compareRelative ( const T  val1,
const T  val2,
const T  tolerance = NumericLimits<T>::sqrt_epsilon() 
)

function allowing to compare two values

Returns
following boolean predicate :
  • if |val2| > tolerance : |val1 - val2| / |val2| > tolerance
  • if |val2| <= tolerance : |val1| <= tolerance

◆ compareRelative() [4/4]

template<typename T >
IPSDKMATH_API boost::enable_if< typename boost::is_arithmetic< T >::type, bool >::type ipsdk::math::compareRelative ( const std::vector< T > &  vec1,
const std::vector< T > &  vec2,
const T  tolerance = NumericLimits<T>::sqrt_epsilon() 
)

function allowing to compare two values

Returns
following boolean predicate :
  • vec1.size() != vec2.size()
  • exists i such that |vec2[i]| > tolerance : |vec1[i] - vec2[i]| / |vec2[i]| > tolerance
  • exists i such that |vec2[i]| <= tolerance : |vec1[i]| <= tolerance