![]() |
Visual Servoing Platform version 3.5.0
|
#include <vpSphere.h>
Inheritance diagram for vpSphere:Public Types | |
| enum | vpForwardProjectionDeallocatorType { user , vpDisplayForwardProjection } |
Public Member Functions | |
| vpSphere () | |
| vpSphere (const vpColVector &oP) | |
| vpSphere (double oX, double oY, double oZ, double R) | |
| virtual | ~vpSphere () |
| void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) const |
| void | changeFrame (const vpHomogeneousMatrix &cMo) |
| void | display (const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| void | display (const vpImage< vpRGBa > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
| void | display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, 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 |
| 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 () |
| void | projection (const vpColVector &cP, vpColVector &p) const |
| void | setWorldCoordinates (const vpColVector &oP) |
| void | setWorldCoordinates (double oX, double oY, double oZ, double R) |
Deprecated functions | |
| vp_deprecated double | get_mu20 () const |
| vp_deprecated double | get_mu11 () const |
| vp_deprecated double | get_mu02 () const |
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 |
Protected Member Functions | |
| void | init () |
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:
where
are the centered moments and a the area). These parameters are registered in vpTracker::p internal 5-dim vector and computed using projection() and projection(const vpColVector &cP, vpColVector &p) const. They could be retrieved using get_x(), get_y(), get_n20(), get_n11() and get_n02(). They correspond to 2D normalized sphere parameters with values expressed in meters. To get theses parameters use get_p(). Definition at line 82 of file vpSphere.h.
|
inherited |
Used for memory issue especially in the vpServo class.
| Enumerator | |
|---|---|
| user | |
| vpDisplayForwardProjection | |
Definition at line 73 of file vpForwardProjection.h.
| vpSphere::vpSphere | ( | ) |
Default constructor.
Definition at line 84 of file vpSphere.cpp.
References init().
Referenced by duplicate().
|
explicit |
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 94 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 109 of file vpSphere.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Destructor that does nothing.
Definition at line 118 of file vpSphere.cpp.
|
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 206 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 215 of file vpSphere.cpp.
References vpForwardProjection::oP, and vpColVector::resize().
Referenced by changeFrame(), 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 287 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 250 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 301 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 270 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 233 of file vpSphere.cpp.
References vpSphere().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 99 of file vpTracker.h.
|
inline |
. Definition at line 151 of file vpSphere.h.
|
inline |
. Definition at line 144 of file vpSphere.h.
|
inline |
. Definition at line 137 of file vpSphere.h.
|
inline |
Definition at line 109 of file vpSphere.h.
|
inline |
Definition at line 108 of file vpSphere.h.
|
inline |
Definition at line 107 of file vpSphere.h.
|
inlineinherited |
Return object parameters expressed in the 3D object frame.
Definition at line 165 of file vpForwardProjection.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 97 of file vpTracker.h.
|
inline |
Definition at line 104 of file vpSphere.h.
|
inline |
Definition at line 105 of file vpSphere.h.
|
inlineinherited |
Definition at line 167 of file vpForwardProjection.h.
|
inline |
Definition at line 114 of file vpSphere.h.
|
inline |
Definition at line 111 of file vpSphere.h.
|
inline |
Definition at line 112 of file vpSphere.h.
|
inline |
Definition at line 113 of file vpSphere.h.
|
protectedvirtual |
Initialize internal sphere parameters.
Implements vpForwardProjection.
Definition at line 45 of file vpSphere.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::resize().
Referenced by vpSphere().
|
virtualinherited |
Print to stdout the feature parameters in:
Definition at line 53 of file vpForwardProjection.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::t().
|
inherited |
Compute the feature parameters in the image plane (vpTracker::p) from the parameters in the camera frame (vpTracker::cP).
Definition at line 68 of file vpForwardProjection.cpp.
References vpTracker::cP, vpTracker::p, and vpForwardProjection::projection().
Referenced by vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtFaceDepthDense::computeROI(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpKeyPoint::matchPointAndDetect(), and vpForwardProjection::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 84 of file vpForwardProjection.cpp.
References vpForwardProjection::changeFrame(), and vpForwardProjection::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 127 of file vpSphere.cpp.
References vpTracker::cP, vpTracker::p, and projection().
Referenced by 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 143 of file vpSphere.cpp.
References vpColVector::resize(), vpMath::sqr(), and vpERROR_TRACE.
|
inlineinherited |
Definition at line 196 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 62 of file vpSphere.cpp.
References vpForwardProjection::oP.
Referenced by 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 73 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 106 of file vpForwardProjection.cpp.
References vpForwardProjection::project().
Referenced by vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), vpImageDraw::drawFrame(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpWireFrameSimulator::projectCameraTrajectory(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 77 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), projection(), vpPoint::set_W(), vpPoint::set_X(), vpPoint::set_Y(), and vpPoint::set_Z().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 83 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Feature coordinates expressed in the object frame.
Definition at line 228 of file vpForwardProjection.h.
Referenced by vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), changeFrame(), vpCircle::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), init(), vpForwardProjection::print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpLine::setWorldCoordinates(), vpCircle::setWorldCoordinates(), vpCylinder::setWorldCoordinates(), setWorldCoordinates(), and vpPoint::setWorldCoordinates().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 73 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpCircle::display(), vpCylinder::display(), vpLine::display(), vpPoint::display(), display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), init(), vpMeTracker::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpPoint::projection(), projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().