ViSP  2.9.0

#include <vpPoint.h>

+ Inheritance diagram for vpPoint:

Public Types

enum  vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection }
 

Public Member Functions

 vpPoint ()
 
virtual ~vpPoint ()
 
void changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &_cP)
 
void changeFrame (const vpHomogeneousMatrix &cMo)
 
void display (const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
 
void display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
 
void display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1)
 
vpPointduplicate () const
 
double get_X () const
 
double get_Y () const
 
double get_Z () const
 
double get_W () const
 
double get_oX () const
 
double get_oY () const
 
double get_oZ () const
 
double get_oW () const
 
double get_x () const
 
double get_y () const
 
double get_w () const
 
void getWorldCoordinates (double &ox, double &oy, double &oz)
 
void getWorldCoordinates (vpColVector &_oP)
 
vpColVector getWorldCoordinates (void)
 
void init ()
 
vpPointoperator= (const vpPoint &vpp)
 
void projection (const vpColVector &_cP, vpColVector &_p)
 
void projection ()
 
void set_X (const double X)
 
void set_Y (const double Y)
 
void set_Z (const double Z)
 
void set_W (const double W)
 
void set_oX (const double X)
 
void set_oY (const double Y)
 
void set_oZ (const double Z)
 
void set_oW (const double W)
 
void set_x (const double x)
 
void set_y (const double y)
 
void set_w (const double w)
 
void setWorldCoordinates (const double ox, const double oy, const double oz)
 
void setWorldCoordinates (const vpColVector &_oP)
 
void project ()
 
void project (const vpHomogeneousMatrix &cMo)
 
void track (const vpHomogeneousMatrix &cMo)
 
virtual void print () const
 
void setDeallocate (vpForwardProjectionDeallocatorType d)
 
vpForwardProjectionDeallocatorType getDeallocate ()
 

Public Attributes

vpColVector oP
 
vpColVector p
 
vpColVector cP
 
bool cPAvailable
 

Friends

VISP_EXPORT std::ostream & operator<< (std::ostream &os, vpPoint &vpp)
 

Detailed Description

Class that defines what is a point.

Examples:
AROgre.cpp, AROgreBasic.cpp, homographyHartleyDLT2DObject.cpp, homographyHLM2DObject.cpp, homographyHLM3DObject.cpp, manGeometricFeatures.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, poseVirtualVS.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, testFeatureSegment.cpp, testFindMatch.cpp, testPose.cpp, testPoseFeatures.cpp, testPoseRansac.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, and tutorial-simu-pioneer.cpp.

Definition at line 65 of file vpPoint.h.

Member Enumeration Documentation

Used for memory issue especially in the vpServo class.

Enumerator
user 
vpDisplayForwardProjection 

Definition at line 219 of file vpForwardProjection.h.

Constructor & Destructor Documentation

vpPoint::vpPoint ( )

Basic constructor.

Definition at line 67 of file vpPoint.cpp.

References init().

Referenced by duplicate().

virtual vpPoint::~vpPoint ( )
inlinevirtual

Destructor.

Definition at line 72 of file vpPoint.h.

Member Function Documentation

void vpPoint::changeFrame ( const vpHomogeneousMatrix cMo)
inlinevirtual

From the 3D coordinates of the point in the object frame set using for example setWorldCoordinates() or set_oX(), set_oY(), set_oZ(), compute the 3D coordinates of the point in the camera frame.

Parameters
cMo: Transformation from camera to object frame.

Implements vpForwardProjection.

Definition at line 87 of file vpPoint.h.

void vpPoint::display ( const vpImage< unsigned char > &  I,
const vpCameraParameters cam,
const vpColor color = vpColor::green,
const unsigned int  thickness = 1 
)
virtual

Display the point in the image.

Implements vpForwardProjection.

Examples:
manGeometricFeatures.cpp, and servoAfma6Points2DCamVelocityEyeToHand.cpp.

Definition at line 309 of file vpPoint.cpp.

References vpFeatureDisplay::displayPoint(), and vpTracker::p.

void vpPoint::display ( const vpImage< unsigned char > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const vpColor color = vpColor::green,
const unsigned int  thickness = 1 
)
virtual

Display the point in the image.

Implements vpForwardProjection.

Definition at line 252 of file vpPoint.cpp.

References changeFrame(), vpFeatureDisplay::displayPoint(), and projection().

void vpPoint::display ( const vpImage< vpRGBa > &  I,
const vpHomogeneousMatrix cMo,
const vpCameraParameters cam,
const vpColor color = vpColor::green,
const unsigned int  thickness = 1 
)

Display the point in the image.

Definition at line 273 of file vpPoint.cpp.

References changeFrame(), vpFeatureDisplay::displayPoint(), and projection().

vpPoint * vpPoint::duplicate ( ) const
virtual

For memory issue (used by the vpServo class only).

Implements vpForwardProjection.

Definition at line 242 of file vpPoint.cpp.

References vpPoint().

double vpPoint::get_oW ( ) const
inline

Get the point W coordinate in the object frame.

Definition at line 133 of file vpPoint.h.

double vpPoint::get_W ( ) const
inline

Get the point W coordinate in the camera frame.

Definition at line 124 of file vpPoint.h.

Referenced by vpPlane::projectionPointOnPlan().

double vpPoint::get_w ( ) const
inline

Get the point w coordinate in the image plane.

Examples:
homographyHartleyDLT2DObject.cpp, homographyHLM2DObject.cpp, and homographyHLM3DObject.cpp.

Definition at line 140 of file vpPoint.h.

double vpPoint::get_X ( ) const
inline
double vpPoint::get_Y ( ) const
inline
vpForwardProjectionDeallocatorType vpForwardProjection::getDeallocate ( )
inlineinherited

Definition at line 231 of file vpForwardProjection.h.

void vpPoint::getWorldCoordinates ( double &  ox,
double &  oy,
double &  oz 
)

Get the point world coordinates. We mean here the coordinates of the point in the object frame.

Definition at line 97 of file vpPoint.cpp.

References vpForwardProjection::oP.

void vpPoint::getWorldCoordinates ( vpColVector _oP)

Get the point world coordinates. We mean here the coordinates of the point in the object frame.

Definition at line 108 of file vpPoint.cpp.

References vpForwardProjection::oP.

vpColVector vpPoint::getWorldCoordinates ( void  )

Definition at line 118 of file vpPoint.cpp.

References vpForwardProjection::oP.

void vpPoint::init ( void  )
virtual

Basic construction.

Implements vpForwardProjection.

Definition at line 57 of file vpPoint.cpp.

References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, vpColVector::resize(), and set_Z().

Referenced by vpPoint().

vpPoint & vpPoint::operator= ( const vpPoint vpp)
void vpForwardProjection::print ( ) const
virtualinherited

Print to stdout the feature parameters in:

  • the object frame
  • the camera frame
  • the image plane.
Examples:
servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, and testPoseRansac.cpp.

Definition at line 63 of file vpForwardProjection.cpp.

References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::t().

void vpForwardProjection::project ( const vpHomogeneousMatrix cMo)
inherited

Compute the feature parameters in the camera frame (vpTracker::cP) and than compute the projection of these parameters in the image plane (vpTracker::p).

Warning
The feature parameters in the object frame (vpForwardProjection:oP) need to be set prior the use of this method. To initialize these parameters see setWorldCoordinates().
Parameters
cMo: The homogeneous matrix corresponding to the pose between the camera frame and the object frame.

Definition at line 99 of file vpForwardProjection.cpp.

References vpForwardProjection::changeFrame(), vpForwardProjection::projection(), and vpERROR_TRACE.

void vpPoint::projection ( const vpColVector _cP,
vpColVector _p 
)
virtual

Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP, output : the 2D coordinates _p.

Compute the perspective projection of a point _cP.

Parameters
_cP: Three dimension vector that corresponds to the coordinates of the point in the camera frame.
_p: Coordinates of the point in the image plane obtained by perspective projection.

Implements vpForwardProjection.

Examples:
servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, and servoViper850FourPointsKinect.cpp.

Definition at line 132 of file vpPoint.cpp.

References vpColVector::resize().

Referenced by vpMbtPolygon::changeFrame(), vpPose::computeResidual(), vpMbtPolygon::computeRoiClipped(), vpMbtDistanceCylinder::display(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().

void vpPoint::projection ( )
inlinevirtual

Perspective projection of the point.

Projection onto the //image plane of the point. Update the object attribute p (2D //homogeneous coordinates) according to object attribute cP (current //3D coordinates in the camera frame).

Implements vpForwardProjection.

Definition at line 167 of file vpPoint.h.

Referenced by display().

void vpPoint::set_oW ( const double  W)
inline

Set the point W coordinate in the object frame.

Definition at line 191 of file vpPoint.h.

void vpPoint::set_oX ( const double  X)
inline

Set the point X coordinate in the object frame.

Definition at line 185 of file vpPoint.h.

Referenced by vpPose::poseDementhonNonPlan(), and vpPose::poseDementhonPlan().

void vpPoint::set_oY ( const double  Y)
inline

Set the point Y coordinate in the object frame.

Definition at line 187 of file vpPoint.h.

Referenced by vpPose::poseDementhonNonPlan(), and vpPose::poseDementhonPlan().

void vpPoint::set_oZ ( const double  Z)
inline

Set the point Z coordinate in the object frame.

Definition at line 189 of file vpPoint.h.

Referenced by vpPose::poseDementhonNonPlan(), and vpPose::poseDementhonPlan().

void vpPoint::set_W ( const double  W)
inline

Set the point W coordinate in the camera frame.

Definition at line 182 of file vpPoint.h.

Referenced by vpPlane::projectionPointOnPlan().

void vpPoint::set_w ( const double  w)
inline

Set the point w coordinate in the image plane.

Definition at line 198 of file vpPoint.h.

void vpPoint::set_X ( const double  X)
inline

Set the point X coordinate in the camera frame.

Definition at line 176 of file vpPoint.h.

Referenced by vpMbtPolygon::isVisible(), and vpPlane::projectionPointOnPlan().

void vpPoint::set_Y ( const double  Y)
inline

Set the point Y coordinate in the camera frame.

Definition at line 178 of file vpPoint.h.

Referenced by vpMbtPolygon::isVisible(), and vpPlane::projectionPointOnPlan().

void vpPoint::set_Z ( const double  Z)
inline

Set the point Z coordinate in the camera frame.

Definition at line 180 of file vpPoint.h.

Referenced by init(), vpMbtPolygon::isVisible(), and vpPlane::projectionPointOnPlan().

void vpForwardProjection::setDeallocate ( vpForwardProjectionDeallocatorType  d)
inlineinherited

Definition at line 230 of file vpForwardProjection.h.

void vpPoint::setWorldCoordinates ( const double  ox,
const double  oy,
const double  oz 
)

Set the point world coordinates. We mean here the coordinates of the point in the object frame.

set the point world coordinates

Examples:
AROgre.cpp, AROgreBasic.cpp, homographyHartleyDLT2DObject.cpp, homographyHLM2DObject.cpp, homographyHLM3DObject.cpp, manGeometricFeatures.cpp, manServo4PointsDisplay.cpp, manServoMomentsSimple.cpp, manSimu4Dots.cpp, manSimu4Points.cpp, poseVirtualVS.cpp, servoAfma62DhalfCamVelocity.cpp, servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp, servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp, servoAfma6Points2DCamVelocityEyeToHand.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoPioneerPanSegment3D.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp, servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp, servoViper850FourPointsKinect.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, testFeatureSegment.cpp, testPose.cpp, testPoseFeatures.cpp, testPoseRansac.cpp, testRobotAfma6Pose.cpp, testRobotViper850Pose.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, and tutorial-simu-pioneer.cpp.

Definition at line 74 of file vpPoint.cpp.

References vpForwardProjection::oP.

Referenced by vpMbtDistanceLine::buildFrom(), vpPose::computeResidual(), vpPose::computeTransformation(), vpDisplay::displayCamera(), vpDisplay::displayFrame(), vpMbTracker::extractCylinders(), vpMbTracker::extractFaces(), vpMbTracker::extractLines(), vpPose::findMatch(), vpMbTracker::getGravityCenter(), vpProjectionDisplay::init(), vpMbTracker::initClick(), vpMbTracker::initFromPoints(), vpMbTracker::loadCAOModel(), vpPose::poseFromRectangle(), vpWireFrameSimulator::projectCameraTrajectory(), vpPose::ransac(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

void vpPoint::setWorldCoordinates ( const vpColVector _oP)
virtual

Set the point world coordinates. We mean here the coordinates of the point in the object frame.

Implements vpForwardProjection.

Definition at line 86 of file vpPoint.cpp.

References vpForwardProjection::oP.

void vpForwardProjection::track ( const vpHomogeneousMatrix cMo)
inherited

Track the feature parameters in the camera frame (vpTracker::cP) and than compute the projection of these parameters in the image plane (vpTracker::p).

This method is similar to project(const vpHomogeneousMatrix &).

Warning
The feature parameters in the object frame (vpForwardProjection:oP) need to be set prior the use of this method. To initialize these parameters see setWorldCoordinates().
Parameters
cMo: The homogeneous matrix corresponding to the pose between the camera frame and the object frame.
Examples:
manServoMomentsSimple.cpp, servoMomentPoints.cpp, servoMomentPolygon.cpp, servoSimu4Points.cpp, servoSimuAfma6FourPoints2DCamVelocity.cpp, servoSimuCircle2DCamVelocity.cpp, servoSimuCircle2DCamVelocityDisplay.cpp, servoSimuFourPoints2DCamVelocity.cpp, servoSimuFourPoints2DCamVelocityDisplay.cpp, servoSimuFourPoints2DPolarCamVelocityDisplay.cpp, servoSimuLine2DCamVelocityDisplay.cpp, servoSimuPoint2DCamVelocity1.cpp, servoSimuPoint2DCamVelocity2.cpp, servoSimuPoint2DCamVelocity3.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuPoint3DCamVelocity.cpp, servoSimuSphere.cpp, servoSimuSphere2DCamVelocity.cpp, servoSimuSphere2DCamVelocitySecondaryTask.cpp, servoSimuSquareLine2DCamVelocityDisplay.cpp, servoSimuViper850FourPoints2DCamVelocity.cpp, simulateCircle2DCamVelocity.cpp, simulateFourPoints2DCartesianCamVelocity.cpp, simulateFourPoints2DPolarCamVelocity.cpp, tutorial-ibvs-4pts-ogre.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter-gain-adaptive.cpp, tutorial-ibvs-4pts-plotter.cpp, tutorial-ibvs-4pts.cpp, tutorial-simu-pioneer-continuous-gain-adaptive.cpp, tutorial-simu-pioneer-continuous-gain-constant.cpp, tutorial-simu-pioneer-pan.cpp, and tutorial-simu-pioneer.cpp.

Definition at line 130 of file vpForwardProjection.cpp.

References vpForwardProjection::project(), and vpERROR_TRACE.

Referenced by vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), vpDisplay::displayFrame(), vpPose::poseRansac(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpWireFrameSimulator::projectCameraTrajectory(), vpImageSimulator::setCameraPosition(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  os,
vpPoint vpp 
)
friend

Definition at line 289 of file vpPoint.cpp.

Member Data Documentation

bool vpTracker::cPAvailable
inherited

Flag used to indicate if the feature parameters cP expressed in the camera frame are available.

Definition at line 88 of file vpTracker.h.

Referenced by vpTracker::init(), vpTracker::operator=(), and operator=().