Visual Servoing Platform
version 3.1.0
|
#include <visp3/core/vpMath.h>
Public Member Functions | |
template<> | |
unsigned char | saturate (char v) |
template<> | |
unsigned char | saturate (unsigned short v) |
template<> | |
unsigned char | saturate (int v) |
template<> | |
unsigned char | saturate (short v) |
template<> | |
unsigned char | saturate (unsigned int v) |
template<> | |
unsigned char | saturate (float v) |
template<> | |
unsigned char | saturate (double v) |
template<> | |
char | saturate (unsigned char v) |
template<> | |
char | saturate (unsigned short v) |
template<> | |
char | saturate (int v) |
template<> | |
char | saturate (short v) |
template<> | |
char | saturate (unsigned int v) |
template<> | |
char | saturate (float v) |
template<> | |
char | saturate (double v) |
template<> | |
unsigned short | saturate (char v) |
template<> | |
unsigned short | saturate (short v) |
template<> | |
unsigned short | saturate (int v) |
template<> | |
unsigned short | saturate (unsigned int v) |
template<> | |
unsigned short | saturate (float v) |
template<> | |
unsigned short | saturate (double v) |
template<> | |
short | saturate (unsigned short v) |
template<> | |
short | saturate (int v) |
template<> | |
short | saturate (unsigned int v) |
template<> | |
short | saturate (float v) |
template<> | |
short | saturate (double v) |
template<> | |
int | saturate (float v) |
template<> | |
int | saturate (double v) |
template<> | |
unsigned int | saturate (float v) |
template<> | |
unsigned int | saturate (double v) |
Static Public Member Functions | |
static double | deg (double rad) |
static double | rad (double deg) |
static double | sqr (double x) |
static double | fact (unsigned int x) |
static long double | comb (unsigned int n, unsigned int p) |
static int | round (const double x) |
static int() | sign (double x) |
static bool | nul (double x, double s=0.001) |
static bool | equal (double x, double y, double s=0.001) |
static bool | greater (double x, double y, double s=0.001) |
template<class Type > | |
static Type | maximum (const Type &a, const Type &b) |
template<class Type > | |
static Type | minimum (const Type &a, const Type &b) |
template<class Type > | |
static Type | abs (const Type &x) |
static double | sinc (double x) |
static double | sinc (double sinx, double x) |
static double | mcosc (double cosx, double x) |
static double | msinc (double sinx, double x) |
static double | sigmoid (double x, double x0=0., double x1=1., double n=12.) |
template<class Type > | |
static void | swap (Type &a, Type &b) |
static bool | isNaN (const double value) |
static bool | isInf (const double value) |
template<typename _Tp > | |
static _Tp | saturate (unsigned char v) |
template<typename _Tp > | |
static _Tp | saturate (char v) |
template<typename _Tp > | |
static _Tp | saturate (unsigned short v) |
template<typename _Tp > | |
static _Tp | saturate (short v) |
template<typename _Tp > | |
static _Tp | saturate (unsigned v) |
template<typename _Tp > | |
static _Tp | saturate (int v) |
template<typename _Tp > | |
static _Tp | saturate (float v) |
template<typename _Tp > | |
static _Tp | saturate (double v) |
static double | getMean (const std::vector< double > &v) |
static double | getMedian (const std::vector< double > &v) |
static double | getStdev (const std::vector< double > &v, const bool useBesselCorrection=false) |
static int | modulo (const int a, const int n) |
Provides simple mathematics computation tools that are not available in the C mathematics library (math.h)
|
inlinestatic |
Find the absolute value of a number (or other).
x | : The number. |
Definition at line 152 of file vpMath.h.
Referenced by vpServo::secondaryTaskJointLimitAvoidance(), and vpMeNurbs::seekExtremities().
|
inlinestatic |
Computes the number of combination of p elements inside n elements.
n | : total number of elements. |
p | : requested number of elements. |
Definition at line 220 of file vpMath.h.
Referenced by vpMomentCentered::compute(), vpMomentAlpha::compute(), vpFeatureMomentCentered::compute_Lmu_pq(), vpNurbs::computeCurveDersPoint(), and vpPixelMeterConversion::convertMoment().
|
inlinestatic |
Convert an angle in radians into degrees.
rad | : Angle in radians. |
Definition at line 95 of file vpMath.h.
Referenced by vpMbGenericTracker::computeProjectionError(), vpMbEdgeMultiTracker::computeProjectionError(), vpMbEdgeTracker::computeProjectionError(), vpAfma6::getInverseKinematics(), vpMbDepthDenseTracker::loadConfigFile(), vpMbDepthNormalTracker::loadConfigFile(), vpMbEdgeKltTracker::loadConfigFile(), vpMbKltTracker::loadConfigFile(), vpMbEdgeTracker::loadConfigFile(), vpFeatureSegment::print(), vpPoseVector::print(), vpServoData::save(), vpSimulatorAfma6::savePosFile(), vpRobotAfma4::savePosFile(), vpSimulatorViper850::savePosFile(), vpRobotAfma6::savePosFile(), vpRobotViper650::savePosFile(), vpRobotViper850::savePosFile(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpRobotPioneer::setVelocity(), vpMbGenericTracker::track(), vpSimulatorAfma6::updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().
|
inlinestatic |
Compares to .
x | : x value. |
y | : y value. |
s | : Tolerance threshold. |
Definition at line 290 of file vpMath.h.
Referenced by vpCalibration::calibrationTsai(), vpPolygon::isInside(), vpImageConvert::MONO16ToRGBa(), and vpKeyPoint::saveLearningData().
|
inlinestatic |
|
static |
Compute the mean value for a vector of double.
v | : Vector of double values. |
Definition at line 202 of file vpMath.cpp.
References vpException::notInitialized.
|
static |
Compute the median value for a vector of double.
v | : Vector of double values. |
Definition at line 222 of file vpMath.cpp.
References vpException::notInitialized.
Referenced by vpRowVector::median(), and vpColVector::median().
|
static |
Compute the standard deviation value for a vector of double.
v | : Vector of double values. |
useBesselCorrection | : If true, the Bessel correction is used (normalize by N-1). |
Definition at line 252 of file vpMath.cpp.
References vpException::notInitialized.
|
inlinestatic |
|
static |
Returns whether a double is an infinity value (either positive infinity or negative infinity).
value | : Double number to check. |
Definition at line 110 of file vpMath.cpp.
|
static |
Check whether a double number is not a number (NaN) or not.
value | : Double number to check. |
Definition at line 84 of file vpMath.cpp.
Referenced by vpKeyPoint::compute3DForPointsOnCylinders(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpComedi::getPhyData(), vpMbtDistanceKltCylinder::init(), and vpPose::poseRansac().
|
inlinestatic |
Find the maximum between two numbers (or other).
a | : First number. |
b | : Second number. |
Definition at line 137 of file vpMath.h.
Referenced by vpMbEdgeTracker::addCircle(), vpMbEdgeTracker::addCylinder(), vpMbTracker::extractCylinders(), vpBSpline::findSpan(), vpRobotWireFrameSimulator::getExternalCameraParameters(), vpWireFrameSimulator::getExternalCameraParameters(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpWireFrameSimulator::getExternalImage(), vpDot2::getFreemanChain(), vpWireFrameSimulator::getInternalCameraParameters(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpImageTools::imageDifference(), vpMeNurbs::localReSample(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpPoseVector::print(), vpRowVector::print(), vpColVector::print(), vpMatrix::print(), vpRansac< vpTransformation >::ransac(), vpDot2::searchDotsInArea(), vpMeNurbs::seekExtremitiesCanny(), vpHinkley::testDownUpwardJump(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().
|
static |
Compute
cosx | : Value of cos(x). |
x | : Value of x. |
Definition at line 135 of file vpMath.cpp.
Referenced by vpRotationMatrix::buildFrom(), vpExponentialMap::direct(), and vpExponentialMap::inverse().
|
inlinestatic |
Find the minimum between two numbers (or other).
a | : First number. |
b | : Second number. |
Definition at line 145 of file vpMath.h.
Referenced by vpRobotWireFrameSimulator::getExternalCameraParameters(), vpWireFrameSimulator::getExternalCameraParameters(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpWireFrameSimulator::getExternalImage(), vpWireFrameSimulator::getInternalCameraParameters(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpImageTools::imageDifference(), vpIoTools::loadConfigFile(), vpWireFrameSimulator::navigation(), vpRansac< vpTransformation >::ransac(), and vpMbEdgeTracker::testTracking().
|
static |
Compute the modified modulo:
a | : The dividend. |
n | : The divisor. |
Definition at line 281 of file vpMath.cpp.
|
static |
Compute with .
sinx | : value of sin(x). |
x | : Value of x. |
Definition at line 153 of file vpMath.cpp.
Referenced by vpExponentialMap::direct(), and vpExponentialMap::inverse().
|
inlinestatic |
Compares to .
x | : Value to test. |
s | : Tolerance threshold |
Definition at line 281 of file vpMath.h.
Referenced by vpPose::computeRansacIterations(), vpQuaternionVector::inverse(), vpQuaternionVector::normalize(), and vpQuaternionVector::operator/().
|
inlinestatic |
Convert an angle in degrees into radian.
deg | : Angle in degrees. |
Definition at line 102 of file vpMath.h.
Referenced by vpVirtualGrabber::acquire(), vpMbTracker::addPolygon(), vpMbGenericTracker::computeProjectionError(), vpMbEdgeMultiTracker::computeProjectionError(), vpMeEllipse::display(), vpDisplay::displayEllipse(), vpRobotViper650::get_eJe(), vpRobotViper850::get_eJe(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotPioneer::getVelocity(), vpAfma6::init(), vpViper650::init(), vpViper850::init(), vpSimulatorAfma6::init(), vpSimulatorViper850::init(), vpSimulatorAfma6::initDisplay(), vpSimulatorViper850::initDisplay(), vpMeEllipse::initTracking(), vpMbtPolygon::isVisible(), vpMbDepthDenseTracker::loadConfigFile(), vpMbDepthNormalTracker::loadConfigFile(), vpMbEdgeKltTracker::loadConfigFile(), vpMbKltTracker::loadConfigFile(), vpMbEdgeTracker::loadConfigFile(), vpWireFrameSimulator::navigation(), vpMeEllipse::printParameters(), vpSimulatorAfma6::readPosFile(), vpRobotAfma4::readPosFile(), vpRobotAfma6::readPosFile(), vpMbDepthDenseTracker::resetTracker(), vpMbDepthNormalTracker::resetTracker(), vpMbGenericTracker::resetTracker(), vpMbEdgeMultiTracker::resetTracker(), vpMbKltMultiTracker::resetTracker(), vpMbKltTracker::resetTracker(), vpMbEdgeTracker::resetTracker(), vpMbGenericTracker::track(), vpMbEdgeKltTracker::vpMbEdgeKltTracker(), vpMbEdgeTracker::vpMbEdgeTracker(), vpMbKltTracker::vpMbKltTracker(), vpRobotBiclops::vpRobotBiclopsSpeedControlLoop(), vpRobotCamera::vpRobotCamera(), vpSickLDMRS::vpSickLDMRS(), vpSimulatorCamera::vpSimulatorCamera(), vpViper::vpViper(), vpViper650::vpViper650(), vpViper850::vpViper850(), vpWireFrameSimulator::vpWireFrameSimulator(), vpMeEllipse::~vpMeEllipse(), and vpPioneer::~vpPioneer().
|
inlinestatic |
Round x to the nearest integer.
x | : Value to round. |
Definition at line 235 of file vpMath.h.
References sign().
Referenced by vpMeLine::computeRhoTheta(), vpMeSite::convolution(), vpKeyPoint::createImageMatching(), vpKltOpencv::display(), vpMeNurbs::display(), vpDisplayGTK::displayCharString(), vpDisplayOpenCV::displayCharString(), vpDisplayGTK::displayCircle(), vpDisplayX::displayCircle(), vpDisplayOpenCV::displayCircle(), vpDisplayGTK::displayDotLine(), vpDisplayX::displayDotLine(), vpDisplayGTK::displayLine(), vpDisplayX::displayLine(), vpDisplayOpenCV::displayLine(), vpKeyPoint::displayMatching(), vpDisplayGTK::displayPoint(), vpDisplayX::displayPoint(), vpDisplayOpenCV::displayPoint(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayGTK::displayRectangle(), vpDisplayX::displayRectangle(), vpDisplayOpenCV::displayRectangle(), vp::equalizeHistogram(), vpBSpline::findSpan(), vpMeSite::getSign(), vpImage< unsigned char >::getValue(), vpMeSite::init(), vpMeLine::initTracking(), vpKeyPoint::insertImageMatching(), vpImageConvert::MONO16ToRGBa(), vpMeTracker::outOfImage(), vpMeLine::sample(), saturate(), vpKltOpencv::suppressFeature(), vpMeLine::updateDelta(), vpMeSite::vpMeSite(), and vpMeEllipse::~vpMeEllipse().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
Return the sign of x.
Definition at line 262 of file vpMath.h.
Referenced by vpMbEdgeTracker::computeVVSFirstPhase(), round(), and vpMeNurbs::seekExtremities().
|
static |
Compute sinus cardinal .
x | : Value of x. |
Definition at line 170 of file vpMath.cpp.
Referenced by vpRotationMatrix::buildFrom(), vpThetaUVector::buildFrom(), vpCalibration::calibrationTsai(), vpMatrix::computeCovarianceMatrixVVS(), vpExponentialMap::direct(), vpFeatureThetaU::interaction(), and vpExponentialMap::inverse().
|
static |
Compute sinus cardinal .
sinx | : Value of sin(x). |
x | : Value of x. |
Definition at line 187 of file vpMath.cpp.
|
inlinestatic |
Compute x square value.
Definition at line 108 of file vpMath.h.
Referenced by vpMbTracker::addPolygon(), vpCalibration::calibrationTsai(), vpMatrix::computeCovarianceMatrixVVS(), vpHomography::computeDisplacement(), vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpPoseFeatures::computePose(), vpPose::computeResidual(), vpPose::computeResidualDementhon(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpMbDepthDenseTracker::computeVVS(), vpMbDepthNormalTracker::computeVVS(), vpMbGenericTracker::computeVVS(), vpMbEdgeKltTracker::computeVVS(), vpMbEdgeMultiTracker::computeVVS(), vpMbEdgeKltMultiTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::computeVVSInit(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertLine(), vpPixelMeterConversion::convertLine(), vpPixelMeterConversion::convertPointWithDistortion(), vpPose::coplanar(), vpFeatureBuilder::create(), vpDot2::defineDots(), vpDisplayGTK::displayArrow(), vpDisplayX::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayOpenCV::displayDotLine(), vpFeatureDisplay::displayEllipse(), vpCalibration::displayGrid(), vpMeSite::distance(), vpImagePoint::distance(), vpMbtFaceDepthNormal::estimateFeatures(), vpImageFilter::getGaussianDerivativeKernel(), vpImageFilter::getGaussianKernel(), vpViper::getInverseKinematicsWrist(), vpMeEllipse::initTracking(), vpFeatureEllipse::interaction(), vpFeatureThetaU::interaction(), vpRotationMatrix::isARotationMatrix(), vpScale::KernelDensityGradient(), vpScale::KernelDensityGradient_EPANECHNIKOV(), vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpScale::MeanShift(), vpPose::poseRansac(), vpPose::poseVirtualVSrobust(), vpMeEllipse::printParameters(), vpCircle::projection(), vpNurbs::removeCurveKnot(), vpMeLine::reSample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpRobust::simultMEstimator(), vpMeSite::sqrDistance(), vpImagePoint::sqrDistance(), vpMeNurbs::supressNearPoints(), vpMeEllipse::track(), vpMeSite::track(), vpMbGenericTracker::track(), vpImageTools::undistort(), and vpMeEllipse::~vpMeEllipse().