Visual Servoing Platform
version 3.4.0
|
#include <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 (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 (double value) |
static bool | isInf (double value) |
static double | lineFitting (const std::vector< vpImagePoint > &imPts, double &a, double &b, double &c) |
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, bool useBesselCorrection=false) |
static int | modulo (int a, 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 160 of file vpMath.h.
Referenced by vpImageTools::imageDifferenceAbsolute(), vpImageTools::remap(), 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 230 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 103 of file vpMath.h.
Referenced by vpPose::calculArbreDementhon(), vpHandEyeCalibration::calibrate(), vpMbGenericTracker::computeCurrentProjectionError(), vpMbTracker::computeCurrentProjectionError(), vpMbGenericTracker::computeProjectionError(), vpMbEdgeTracker::computeProjectionError(), vpAfma6::getInverseKinematics(), vpRobotFlirPtu::getNetworkHostName(), vpMeEllipse::leastSquareRobust(), vpMbDepthDenseTracker::loadConfigFile(), vpMbDepthNormalTracker::loadConfigFile(), vpMbEdgeKltTracker::loadConfigFile(), vpMbKltTracker::loadConfigFile(), vpMbEdgeTracker::loadConfigFile(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpFeatureSegment::print(), vpPoseVector::print(), vpMeEllipse::printParameters(), vpServoData::save(), vpSimulatorAfma6::savePosFile(), vpRobotAfma4::savePosFile(), vpSimulatorViper850::savePosFile(), vpRobotAfma6::savePosFile(), vpRobotFranka::savePosFile(), vpRobotViper650::savePosFile(), vpRobotViper850::savePosFile(), vpRobotFlirPtu::setJointVelocity(), vpRobotKinova::setJointVelocity(), vpRobotKinova::setPosition(), vpRobotFlirPtu::setPosition(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpRobotPioneer::setVelocity(), vpMeEllipse::track(), vpMbGenericTracker::track(), vpSimulatorAfma6::updateArticularPosition(), vpSimulatorViper850::updateArticularPosition(), and vpRobotBiclops::vpRobotBiclopsSpeedControlLoop().
|
inlinestatic |
Compares to .
x | : x value. |
y | : y value. |
s | : Tolerance threshold. |
Definition at line 293 of file vpMath.h.
Referenced by vpMbDepthDenseTracker::display(), vpMbDepthNormalTracker::display(), vpMbEdgeKltTracker::display(), vpMbKltTracker::display(), vpMbEdgeTracker::display(), vpMbEdgeTracker::displayFeaturesOnImage(), vpPolygon::isInside(), vpImageConvert::MONO16ToRGBa(), vpRowVector::operator==(), vpColVector::operator==(), vpCameraParameters::operator==(), vpKeyPoint::saveLearningData(), vpQbSoftHand::setPosition(), and vpMbGenericTracker::track().
|
inlinestatic |
|
static |
Compute the mean value for a vector of double.
v | : Vector of double values. |
Definition at line 200 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 220 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 250 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 111 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 85 of file vpMath.cpp.
Referenced by vpKeyPoint::compute3DForPointsOnCylinders(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpComedi::getPhyData(), vpMbtDistanceKltCylinder::init(), and vpPose::poseRansac().
|
static |
Compute the line equation using least-squares fitting that minimizes the cost function:
imPts | : Image points (size >= 3). |
a | : a coefficient. |
b | : b coefficient. |
c | : c coefficient. |
Definition at line 287 of file vpMath.cpp.
References vpException::dimensionError, vpMatrix::eigenValues(), vpImagePoint::get_u(), and vpImagePoint::get_v().
|
inlinestatic |
Find the maximum between two numbers (or other).
a | : First number. |
b | : Second number. |
Definition at line 145 of file vpMath.h.
Referenced by vpMbEdgeTracker::addCircle(), vpMbEdgeTracker::addCylinder(), vpMbTracker::addProjectionErrorCircle(), vpMbTracker::addProjectionErrorCylinder(), vpMbTracker::extractCylinders(), vpBSpline::findSpan(), vpRobotWireFrameSimulator::getExternalCameraParameters(), vpWireFrameSimulator::getExternalCameraParameters(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpWireFrameSimulator::getExternalImage(), vpDot2::getFreemanChain(), vpWireFrameSimulator::getInternalCameraParameters(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), 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 136 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 153 of file vpMath.h.
Referenced by vpRobotWireFrameSimulator::getExternalCameraParameters(), vpWireFrameSimulator::getExternalCameraParameters(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), vpWireFrameSimulator::getExternalImage(), vpWireFrameSimulator::getInternalCameraParameters(), vpWireFrameSimulator::getInternalImage(), vpRobotWireFrameSimulator::getInternalView(), vpIoTools::loadConfigFile(), vpWireFrameSimulator::navigation(), vpRansac< vpTransformation >::ransac(), and vpMbEdgeTracker::testTracking().
|
static |
Compute the modified modulo:
a | : The dividend. |
n | : The divisor. |
Definition at line 340 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 284 of file vpMath.h.
Referenced by vpPose::computeRansacIterations(), vpQuaternionVector::inverse(), vpQuaternionVector::normalize(), vpQuaternionVector::operator/(), and vpImageTools::warpImage().
|
inlinestatic |
Convert an angle in degrees into radian.
deg | : Angle in degrees. |
Definition at line 110 of file vpMath.h.
Referenced by vpVirtualGrabber::acquire(), vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMbGenericTracker::computeProjectionError(), vpRobotViper650::get_eJe(), vpRobotViper850::get_eJe(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpRobotKinova::getJointPosition(), vpRobotFlirPtu::getNetworkHostName(), vpRobotPioneer::getVelocity(), vpViper650::init(), vpViper850::init(), vpAfma6::init(), vpSimulatorAfma6::init(), vpSimulatorViper850::init(), vpSimulatorAfma6::initDisplay(), vpSimulatorViper850::initDisplay(), vpMbtPolygon::isVisible(), vpMeEllipse::leastSquareRobust(), vpMbTracker::loadCAOModel(), vpMbDepthDenseTracker::loadConfigFile(), vpMbDepthNormalTracker::loadConfigFile(), vpMbEdgeKltTracker::loadConfigFile(), vpMbKltTracker::loadConfigFile(), vpMbEdgeTracker::loadConfigFile(), vpWireFrameSimulator::navigation(), vpMeEllipse::plugHoles(), vpSimulatorAfma6::readPosFile(), vpRobotAfma4::readPosFile(), vpRobotAfma6::readPosFile(), vpRobotFranka::readPosFile(), vpMbDepthDenseTracker::resetTracker(), vpMbDepthNormalTracker::resetTracker(), vpMbGenericTracker::resetTracker(), vpMbKltTracker::resetTracker(), vpMbEdgeTracker::resetTracker(), vpMeEllipse::sample(), vpMeEllipse::track(), vpMbGenericTracker::track(), vpRobotBiclops::vpRobotBiclopsSpeedControlLoop(), vpRobotCamera::vpRobotCamera(), vpSickLDMRS::vpSickLDMRS(), vpSimulatorCamera::vpSimulatorCamera(), vpViper::vpViper(), vpViper650::vpViper650(), vpViper850::vpViper850(), vpWireFrameSimulator::vpWireFrameSimulator(), and vpPioneer::~vpPioneer().
|
inlinestatic |
Round x to the nearest integer.
x | : Value to round. |
Definition at line 245 of file vpMath.h.
References sign().
Referenced by vpMeLine::computeRhoTheta(), vpMeSite::convolution(), vpKeyPoint::createImageMatching(), vpKltOpencv::display(), vpMeNurbs::display(), vpDisplayOpenCV::displayCharString(), vpDisplayX::displayCircle(), vpDisplayOpenCV::displayCircle(), vpDisplayX::displayDotLine(), vpDisplayX::displayLine(), vpDisplayOpenCV::displayLine(), vpKeyPoint::displayMatching(), vpDisplayX::displayPoint(), vpDisplayOpenCV::displayPoint(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayGTK::displayRectangle(), vpDisplayX::displayRectangle(), vpDisplayOpenCV::displayRectangle(), vp::equalizeHistogram(), vpImageTools::extract(), vpBSpline::findSpan(), vpImageTools::flip(), vpMbtDistanceKltPoints::getFeaturesForDisplay(), vpMbtDistanceKltCylinder::getFeaturesForDisplay(), vpMeSite::getSign(), vpImage< Type >::getValue(), vpMeSite::init(), vpMeLine::initTracking(), vpKeyPoint::insertImageMatching(), vpImageTools::interpolate(), vpImageConvert::MONO16ToRGBa(), vpMeTracker::outOfImage(), vpMeEllipse::plugHoles(), vpMeLine::sample(), vpMeEllipse::sample(), saturate(), vpKltOpencv::suppressFeature(), vpMeLine::updateDelta(), vpMeSite::vpMeSite(), and vpImageTools::warpImage().
|
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 |
|
static |
Compute sinus cardinal .
x | : Value of x. |
Definition at line 169 of file vpMath.cpp.
Referenced by vpRotationMatrix::buildFrom(), vpThetaUVector::buildFrom(), 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 185 of file vpMath.cpp.
|
inlinestatic |
Compute x square value.
Definition at line 116 of file vpMath.h.
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpMatrix::computeCovarianceMatrixVVS(), vpHomography::computeDisplacement(), vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpPoseFeatures::computePose(), vpPose::computeResidual(), vpPose::computeResidualDementhon(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpMbDepthDenseTracker::computeVVS(), vpMbDepthNormalTracker::computeVVS(), vpMbEdgeKltTracker::computeVVS(), vpMbGenericTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMbEdgeTracker::computeVVSInit(), vpMeterPixelConversion::convertEllipse(), vpPixelMeterConversion::convertLine(), vpMeterPixelConversion::convertLine(), vpPixelMeterConversion::convertPoint(), vpMeterPixelConversion::convertPoint(), vpPose::coplanar(), vpFeatureBuilder::create(), vpDot2::defineDots(), vpDisplayGTK::displayArrow(), vpDisplayX::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayOpenCV::displayDotLine(), vpCalibration::displayGrid(), vpMeSite::distance(), vpImagePoint::distance(), vpImageDraw::drawArrow(), vpImageDraw::drawDottedLine(), vpMbtFaceDepthNormal::estimateFeatures(), vpImageFilter::getGaussianDerivativeKernel(), vpImageFilter::getGaussianKernel(), vpViper::getInverseKinematicsWrist(), vpImageTools::initUndistortMap(), vpImageTools::integralImage(), vpFeatureEllipse::interaction(), vpFeatureThetaU::interaction(), vpRotationMatrix::isARotationMatrix(), vpScale::KernelDensityGradient(), vpScale::KernelDensityGradient_EPANECHNIKOV(), vpMeLine::leastSquare(), vpMeNurbs::localReSample(), vpScale::MeanShift(), vpRobust::MEstimator(), vpPose::poseVirtualVSrobust(), vpSphere::projection(), vpCircle::projection(), vpNurbs::removeCurveKnot(), vpMeLine::reSample(), vpMeLine::sample(), vpMeNurbs::sample(), vpMeLine::seekExtremities(), vpMeNurbs::seekExtremitiesCanny(), vpRobust::simultMEstimator(), vpMeSite::sqrDistance(), vpImagePoint::sqrDistance(), vpMeNurbs::supressNearPoints(), vpImageTools::templateMatching(), vpMeSite::track(), vpMbGenericTracker::track(), and vpImageTools::undistort().