![]() |
Visual Servoing Platform version 3.6.0
|
#include <vpCylinder.h>
Public Types | |
enum | vpLineCylinderType { line1 , line2 } |
enum | vpForwardProjectionDeallocatorType { user , vpDisplayForwardProjection } |
Public Member Functions | |
vpCylinder () | |
vpCylinder (const vpColVector &oP) | |
vpCylinder (double oA, double oB, double oC, double oX, double oY, double oZ, double R) | |
virtual | ~vpCylinder () |
void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) const |
void | changeFrame (const vpHomogeneousMatrix &cMo) |
double | computeZ (double x, double y) const |
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) |
vpCylinder * | duplicate () const |
double | getRho1 () const |
double | getTheta1 () const |
double | getRho2 () const |
double | getTheta2 () const |
double | getA () const |
double | getB () const |
double | getC () const |
double | getX () const |
double | getY () const |
double | getZ () const |
double | getR () const |
void | init () |
void | projection () |
void | projection (const vpColVector &cP, vpColVector &p) const |
void | setWorldCoordinates (const vpColVector &oP) |
void | setWorldCoordinates (double oA, double oB, double oC, 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 |
Class that defines a 3D cylinder in the object frame and allows forward projection of a 3D cylinder in the camera frame and in the 2D image plane by perspective projection. All the parameters must be set in meter.
A 3D cylinder of radius R is defined by the set of circles of radius R whose center belongs to a straight line perpendicular to the plane of the circles.
A 3D cylinder has the followings parameters:
Definition at line 97 of file vpCylinder.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 68 of file vpForwardProjection.h.
Enumerator | |
---|---|
line1 | First limb of the cylinder. |
line2 | Second limb of the cylinder. |
Definition at line 100 of file vpCylinder.h.
vpCylinder::vpCylinder | ( | ) |
Default constructor.
Definition at line 85 of file vpCylinder.cpp.
References init().
Referenced by duplicate().
|
explicit |
Create and initialize a cylinder with parameters oP = (oA, oB, oC, oX, oY, oZ, R) expressed in the object frame.
o_P | : 7-dim vector of parameters. |
Definition at line 102 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
vpCylinder::vpCylinder | ( | double | oA, |
double | oB, | ||
double | oC, | ||
double | oX, | ||
double | oY, | ||
double | oZ, | ||
double | R ) |
Create and initialize a cylinder with parameters oP = (oA, oB, oC, oX, oY, oZ, R) expressed in the object frame.
oA,oB,oC,oX,oY,oZ,R | : Cylinder parameters expressed in the object frame. |
Definition at line 117 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Default constructor.
Definition at line 126 of file vpCylinder.cpp.
|
virtual |
From the cylinder oP parameters expressed in the object frame, compute the cylinder internal parameters cP expressed in the camera frame.
cMo | : Camera to object frame transformation. |
Implements vpForwardProjection.
Definition at line 234 of file vpCylinder.cpp.
References changeFrame(), and vpTracker::cP.
|
virtual |
From the cylinder parameters oP expressed in the object frame, compute the cylinder parameters cP expressed in the camera frame.
cMo | : Camera to object frame transformation. |
cP_ | [out] : Parameters cP expressed in the camera frame. |
Implements vpForwardProjection.
Definition at line 246 of file vpCylinder.cpp.
References vpForwardProjection::oP, and vpColVector::resize().
Referenced by changeFrame(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), display(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::init(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
double vpCylinder::computeZ | ( | double | x, |
double | y ) const |
|
virtual |
Display the projection of a 3D cylinder in image I as two lines corresponding to the limbs.
I | : Image used as background. |
cam | : Camera parameters. |
color | : Color used to draw the point. |
thickness | : Thickness used to draw the point. |
Implements vpForwardProjection.
Definition at line 409 of file vpCylinder.cpp.
References vpFeatureDisplay::displayCylinder(), and vpTracker::p.
|
virtual |
Display the projection of a 3D cylinder in image I as two lines corresponding to the limbs. This method is non destructive wrt. cP and p internal 3D point parameters.
I | : Image used as background. |
cMo | : Homogeneous transformation from camera frame to object frame. The point 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 369 of file vpCylinder.cpp.
References changeFrame(), vpFeatureDisplay::displayCylinder(), and projection().
void vpCylinder::display | ( | const vpImage< vpRGBa > & | I, |
const vpCameraParameters & | cam, | ||
const vpColor & | color = vpColor::green, | ||
unsigned int | thickness = 1 ) |
Display the projection of a 3D cylinder in image I as two lines corresponding to the limbs.
I | : Image used as background. |
cam | : Camera parameters. |
color | : Color used to draw the point. |
thickness | : Thickness used to draw the point. |
Definition at line 423 of file vpCylinder.cpp.
References vpFeatureDisplay::displayCylinder(), and vpTracker::p.
void vpCylinder::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 cylinder in image I as two lines corresponding to the limbs. This method is non destructive wrt. cP and p internal 3D point parameters.
I | : Image used as background. |
cMo | : Homogeneous transformation from camera frame to object frame. The point 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 391 of file vpCylinder.cpp.
References changeFrame(), vpFeatureDisplay::displayCylinder(), and projection().
|
virtual |
For memory issue (used by the vpServo class only).
Implements vpForwardProjection.
Definition at line 351 of file vpCylinder.cpp.
References vpCylinder().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 94 of file vpTracker.h.
|
inlineinherited |
Return object parameters expressed in the 3D object frame.
Definition at line 160 of file vpForwardProjection.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 92 of file vpTracker.h.
|
inline |
Return cylinder cA parameter expressed in the camera frame.
Definition at line 155 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cB parameter expressed in the camera frame.
Definition at line 159 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cC parameter expressed in the camera frame.
Definition at line 163 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inlineinherited |
Definition at line 162 of file vpForwardProjection.h.
|
inline |
Return cylinder R parameter corresponding to the cylinder radius.
Definition at line 179 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return the
Definition at line 131 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the
Definition at line 144 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the
Definition at line 137 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the
Definition at line 150 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return cylinder cX parameter expressed in the camera frame.
Definition at line 167 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cY parameter expressed in the camera frame.
Definition at line 171 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cZ parameter expressed in the camera frame.
Definition at line 175 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 39 of file vpCylinder.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::resize().
Referenced by vpCylinder(), vpCylinder(), and vpCylinder().
|
virtualinherited |
Print to stdout the feature parameters in:
Definition at line 50 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 65 of file vpForwardProjection.cpp.
References vpTracker::cP, vpTracker::p, and vpForwardProjection::projection().
Referenced by vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtFaceDepthNormal::displayFeature(), 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 81 of file vpForwardProjection.cpp.
References vpForwardProjection::changeFrame(), and vpForwardProjection::projection().
|
virtual |
Perspective projection of the cylinder.
From the parameters of the cylinder in the camera frame, compute the perspective projection of the cylinder in the image plane.
Implements vpForwardProjection.
Definition at line 151 of file vpCylinder.cpp.
References vpTracker::cP, vpTracker::p, and projection().
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), display(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), projection(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Perspective projection of the cylinder.
From the parameters of the cylinder in the camera frame
cP_ | [in] : Cylinder parameters in the camera frame. |
p_ | [out] : Parameters of the cylinder in the image plane obtained by perspective projection. |
vpException::fatalError | : The camera is inside the cylinder. |
Implements vpForwardProjection.
Definition at line 181 of file vpCylinder.cpp.
References vpException::fatalError, and vpColVector::resize().
|
inlineinherited |
Definition at line 191 of file vpForwardProjection.h.
|
virtual |
Set the cylinder parameters
o_P | : Vector of parameters ![]() |
Implements vpForwardProjection.
Definition at line 62 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceCylinder::buildFrom(), vpMbtDistanceKltCylinder::buildFrom(), vpCylinder(), and vpCylinder().
void vpCylinder::setWorldCoordinates | ( | double | oA, |
double | oB, | ||
double | oC, | ||
double | oX, | ||
double | oY, | ||
double | oZ, | ||
double | R ) |
Set the cylinder parameters oP = (oA, oB, oC, oX, oY, oZ, R) expressed in the object frame.
oA,oB,oC,oX,oY,oZ,R | : Cylinder parameters in the object frame. |
Definition at line 71 of file vpCylinder.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 103 of file vpForwardProjection.cpp.
References vpForwardProjection::project().
Referenced by vpPose::computeResidual(), vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), vpWireFrameSimulator::projectCameraTrajectory(), vpSimulatorAfma6::updateArticularPosition(), and vpSimulatorViper850::updateArticularPosition().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 72 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), projection(), vpLine::projection(), vpLine::projection(), vpPoint::projection(), vpSphere::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 78 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Feature coordinates expressed in the object frame.
Definition at line 223 of file vpForwardProjection.h.
Referenced by vpCircle::changeFrame(), vpCircle::changeFrame(), changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpPoint::getWorldCoordinates(), vpCircle::init(), init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpForwardProjection::print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpCircle::setWorldCoordinates(), vpCircle::setWorldCoordinates(), setWorldCoordinates(), setWorldCoordinates(), vpLine::setWorldCoordinates(), vpLine::setWorldCoordinates(), vpLine::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpSphere::setWorldCoordinates(), and vpSphere::setWorldCoordinates().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 68 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpFeatureBuilder::create(), vpCircle::display(), vpCircle::display(), display(), display(), vpLine::display(), vpLine::display(), vpPoint::display(), vpPoint::display(), vpProjectionDisplay::display(), vpSphere::display(), vpSphere::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), init(), vpLine::init(), vpMeTracker::init(), vpPoint::init(), vpSphere::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), projection(), vpLine::projection(), vpPoint::projection(), vpSphere::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().