ViSP
2.9.0
|
#include <vpImagePoint.h>
Public Member Functions | |
vpImagePoint () | |
vpImagePoint (double ii, double jj) | |
vpImagePoint (const vpImagePoint &ip) | |
virtual | ~vpImagePoint () |
const vpImagePoint & | operator= (const vpImagePoint &ip) |
vpImagePoint & | operator+= (const vpImagePoint &ip) |
vpImagePoint & | operator-= (const vpImagePoint &ip) |
vpImagePoint & | operator/= (const double scale) |
vpImagePoint & | operator*= (const double scale) |
void | set_i (const double ii) |
void | set_j (const double jj) |
void | set_ij (const double ii, const double jj) |
double | get_i () const |
double | get_j () const |
void | set_u (const double u) |
void | set_v (const double v) |
void | set_uv (const double u, const double v) |
double | get_u () const |
double | get_v () const |
bool | inRectangle (const vpRect &rect) const |
vpImagePoint | projection (const vpHomography &aHb) |
Static Public Member Functions | |
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, const int offset) |
VISP_EXPORT vpImagePoint | operator+ (const vpImagePoint &ip1, const double offset) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, const vpImagePoint &ip2) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, const int offset) |
VISP_EXPORT vpImagePoint | operator- (const vpImagePoint &ip1, const double offset) |
VISP_EXPORT vpImagePoint | operator* (const vpImagePoint &ip1, const double scale) |
VISP_EXPORT vpImagePoint | operator/ (const vpImagePoint &ip1, const 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 92 of file vpImagePoint.h.
|
inline |
Default constructor that initialize the coordinates of the image point to zero.
Definition at line 99 of file vpImagePoint.h.
|
inline |
Default constructor that initialize the coordinates of the image thanks to the parameters and .
Definition at line 104 of file vpImagePoint.h.
|
inline |
Copy constructor.
Initialize the coordinates of the image point with ip.
ip | : An image point. |
Definition at line 112 of file vpImagePoint.h.
|
inlinevirtual |
Destructor.
Definition at line 114 of file vpImagePoint.h.
|
inlinestatic |
Compute the distance
iP1 | : First point |
iP2 | : Second point |
Definition at line 274 of file vpImagePoint.h.
References get_i(), get_j(), and vpMath::sqr().
Referenced by vpNurbs::globalCurveInterp(), vpMeNurbs::seekExtremities(), vpMeNurbs::track(), and vpMeNurbs::updateDelta().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (i,j).
Definition at line 194 of file vpImagePoint.h.
Referenced by vpKeyPointSurf::buildReference(), vpFernClassifier::buildReference(), vpNurbs::computeCurveDersPoint(), vpMeEllipse::display(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayCross(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayImageROI(), vpDisplayX::displayImageROI(), vpDisplayGTK::displayImageROI(), vpMbtKltPolygon::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpDisplay::displayRectangle(), distance(), vpMbtPolygon::getNbCornerInsideImage(), vpImage< vpRGBa >::getValue(), vpImage< unsigned char >::getValue(), vpImage< double >::getValue(), vpMbtDistanceLine::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMeEllipse::initTracking(), vpMeLine::initTracking(), vpDot2::initTracking(), vpDot::initTracking(), vpImage< Type >::insert(), vpTriangle::inTriangle(), vpTemplateTrackerTriangle::inTriangle(), vpPolygon::isInside(), vpPlanarObjectDetector::matchPoint(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), vpWireFrameSimulator::navigation(), vpImage< unsigned char >::operator()(), vpMeTracker::outOfImage(), vpNurbs::removeCurveKnot(), vpMeNurbs::seekExtremitiesCanny(), sqrDistance(), vpMbtDistanceLine::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (i,j).
Definition at line 205 of file vpImagePoint.h.
Referenced by vpKeyPointSurf::buildReference(), vpFernClassifier::buildReference(), vpNurbs::computeCurveDersPoint(), vpPlanarObjectDetector::computeRoi(), vpMeEllipse::display(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplayOpenCV::displayCross(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplayOpenCV::displayImageROI(), vpDisplayX::displayImageROI(), vpDisplayGTK::displayImageROI(), vpMbtKltPolygon::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpDisplay::displayRectangle(), distance(), vpMbtPolygon::getNbCornerInsideImage(), vpImage< vpRGBa >::getValue(), vpImage< unsigned char >::getValue(), vpImage< double >::getValue(), vpMbtDistanceLine::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMeEllipse::initTracking(), vpMeLine::initTracking(), vpDot2::initTracking(), vpDot::initTracking(), vpImage< Type >::insert(), vpTriangle::inTriangle(), vpTemplateTrackerTriangle::inTriangle(), vpPolygon::isInside(), vpPlanarObjectDetector::matchPoint(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), vpWireFrameSimulator::navigation(), vpImage< unsigned char >::operator()(), vpMeTracker::outOfImage(), vpNurbs::removeCurveKnot(), vpMeNurbs::seekExtremitiesCanny(), sqrDistance(), vpMbtDistanceLine::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Gets the point coordinate corresponding to the axes in the frame (u,v).
Definition at line 252 of file vpImagePoint.h.
Referenced by vpPlanarObjectDetector::buildReference(), vpFernClassifier::buildReference(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpPixelMeterConversion::convertPointWithDistortion(), vpPixelMeterConversion::convertPointWithoutDistortion(), vpDot2::defineDots(), vpDisplayOpenCV::displayCharString(), vpDisplayX::displayCharString(), vpDisplayGTK::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayX::displayCircle(), vpDisplayGTK::displayCircle(), vpDisplayOpenCV::displayDotLine(), vpDisplayX::displayDotLine(), vpDisplayGTK::displayDotLine(), vpDisplayX::displayImageROI(), vpDisplayGTK::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayX::displayLine(), vpDisplayGTK::displayLine(), vpDisplayX::displayPoint(), vpDisplayGTK::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpDisplayX::displayRectangle(), vpDisplayGTK::displayRectangle(), vpDisplayWin32::flushDisplayROI(), vpDisplayX::flushDisplayROI(), vpDot2::getDistance(), vpTemplateTrackerTriangle::init(), vpHomography::project(), vpDot2::searchDotsInArea(), vpRect::setBottomRight(), vpRect::setTopLeft(), vpDot::track(), vpDot2::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 263 of file vpImagePoint.h.
Referenced by vpPlanarObjectDetector::buildReference(), vpFernClassifier::buildReference(), vpCalibration::computeStdDeviation(), vpCalibration::computeStdDeviation_dist(), vpPixelMeterConversion::convertPointWithDistortion(), vpPixelMeterConversion::convertPointWithoutDistortion(), vpDot2::defineDots(), vpDisplayOpenCV::displayCharString(), vpDisplayX::displayCharString(), vpDisplayGTK::displayCharString(), vpDisplayOpenCV::displayCircle(), vpDisplayX::displayCircle(), vpDisplayGTK::displayCircle(), vpDisplayOpenCV::displayDotLine(), vpDisplayX::displayDotLine(), vpDisplayGTK::displayDotLine(), vpDisplayX::displayImageROI(), vpDisplayGTK::displayImageROI(), vpDisplayOpenCV::displayLine(), vpDisplayX::displayLine(), vpDisplayGTK::displayLine(), vpDisplayX::displayPoint(), vpDisplayGTK::displayPoint(), vpDisplayOpenCV::displayRectangle(), vpDisplayX::displayRectangle(), vpDisplayGTK::displayRectangle(), vpDisplayWin32::flushDisplayROI(), vpDisplayX::flushDisplayROI(), vpDot2::getDistance(), vpTemplateTrackerTriangle::init(), vpHomography::project(), vpDot2::searchDotsInArea(), vpRect::setBottomRight(), vpRect::setTopLeft(), vpDot::track(), vpDot2::track(), vpRect::vpRect(), vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(), and vpCalibration::writeData().
bool vpImagePoint::inRectangle | ( | const vpRect & | rect | ) | const |
Check if an image point belongs to a rectangle.
rect | : the rectangle. |
Definition at line 58 of file vpImagePoint.cpp.
References vpRect::getBottom(), vpRect::getLeft(), vpRect::getRight(), and vpRect::getTop().
Referenced by vpPlot::navigate().
|
inline |
Operator *=.
Definition at line 143 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 117 of file vpImagePoint.cpp.
|
inline |
Operator -=.
Definition at line 133 of file vpImagePoint.h.
vpImagePoint & vpImagePoint::operator/= | ( | const double | scale | ) |
Operator /=.
This operator can be used to compute the center of gravity of a set of image points.
Definition at line 149 of file vpImagePoint.cpp.
|
inline |
Copy operator.
Definition at line 121 of file vpImagePoint.h.
vpImagePoint vpImagePoint::projection | ( | const vpHomography & | aHb | ) |
Project the current image point (in frame b) into the frame a using the homography aHb.
aHb | : Homography defining the relation between frame a and frame b. |
Definition at line 74 of file vpImagePoint.cpp.
|
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 158 of file vpImagePoint.h.
Referenced by vpKeyPointSurf::buildReference(), vpFernClassifier::buildReference(), vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpBSpline::computeCurvePoint(), vpMeLine::computeRhoTheta(), vpMeLine::display(), vpMeEllipse::display(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplay::displayArrow(), vpDisplay::displayCharString(), vpDisplay::displayCircle(), vpDisplayOpenCV::displayCross(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplay::displayCross(), vpDisplay::displayDotLine(), vpDisplay::displayLine(), vpDisplay::displayPoint(), vpMbtKltPolygon::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpDisplay::displayRectangle(), vpMeLine::getExtremities(), vpMeSite::getQueryList(), vpImage< unsigned char >::getValue(), vpImage< vpRGBa >::getValue(), vpImage< double >::getValue(), vpMeTracker::initTracking(), vpMeEllipse::initTracking(), vpMeLine::intersection(), vpPolygon::isInside(), vpPlanarObjectDetector::matchPoint(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), projection(), vpNurbs::refineKnotVectCurve(), vpNurbs::removeCurveKnot(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpImageSimulator::setCameraPosition(), vpMeTracker::track(), vpMeSite::track(), vpPolygon::updateCenter(), and vpMeEllipse::vpMeEllipse().
|
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 180 of file vpImagePoint.h.
Referenced by vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::curveKnotIns(), vpMbtDistanceCylinder::display(), vpFeatureDisplay::displayLine(), vpImageSimulator::getImage(), vpBasicKeyPoint::getMatchedPoints(), vpBasicKeyPoint::getReferencePoint(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMbtDistanceCylinder::initMovingEdge(), vpMeNurbs::seekExtremities(), and vpMbtDistanceCylinder::updateMovingEdge().
|
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 169 of file vpImagePoint.h.
Referenced by vpKeyPointSurf::buildReference(), vpFernClassifier::buildReference(), vpBSpline::computeCurveDers(), vpNurbs::computeCurveDersPoint(), vpNurbs::computeCurvePoint(), vpBSpline::computeCurvePoint(), vpMeLine::computeRhoTheta(), vpMeLine::display(), vpMeEllipse::display(), vpDisplayOpenCV::displayArrow(), vpDisplayX::displayArrow(), vpDisplayGTK::displayArrow(), vpDisplay::displayArrow(), vpDisplay::displayCharString(), vpDisplay::displayCircle(), vpDisplayOpenCV::displayCross(), vpDisplayX::displayCross(), vpDisplayGTK::displayCross(), vpDisplay::displayCross(), vpDisplay::displayDotLine(), vpDisplay::displayLine(), vpDisplay::displayPoint(), vpMbtKltPolygon::displayPrimitive(), vpDisplayWin32::displayRectangle(), vpDisplay::displayRectangle(), vpMeLine::getExtremities(), vpMeSite::getQueryList(), vpImage< double >::getValue(), vpImage< vpRGBa >::getValue(), vpImage< unsigned char >::getValue(), vpMeTracker::initTracking(), vpMeEllipse::initTracking(), vpMeLine::intersection(), vpPolygon::isInside(), vpPlanarObjectDetector::matchPoint(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), projection(), vpNurbs::removeCurveKnot(), vpMeLine::sample(), vpMeLine::seekExtremities(), vpImageSimulator::setCameraPosition(), vpMeTracker::track(), vpMeSite::track(), vpPolygon::updateCenter(), and vpMeEllipse::vpMeEllipse().
|
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 216 of file vpImagePoint.h.
Referenced by vpMeterPixelConversion::convertPointWithDistortion(), vpMeterPixelConversion::convertPointWithoutDistortion(), vpKltOpencv::display(), vpFeatureDisplay::displayEllipse(), vpCalibration::displayGrid(), vpDisplay::displayRectangle(), vpRect::getBottomRight(), vpRect::getCenter(), vpDisplayWin32::getClick(), vpDisplayOpenCV::getClick(), vpDisplayX::getClick(), vpDisplayGTK::getClick(), vpDisplayWin32::getClickUp(), vpDisplayOpenCV::getClickUp(), vpDisplayX::getClickUp(), vpDisplayGTK::getClickUp(), vpDisplayWin32::getPointerMotionEvent(), vpDisplayX::getPointerMotionEvent(), vpDisplayOpenCV::getPointerMotionEvent(), vpDisplayGTK::getPointerMotionEvent(), vpDisplayWin32::getPointerPosition(), vpDisplayX::getPointerPosition(), vpDisplayOpenCV::getPointerPosition(), vpDisplayGTK::getPointerPosition(), vpRect::getTopLeft(), vpCalibration::readData(), vpDot2::searchDotsInArea(), 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 238 of file vpImagePoint.h.
Referenced by vpDot2::defineDots(), vpTemplateTrackerZone::getCenter(), vpTemplateTrackerTriangle::getCorners(), and vpPlanarObjectDetector::getDetectedCorners().
|
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 227 of file vpImagePoint.h.
Referenced by vpMeterPixelConversion::convertPointWithDistortion(), vpMeterPixelConversion::convertPointWithoutDistortion(), vpKltOpencv::display(), vpFeatureDisplay::displayEllipse(), vpDisplay::displayRectangle(), vpRect::getBottomRight(), vpRect::getCenter(), vpDisplayWin32::getClick(), vpDisplayOpenCV::getClick(), vpDisplayX::getClick(), vpDisplayGTK::getClick(), vpDisplayWin32::getClickUp(), vpDisplayOpenCV::getClickUp(), vpDisplayX::getClickUp(), vpDisplayGTK::getClickUp(), vpDisplayWin32::getPointerMotionEvent(), vpDisplayX::getPointerMotionEvent(), vpDisplayOpenCV::getPointerMotionEvent(), vpDisplayGTK::getPointerMotionEvent(), vpDisplayWin32::getPointerPosition(), vpDisplayX::getPointerPosition(), vpDisplayOpenCV::getPointerPosition(), vpDisplayGTK::getPointerPosition(), vpRect::getTopLeft(), vpCalibration::readData(), vpDot2::searchDotsInArea(), and vpDot::track().
|
inlinestatic |
Compute the distance
iP1 | : First point |
iP2 | : Second point |
Definition at line 286 of file vpImagePoint.h.
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 183 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with coordinates multiplied by a scale factor.
Definition at line 340 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the sum of and .
Definition at line 204 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset added to the two coordinates.
Definition at line 237 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset added to the two coordinates.
Definition at line 260 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the sum of and .
Definition at line 214 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint wich is the difference between and .
Definition at line 271 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset substracted to the two coordinates.
Definition at line 294 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with an offset substracted to the two coordinates.
Definition at line 317 of file vpImagePoint.cpp.
|
friend |
Returns a vpImagePoint with coordinates divided by a scale factor.
Definition at line 363 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
The previous sample code produces the output:
Image point with coordinates: 10, 11.1
Definition at line 399 of file vpImagePoint.cpp.
|
friend |
Returns true if ip1 and ip2 are equal; otherwire returns false.
Definition at line 161 of file vpImagePoint.cpp.