![]() |
Visual Servoing Platform version 3.7.0
|
#include <vpSphere.h>
Public Types | |
| enum | vpForwardProjectionDeallocatorType { user , vpDisplayForwardProjection } |
Public Member Functions | |
| vpSphere () | |
| VP_EXPLICIT | vpSphere (const vpColVector &oP) |
| vpSphere (double oX, double oY, double oZ, double R) | |
| void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) const VP_OVERRIDE |
| void | changeFrame (const vpHomogeneousMatrix &cMo) VP_OVERRIDE |
| void | display (const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) VP_OVERRIDE |
| void | display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) VP_OVERRIDE |
| void | display (const vpImage< vpRGBa > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| vpSphere * | duplicate () const VP_OVERRIDE |
| double | get_x () const |
| double | get_y () const |
| double | get_n20 () const |
| double | get_n11 () const |
| double | get_n02 () const |
| double | getX () const |
| double | getY () const |
| double | getZ () const |
| double | getR () const |
| void | projection () VP_OVERRIDE |
| void | projection (const vpColVector &cP, vpColVector &p) const VP_OVERRIDE |
| void | setWorldCoordinates (const vpColVector &oP) VP_OVERRIDE |
| void | setWorldCoordinates (double oX, double oY, double oZ, double R) |
Public Member Functions Inherited from vpForwardProjection | |
| vpColVector | get_oP () const |
| vpForwardProjectionDeallocatorType | getDeallocate () |
| virtual void | print () const |
| void | project () |
| void | project (const vpHomogeneousMatrix &cMo) |
| void | setDeallocate (vpForwardProjectionDeallocatorType d) |
| void | track (const vpHomogeneousMatrix &cMo) |
Public Member Functions Inherited from vpTracker | |
| vpColVector | get_p () const |
| vpColVector | get_cP () const |
Public Attributes | |
Public Attributes Inherited from vpForwardProjection | |
| vpColVector | oP |
Public Attributes Inherited from vpTracker | |
| vpColVector | p |
| vpColVector | cP |
| bool | cPAvailable |
Deprecated functions | |
| VP_DEPRECATED double | get_mu20 () const |
| VP_DEPRECATED double | get_mu11 () const |
| VP_DEPRECATED double | get_mu02 () const |
| void | init () VP_OVERRIDE |
Class that defines a 3D sphere in the object frame and allows forward projection of a 3D sphere in the camera frame and in the 2D image plane by perspective projection. All the parameters must be set in meter.
A sphere has the followings parameters:
Definition at line 79 of file vpSphere.h.
|
inherited |
Used for memory issue especially in the vpServo class.
| Enumerator | |
|---|---|
| user | |
| vpDisplayForwardProjection | |
Definition at line 70 of file vpForwardProjection.h.
| vpSphere::vpSphere | ( | ) |
Default constructor.
Definition at line 86 of file vpSphere.cpp.
References init().
Referenced by duplicate().
| vpSphere::vpSphere | ( | const vpColVector & | oP_ | ) |
Create a sphere from a 4-dim vector that contains 3D coordinates of its center and its radius. The 3D coordinates of the center are defined in the sphere frame.
| oP_ | : 4-dim vector that contains [oX oY oZ R]^T where oX, oY, oZ are the 3D coordinates of the sphere center in [m] expressed in the sphere frame, and R is the sphere radius in [m]. |
Definition at line 96 of file vpSphere.cpp.
References init(), and setWorldCoordinates().
| vpSphere::vpSphere | ( | double | oX, |
| double | oY, | ||
| double | oZ, | ||
| double | R ) |
Create a sphere from the 3D coordinates of its center and its radius. The 3D coordinates of the center are defined in the sphere frame.
| oX | : 3D coordinate of the sphere center along X axis in [m]. |
| oY | : 3D coordinate of the sphere center along X axis in [m]. |
| oZ | : 3D coordinate of the sphere center along X axis in [m]. |
| R | : Sphere radius in [m]. |
Definition at line 111 of file vpSphere.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Perspective projection of the sphere. Internal sphere parameters are modified in cP.
| cMo | : Homogeneous transformation from camera frame to object frame. |
Implements vpForwardProjection.
Definition at line 211 of file vpSphere.cpp.
References changeFrame(), and vpTracker::cP.
|
virtual |
Perspective projection of the sphere. This method doesn't modify internal sphere parameters cP.
| cMo | : Homogeneous transformation from camera frame to sphere frame. |
| cP_ | : Parameters of the sphere in the camera frame (cX, cY, cZ, R). |
Implements vpForwardProjection.
Definition at line 220 of file vpSphere.cpp.
References vpForwardProjection::oP, and vpColVector::resize().
Referenced by changeFrame(), display(), and display().
|
virtual |
Display the projection of a 3D sphere in image I.
| I | : Image used as background. |
| cam | : Camera parameters. |
| color | : Color used to draw the sphere. |
| thickness | : Thickness used to draw the sphere. |
Implements vpForwardProjection.
Definition at line 308 of file vpSphere.cpp.
References vpFeatureDisplay::displayEllipse(), and vpTracker::p.
|
virtual |
Display the projection of a 3D sphere in image I. This method is non destructive wrt. cP and p internal sphere parameters.
| I | : Image used as background. |
| cMo | : Homogeneous transformation from camera frame to object frame. The sphere is considered as viewed from this camera position. |
| cam | : Camera parameters. |
| color | : Color used to draw the sphere. |
| thickness | : Thickness used to draw the sphere. |
Implements vpForwardProjection.
Definition at line 261 of file vpSphere.cpp.
References changeFrame(), vpFeatureDisplay::displayEllipse(), and projection().
| void vpSphere::display | ( | const vpImage< vpRGBa > & | I, |
| const vpCameraParameters & | cam, | ||
| const vpColor & | color = vpColor::green, | ||
| unsigned int | thickness = 1 ) |
Display the projection of a 3D sphere in image I.
| I | : Image used as background. |
| cam | : Camera parameters. |
| color | : Color used to draw the sphere. |
| thickness | : Thickness used to draw the sphere. |
Definition at line 327 of file vpSphere.cpp.
References vpFeatureDisplay::displayEllipse(), and vpTracker::p.
| void vpSphere::display | ( | const vpImage< vpRGBa > & | I, |
| const vpHomogeneousMatrix & | cMo, | ||
| const vpCameraParameters & | cam, | ||
| const vpColor & | color = vpColor::green, | ||
| unsigned int | thickness = 1 ) |
Display the projection of a 3D sphere in image I. This method is non destructive wrt. cP and p internal sphere parameters.
| I | : Image used as background. |
| cMo | : Homogeneous transformation from camera frame to object frame. The sphere is considered as viewed from this camera position. |
| cam | : Camera parameters. |
| color | : Color used to draw the sphere. |
| thickness | : Thickness used to draw the sphere. |
Definition at line 286 of file vpSphere.cpp.
References changeFrame(), vpFeatureDisplay::displayEllipse(), and projection().
|
virtual |
For memory issue (used by the vpServo class only).
Implements vpForwardProjection.
Definition at line 244 of file vpSphere.cpp.
References vpSphere().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 95 of file vpTracker.h.
References cP.
|
inline |
Definition at line 146 of file vpSphere.h.
References vpTracker::p.
|
inline |
Definition at line 139 of file vpSphere.h.
References vpTracker::p.
|
inline |
Definition at line 132 of file vpSphere.h.
References vpTracker::p.
|
inline |
|
inline |
|
inline |
|
inlineinherited |
Return object parameters expressed in the 3D object frame.
Definition at line 155 of file vpForwardProjection.h.
References oP.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 93 of file vpTracker.h.
References p.
|
inline |
|
inline |
|
inlineinherited |
Definition at line 157 of file vpForwardProjection.h.
|
inline |
|
inline |
Definition at line 108 of file vpSphere.h.
References vpTracker::cP.
|
inline |
Definition at line 109 of file vpSphere.h.
References vpTracker::cP.
|
inline |
Definition at line 110 of file vpSphere.h.
References vpTracker::cP.
|
protectedvirtual |
Initialize internal sphere parameters.
Implements vpForwardProjection.
Definition at line 41 of file vpSphere.cpp.
References vpTracker::cP, vpForwardProjection::oP, and vpTracker::p.
Referenced by vpSphere(), vpSphere(), and vpSphere().
|
virtualinherited |
Print to stdout the feature parameters in:
Definition at line 48 of file vpForwardProjection.cpp.
References vpTracker::cP, oP, and vpTracker::p.
|
inherited |
Compute the feature parameters in the image plane (vpTracker::p) from the parameters in the camera frame (vpTracker::cP).
Definition at line 63 of file vpForwardProjection.cpp.
References vpTracker::cP, vpTracker::p, and projection().
Referenced by vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpKeyPoint::matchPointAndDetect(), vpMbtFaceDepthNormal::planeIsInvalid(), projection(), and track().
|
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).
| cMo | : The homogeneous matrix corresponding to the pose between the camera frame and the object frame. |
Definition at line 79 of file vpForwardProjection.cpp.
References changeFrame(), and projection().
|
virtual |
Perspective projection of the sphere. This method updates internal parameters (cP and p).
See vpSphere::projection(const vpColVector &, vpColVector &) const for a more detailed description of the parameters.
Implements vpForwardProjection.
Definition at line 124 of file vpSphere.cpp.
References vpTracker::cP, vpTracker::p, and projection().
Referenced by display(), display(), and projection().
|
virtual |
Perspective projection of the sphere. Internal parameters (cP and p) are not modified.
| [in] | cP_ | : 4-dim vector corresponding to the sphere parameters in the camera frame. |
| [out] | p_ | : 5-dim vector corresponding to the sphere parameters in the image plane. It contains the following parameters: x, y, n20, n11, n02 where:
|
Implements vpForwardProjection.
Definition at line 140 of file vpSphere.cpp.
References vpException::fatalError, vpColVector::resize(), and vpMath::sqr().
|
inlineinherited |
Definition at line 185 of file vpForwardProjection.h.
|
virtual |
Set sphere 3D parameters from a 4-dim vector that contains 3D coordinates of its center and its radius. The 3D coordinates of the center are defined in the sphere frame.
| oP_ | : 4-dim vector that contains [oX oY oZ R]^T where oX, oY, oZ are the 3D coordinates of the sphere center in [m] expressed in the object frame, and R is the sphere radius in [m]. |
Implements vpForwardProjection.
Definition at line 60 of file vpSphere.cpp.
References vpForwardProjection::oP.
Referenced by vpSphere(), and vpSphere().
| void vpSphere::setWorldCoordinates | ( | double | oX, |
| double | oY, | ||
| double | oZ, | ||
| double | R ) |
Set sphere 3D parameters from the 3D coordinates of its center and its radius. The 3D coordinates of the center are defined in the sphere frame.
| oX | : 3D coordinate of the sphere center along X axis in [m]. |
| oY | : 3D coordinate of the sphere center along X axis in [m]. |
| oZ | : 3D coordinate of the sphere center along X axis in [m]. |
| R | : Sphere radius in [m]. |
Definition at line 71 of file vpSphere.cpp.
References vpForwardProjection::oP.
|
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 &).
| cMo | : The homogeneous matrix corresponding to the pose between the camera frame and the object frame. |
Definition at line 101 of file vpForwardProjection.cpp.
References project().
Referenced by vpPose::computeResidual(), vpPose::computeResidual(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), setWorldCoordinates(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 73 of file vpTracker.h.
Referenced by vpCircle::changeFrame(), vpCylinder::changeFrame(), vpForwardProjection::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpFeatureBuilder::create(), get_cP(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::getA(), vpCylinder::getA(), vpCircle::getB(), vpCylinder::getB(), vpCircle::getC(), vpCylinder::getC(), vpCircle::getR(), vpCylinder::getR(), vpSphere::getR(), vpCircle::getX(), vpCylinder::getX(), vpSphere::getX(), vpCircle::getY(), vpCylinder::getY(), vpSphere::getY(), vpCircle::getZ(), vpCylinder::getZ(), vpSphere::getZ(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), vpPoint::set_Z(), vpTracker(), and vpTracker().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 79 of file vpTracker.h.
Referenced by init(), operator=(), vpTracker(), and vpTracker().
|
inherited |
Feature coordinates expressed in the object frame.
Definition at line 205 of file vpForwardProjection.h.
Referenced by vpCircle::changeFrame(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), get_oP(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpCircle::setWorldCoordinates(), vpCircle::setWorldCoordinates(), vpCylinder::setWorldCoordinates(), vpCylinder::setWorldCoordinates(), setWorldCoordinates(), vpLine::setWorldCoordinates(), vpLine::setWorldCoordinates(), vpLine::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpSphere::setWorldCoordinates(), vpSphere::setWorldCoordinates(), and vpForwardProjection().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 69 of file vpTracker.h.
Referenced by vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpCircle::display(), vpCircle::display(), vpCylinder::display(), vpCylinder::display(), vpLine::display(), vpLine::display(), vpPoint::display(), vpPoint::display(), vpSphere::display(), vpSphere::display(), vpFeatureDisplay::displayEllipse(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpCircle::get_mu02(), vpSphere::get_mu02(), vpCircle::get_mu11(), vpSphere::get_mu11(), vpCircle::get_mu20(), vpSphere::get_mu20(), vpCircle::get_n02(), vpSphere::get_n02(), vpCircle::get_n11(), vpSphere::get_n11(), vpCircle::get_n20(), vpSphere::get_n20(), get_p(), vpPoint::get_w(), vpCircle::get_x(), vpPoint::get_x(), vpSphere::get_x(), vpCircle::get_y(), vpPoint::get_y(), vpSphere::get_y(), vpLine::getRho(), vpCylinder::getRho1(), vpCylinder::getRho2(), vpLine::getTheta(), vpCylinder::getTheta1(), vpCylinder::getTheta2(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpMeTracker::init(), vpPoint::init(), vpSphere::init(), vpCircle::operator=(), operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpForwardProjection::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), vpPoint::set_y(), vpLine::setRho(), vpLine::setTheta(), vpTracker(), and vpTracker().