Visual Servoing Platform
version 3.5.0 under development (2022-02-15)
|
#include <visp3/core/vpImagePoint.h>
Public Member Functions | |
vpImagePoint () | |
vpImagePoint (double ii, double jj) | |
vpImagePoint (const vpImagePoint &ip) | |
virtual | ~vpImagePoint () |
vpImagePoint & | operator= (const vpImagePoint &ip) |
vpImagePoint & | operator= (const vpImagePoint &&ip) noexcept |
vpImagePoint & | operator+= (const vpImagePoint &ip) |
vpImagePoint & | operator-= (const vpImagePoint &ip) |
vpImagePoint & | operator/= (double scale) |
vpImagePoint & | operator*= (double scale) |
void | set_i (double ii) |
void | set_j (double jj) |
void | set_ij (double ii, double jj) |
double | get_i () const |
double | get_j () const |
void | set_u (double u) |
void | set_v (double v) |
void | set_uv (double u, double v) |
double | get_u () const |
double | get_v () const |
bool | inRectangle (const vpRect &rect) const |
Static Public Member Functions | |
static vpRect | getBBox (const std::vector< vpImagePoint > &ipVec) |
static double | distance (const vpImagePoint &iP1, const vpImagePoint &iP2) |
static double | sqrDistance (const vpImagePoint &iP1, const vpImagePoint &iP2) |
Friends | |
VISP_EXPORT bool | operator== (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT bool | operator!= (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT vpImagePoint | operator+= (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT vpImagePoint | operator+ (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT vpImagePoint | operator+ (const vpImagePoint &ip1, int offset) |
VISP_EXPORT vpImagePoint | operator+ (const vpImagePoint &ip1, unsigned int offset) |
VISP_EXPORT vpImagePoint | operator+ (const vpImagePoint &ip1, double offset) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, int offset) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, unsigned int offset) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, double offset) |
VISP_EXPORT vpImagePoint | operator* (const vpImagePoint &ip1, double scale) |
VISP_EXPORT vpImagePoint | operator/ (const vpImagePoint &ip1, double scale) |
VISP_EXPORT std::ostream & | operator<< (std::ostream &os, const vpImagePoint &ip) |
Class that defines a 2D point in an image. This class is useful for image processing and stores only the 2D coordinates given in sub-pixel.
In this class, the 2D coordinates are not necessary integer values. It is easy to manipulate the given coordinates in the two frames used in ViSP : the (i,j) coordinates and the (u,v) coordinates. The two following images illustrate the two coordinate systems.
Definition at line 87 of file vpImagePoint.h.
|
inline |
Default constructor that initialize the coordinates of the image point to zero.
Definition at line 94 of file vpImagePoint.h.
|
inline |
Default constructor that initialize the coordinates of the image thanks to the parameters and .
Definition at line 99 of file vpImagePoint.h.
|
inline |
Copy constructor.
Initialize the coordinates of the image point with ip.
ip | : An image point. |
Definition at line 107 of file vpImagePoint.h.
|
inlinevirtual |
Destructor.
Definition at line 109 of file vpImagePoint.h.
|
static |
Compute the distance
iP1 | : First point |
iP2 | : Second point |
Definition at line 443 of file vpImagePoint.cpp.
References get_i(), get_j(), and vpMath::sqr().
Referenced by vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplay::displayDotLine(), vpDisplay::displayLine(), vpImageDraw::drawArrow(), vpNurbs::globalCurveInterp(), vpMeEllipse::leastSquareRobust(), vpMeNurbs::seekExtremities(), vpMeNurbs::track(), and vpMeNurbs::updateDelta().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (i,j).
Definition at line 203 of file vpImagePoint.h.
Referenced by vpTriangle::buildFrom(), vpNurbs::computeCurveDersPoint(), vpImageTools::crop(), vpMeNurbs::display(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayCross(), vpDisplayOpenCV::displayDotLine(), vpDisplayGTK::displayImageROI(), vpDisplayOpenCV::displayImageROI(), vpDisplay::displayLine(), vpKeyPoint::displayMatching(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayWin32::displayRectangle(), distance(), vpImageDraw::drawArrow(), vpImageDraw::drawCross(), vpImageDraw::drawDottedLine(), vpImageTools::extract(), vp::findContours(), vp::floodFill(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpMbtDistanceKltPoints::getFeaturesForDisplay(), vpMbtDistanceKltCylinder::getFeaturesForDisplay(), vpMbtDistanceKltPoints::getModelForDisplay(), vpMbtDistanceCircle::getModelForDisplay(), vpMbtDistanceLine::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpPolygon3D::getNbCornerInsideImage(), vpImage< bool >::getValue(), vpPolygon::init(), vpMbtDistanceLine::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMeLine::initTracking(), vpDot2::initTracking(), vpDot::initTracking(), vpImage< bool >::insert(), vpImageTools::interpolate(), vpTriangle::inTriangle(), vpTemplateTrackerTriangle::inTriangle(), vpRectOriented::isInside(), vpPolygon::isInside(), vpRect::isInside(), vpMeEllipse::leastSquareRobust(), vpWireFrameSimulator::navigation(), vpImage< bool >::operator()(), vpRectOriented::operator=(), vpMeTracker::outOfImage(), vpMeEllipse::plugHoles(), vpNurbs::removeCurveKnot(), vpMeEllipse::sample(), vpMeNurbs::seekExtremitiesCanny(), vpRectOriented::setOrientation(), vpRectOriented::setPoints(), vpRectOriented::setSize(), sqrDistance(), vpMbtDistanceLine::updateMovingEdge(), vpMbtDistanceCylinder::updateMovingEdge(), and vpRectOriented::vpRectOriented().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (i,j).
Definition at line 214 of file vpImagePoint.h.
Referenced by vpTriangle::buildFrom(), vpNurbs::computeCurveDersPoint(), vpImageTools::crop(), vpMeNurbs::display(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayCross(), vpDisplayOpenCV::displayDotLine(), vpDisplayGTK::displayImageROI(), vpDisplayOpenCV::displayImageROI(), vpDisplay::displayLine(), vpKeyPoint::displayMatching(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayWin32::displayRectangle(), distance(), vpImageDraw::drawArrow(), vpImageDraw::drawCross(), vpImageDraw::drawDottedLine(), vpImageTools::extract(), vp::findContours(), vp::floodFill(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpMbtDistanceKltPoints::getFeaturesForDisplay(), vpMbtDistanceKltCylinder::getFeaturesForDisplay(), vpMbtDistanceKltPoints::getModelForDisplay(), vpMbtDistanceCircle::getModelForDisplay(), vpMbtDistanceLine::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpPolygon3D::getNbCornerInsideImage(), vpImage< bool >::getValue(), vpPolygon::init(), vpMbtDistanceLine::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMeLine::initTracking(), vpDot2::initTracking(), vpDot::initTracking(), vpImage< bool >::insert(), vpImageTools::interpolate(), vpTriangle::inTriangle(), vpTemplateTrackerTriangle::inTriangle(), vpRectOriented::isInside(), vpPolygon::isInside(), vpRect::isInside(), vpMeEllipse::leastSquareRobust(), vpWireFrameSimulator::navigation(), vpImage< bool >::operator()(), vpRectOriented::operator=(), vpMeTracker::outOfImage(), vpMeEllipse::plugHoles(), vpNurbs::removeCurveKnot(), vpMeEllipse::sample(), vpMeNurbs::seekExtremitiesCanny(), vpRectOriented::setOrientation(), vpRectOriented::setPoints(), vpRectOriented::setSize(), sqrDistance(), vpMbtDistanceLine::updateMovingEdge(), vpMbtDistanceCylinder::updateMovingEdge(), and vpRectOriented::vpRectOriented().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (u,v).
Definition at line 262 of file vpImagePoint.h.
Referenced by vpMeEllipse::computeAngleOnEllipse(), vpPose::computePlanarObjectPoseFromRGBD(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpMeEllipse::computeTheta(), vpPixelMeterConversion::convertPoint(), vpDot2::defineDots(), vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpCalibration::displayData(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayX::displayRectangle(), vpDisplayGTK::displayRectangle(), vpDisplayOpenCV::displayRectangle(), vpImageDraw::drawEllipse(), vpImageDraw::drawLine(), vpDisplayWin32::flushDisplayROI(), vpDot2::getDistance(), vpDot2::getFreemanChain(), vpTemplateTrackerTriangle::init(), vpImageSimulator::init(), vpMeEllipse::initTracking(), vpPolygon::isInside(), vpMath::lineFitting(), vpRect::moveCenter(), vpDot::operator==(), vpHomography::project(), vpHomography::projection(), vpDot2::searchDotsInArea(), vpRect::set(), vpRect::setBottomRight(), vpRect::setTopLeft(), vpDot2::track(), vpDot::track(), vpRect::vpRect(), vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(), and vpCalibration::writeData().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (u,v).
Definition at line 273 of file vpImagePoint.h.
References operator*().
Referenced by vpMeEllipse::computeAngleOnEllipse(), vpPose::computePlanarObjectPoseFromRGBD(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpMeEllipse::computeTheta(), vpPixelMeterConversion::convertPoint(), vpDot2::defineDots(), vpDisplayOpenCV::displayCharString(), vpDisplayOpenCV::displayCircle(), vpCalibration::displayData(), vpDisplayOpenCV::displayLine(), vpDisplayOpenCV::displayPoint(), vpDisplayX::displayRectangle(), vpDisplayGTK::displayRectangle(), vpDisplayOpenCV::displayRectangle(), vpImageDraw::drawEllipse(), vpImageDraw::drawLine(), vpDisplayWin32::flushDisplayROI(), vpDot2::getDistance(), vpDot2::getFreemanChain(), vpTemplateTrackerTriangle::init(), vpImageSimulator::init(), vpMeEllipse::initTracking(), vpPolygon::isInside(), vpMath::lineFitting(), vpRect::moveCenter(), vpHomography::project(), vpHomography::projection(), vpDot2::searchDotsInArea(), vpRect::set(), vpRect::setBottomRight(), vpRect::setTopLeft(), vpDot2::track(), vpDot::track(), vpRect::vpRect(), vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(), and vpCalibration::writeData().
|
static |
Computes and returns the bounding box.
ipVec | : Vector of input image points. |
Definition at line 428 of file vpImagePoint.cpp.
bool vpImagePoint::inRectangle | ( | const vpRect & | rect | ) | const |
Check if an image point belongs to a rectangle.
rect | : the rectangle. |
Definition at line 53 of file vpImagePoint.cpp.
References vpRect::getBottom(), vpRect::getLeft(), vpRect::getRight(), and vpRect::getTop().
Referenced by vpPlot::navigate().
|
inline |
Operator *=.
Definition at line 150 of file vpImagePoint.h.
vpImagePoint & vpImagePoint::operator+= | ( | const vpImagePoint & | ip | ) |
Operator +=.
This operator can be used to compute the center of gravity of a set of image points.
Definition at line 86 of file vpImagePoint.cpp.
|
inline |
Operator -=.
Definition at line 139 of file vpImagePoint.h.
vpImagePoint & vpImagePoint::operator/= | ( | double | scale | ) |
Operator /=.
This operator can be used to compute the center of gravity of a set of image points.
Definition at line 119 of file vpImagePoint.cpp.
|
inline |
Copy operator.
Definition at line 114 of file vpImagePoint.h.
|
inlinenoexcept |
Move operator.
Definition at line 124 of file vpImagePoint.h.
|
inline |
Sets the point coordinate corresponding to the axes in the frame (i,j).
ii | : The desired value for the coordinate along the axes. |
Definition at line 166 of file vpImagePoint.h.
Referenced by vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpBSpline::computeCurvePoint(), vpMeLine::computeRhoTheta(), vpMeLine::display(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayCross(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpImageDraw::drawArrow(), vpImageDraw::drawCross(), vpMeLine::getExtremities(), vpMbtDistanceKltPoints::getFeaturesForDisplay(), vpMbtDistanceKltCylinder::getFeaturesForDisplay(), vpMeSite::getQueryList(), vpMeTracker::initTracking(), vpMeLine::intersection(), vpPolygon::isInside(), vpRectOriented::operator=(), vpNurbs::refineKnotVectCurve(), vpNurbs::removeCurveKnot(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpImageSimulator::setCameraPosition(), vpRectOriented::setOrientation(), vpRectOriented::setPoints(), vpRectOriented::setSize(), vpMeSite::track(), vpPolygon::updateCenter(), and vpRectOriented::vpRectOriented().
|
inline |
Sets the point coordinates in the frame (i,j).
ii | : The desired value for the coordinate along the axes. |
jj | : The desired value for the coordinate along the axes. |
Definition at line 188 of file vpImagePoint.h.
Referenced by vpKeyPoint::compute3DForPointsInPolygons(), vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::curveKnotIns(), vpMeNurbs::display(), vpFeatureDisplay::displayLine(), vpKeyPoint::displayMatching(), vpImageSimulator::getImage(), vpBasicKeyPoint::getMatchedPoints(), vpImage< bool >::getMinMaxLoc(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpBasicKeyPoint::getReferencePoint(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMbtDistanceCylinder::initMovingEdge(), vpMeEllipse::leastSquareRobust(), vpMeEllipse::plugHoles(), vpMeNurbs::seekExtremities(), vpMbtDistanceKltCylinder::updateMask(), vpMbtDistanceKltPoints::updateMask(), vpMbtDistanceCylinder::updateMovingEdge(), vpMeEllipse::updateTheta(), and vpMeEllipse::vpMeEllipse().
|
inline |
Sets the point coordinate corresponding to the axes in the frame (i,j).
jj | : The desired value for the coordinate along the axes. |
Definition at line 177 of file vpImagePoint.h.
Referenced by vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpBSpline::computeCurvePoint(), vpMeLine::computeRhoTheta(), vpMeLine::display(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayCross(), vpMbtDistanceKltCylinder::displayPrimitive(), vpMbtDistanceKltPoints::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpImageDraw::drawArrow(), vpImageDraw::drawCross(), vp::findContours(), vpMeLine::getExtremities(), vpMbtDistanceKltPoints::getFeaturesForDisplay(), vpMbtDistanceKltCylinder::getFeaturesForDisplay(), vpMeSite::getQueryList(), vpMeTracker::initTracking(), vpMeLine::intersection(), vpPolygon::isInside(), vpRectOriented::operator=(), vpNurbs::removeCurveKnot(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpImageSimulator::setCameraPosition(), vpRectOriented::setOrientation(), vpRectOriented::setPoints(), vpRectOriented::setSize(), vpMeSite::track(), vpPolygon::updateCenter(), and vpRectOriented::vpRectOriented().
|
inline |
Sets the point coordinate corresponding to the axes in the frame (u,v).
u | : The desired value for the coordinate along the axes. |
Definition at line 225 of file vpImagePoint.h.
Referenced by vpMeterPixelConversion::convertPoint(), vpKltOpencv::display(), vpCalibration::displayData(), vpCalibration::displayGrid(), vpRect::getBottomLeft(), vpRect::getBottomRight(), vpRect::getCenter(), vpDisplayWin32::getClick(), vpDisplayOpenCV::getClick(), vpDisplayWin32::getClickUp(), vpDisplayOpenCV::getClickUp(), vpDot2::getFreemanChain(), vpDisplayWin32::getPointerMotionEvent(), vpDisplayOpenCV::getPointerMotionEvent(), vpDisplayWin32::getPointerPosition(), vpDisplayOpenCV::getPointerPosition(), vpRect::getTopLeft(), vpRect::getTopRight(), vpKeyPoint::matchPointAndDetect(), vpDot::operator==(), vpHomography::projection(), vpCalibration::readData(), vpDot2::searchDotsInArea(), vpKltOpencv::suppressFeature(), and vpDot::track().
|
inline |
Sets the point coordinates in the frame (u,v).
u | : The desired value for the coordinate along the axes. |
v | : The desired value for the coordinate along the axes. |
Definition at line 247 of file vpImagePoint.h.
Referenced by vpMeEllipse::computePointOnEllipse(), vpDot2::defineDots(), vpImageDraw::drawEllipse(), vpTemplateTrackerZone::getCenter(), vpTemplateTrackerTriangle::getCorners(), vpMeEllipse::getParameters(), vpMeEllipse::initTracking(), and vpMeEllipse::leastSquareRobust().
|
inline |
Sets the point coordinate corresponding to the axes in the frame (u,v).
v | : The desired value for the coordinate along the axes. |
Definition at line 236 of file vpImagePoint.h.
Referenced by vpMeterPixelConversion::convertPoint(), vpKltOpencv::display(), vpCalibration::displayData(), vpRect::getBottomLeft(), vpRect::getBottomRight(), vpRect::getCenter(), vpDisplayWin32::getClick(), vpDisplayOpenCV::getClick(), vpDisplayWin32::getClickUp(), vpDisplayOpenCV::getClickUp(), vpDot2::getFreemanChain(), vpDisplayWin32::getPointerMotionEvent(), vpDisplayOpenCV::getPointerMotionEvent(), vpDisplayWin32::getPointerPosition(), vpDisplayOpenCV::getPointerPosition(), vpRect::getTopLeft(), vpRect::getTopRight(), vpKeyPoint::matchPointAndDetect(), vpDot::operator==(), vpHomography::projection(), vpCalibration::readData(), vpDot2::searchDotsInArea(), vpKltOpencv::suppressFeature(), and vpDot::track().
|
static |
Compute the distance
iP1 | : First point |
iP2 | : Second point |
Definition at line 456 of file vpImagePoint.cpp.
References get_i(), get_j(), and vpMath::sqr().
Referenced by vpMeNurbs::localReSample(), and vpMeNurbs::sample().
|
friend |
Returns true if ip1 and ip2 are different; otherwire returns true.
Definition at line 150 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with coordinates multiplied by a scale factor.
Definition at line 357 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the sum of and .
Definition at line 168 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset added to the two coordinates.
Definition at line 202 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset added to the two coordinates.
Definition at line 226 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset added to the two coordinates.
Definition at line 250 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the sum of and .
Definition at line 178 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the difference between and .
Definition at line 261 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset subtracted to the two coordinates.
Definition at line 285 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset subtracted to the two coordinates.
Definition at line 309 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset subtracted to the two coordinates.
Definition at line 333 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with coordinates divided by a scale factor.
Definition at line 381 of file vpImagePoint.cpp.
|
friend |
Writes the image point coordinates ip to the stream os, and returns a reference to the stream. Writes the first coordinate along the i axis and then the second one along the j axis. The coordinates are separated by a comma.
The following code
produces the output:
Image point with coordinates: 10, 11.1
Definition at line 417 of file vpImagePoint.cpp.
|
friend |
Returns true if ip1 and ip2 are equal; otherwire returns false.
Definition at line 131 of file vpImagePoint.cpp.