Visual Servoing Platform
version 3.6.1 under development (2024-11-14)
|
#include <visp3/core/vpCylinder.h>
Public Types | |
enum | vpLineCylinderType { line1 , line2 } |
enum | vpForwardProjectionDeallocatorType { user , vpDisplayForwardProjection } |
Public Member Functions | |
vpCylinder () | |
VP_EXPLICIT | vpCylinder (const vpColVector &oP) |
vpCylinder (double oA, double oB, double oC, 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 |
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) VP_OVERRIDE |
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) VP_OVERRIDE |
void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
vpCylinder * | duplicate () const VP_OVERRIDE |
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 () VP_OVERRIDE |
void | projection () VP_OVERRIDE |
void | projection (const vpColVector &cP, vpColVector &p) const VP_OVERRIDE |
void | setWorldCoordinates (const vpColVector &oP) VP_OVERRIDE |
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:
where R is the radius of the cylinder, oA, oB, oC are the coordinates of its direction vector and oX, oY, oZ are the coordinates of the nearest point belonging to the cylinder axis from the projection center. The corresponding parameters are located in vpForwardProjection::oP 7-dim internal vector. They correspond to oP = (oA, oB, oC, oX, oY, oZ, R). Setting the cylinder parameters is achieved through the constructors with parameters or setWorldCoordinates() methods. To get theses parameters use get_oP().
Perspective projection is achieved using projection() methods. The methods get_p(), getRho1(), getTheta1() and getRho2(), getTheta2() allow to access to the projected line parameters.
Definition at line 100 of file vpCylinder.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 70 of file vpForwardProjection.h.
Enumerator | |
---|---|
line1 | First limb of the cylinder. |
line2 | Second limb of the cylinder. |
Definition at line 103 of file vpCylinder.h.
vpCylinder::vpCylinder | ( | ) |
Default constructor.
Definition at line 86 of file vpCylinder.cpp.
References init().
Referenced by duplicate().
vpCylinder::vpCylinder | ( | const vpColVector & | o_P | ) |
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 103 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 118 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
|
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 230 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 242 of file vpCylinder.cpp.
References vpForwardProjection::oP, and vpColVector::resize().
Referenced by changeFrame(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCylinder::getModelForDisplay(), 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 405 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 365 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 419 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 387 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 347 of file vpCylinder.cpp.
References vpCylinder().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 95 of file vpTracker.h.
|
inlineinherited |
Return object parameters expressed in the 3D object frame.
Definition at line 155 of file vpForwardProjection.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 93 of file vpTracker.h.
|
inline |
Return cylinder cA parameter expressed in the camera frame.
Definition at line 158 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cB parameter expressed in the camera frame.
Definition at line 163 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cC parameter expressed in the camera frame.
Definition at line 168 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inlineinherited |
Definition at line 157 of file vpForwardProjection.h.
|
inline |
Return cylinder R parameter corresponding to the cylinder radius.
Definition at line 188 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return the parameter of the line corresponding to the projection of the cylinder in the image plane.
Definition at line 134 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the parameter of the line corresponding to the projection of the cylinder in the image plane.
Definition at line 147 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the parameter of the line corresponding to the projection of the cylinder in the image plane.
Definition at line 140 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return the parameter of the line corresponding to the projection of the cylinder in the image plane.
Definition at line 153 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return cylinder cX parameter expressed in the camera frame.
Definition at line 173 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cY parameter expressed in the camera frame.
Definition at line 178 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder cZ parameter expressed in the camera frame.
Definition at line 183 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 40 of file vpCylinder.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::resize().
Referenced by vpCylinder().
|
virtualinherited |
Print to stdout the feature parameters in:
Definition at line 49 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 64 of file vpForwardProjection.cpp.
References vpTracker::cP, vpTracker::p, and vpForwardProjection::projection().
Referenced by vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtFaceDepthDense::computeROI(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpKeyPoint::matchPointAndDetect(), vpMbtFaceDepthNormal::planeIsInvalid(), 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 80 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 147 of file vpCylinder.cpp.
References vpTracker::cP, and vpTracker::p.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
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.
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 177 of file vpCylinder.cpp.
References vpException::fatalError, and vpColVector::resize().
|
inlineinherited |
Definition at line 185 of file vpForwardProjection.h.
|
virtual |
Set the cylinder parameters expressed in the world frame.
o_P | : Vector of parameters . |
Implements vpForwardProjection.
Definition at line 63 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceCylinder::buildFrom(), 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 72 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 102 of file vpForwardProjection.cpp.
References vpForwardProjection::project().
Referenced by vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), vpImageDraw::drawFrame(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), and vpWireFrameSimulator::projectCameraTrajectory().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 73 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpCircle::changeFrame(), changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), 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(), 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 79 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Feature coordinates expressed in the object frame.
Definition at line 205 of file vpForwardProjection.h.
Referenced by changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpCircle::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), 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(), vpLine::setWorldCoordinates(), vpCircle::setWorldCoordinates(), setWorldCoordinates(), vpSphere::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 69 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpCircle::display(), display(), vpLine::display(), vpPoint::display(), vpSphere::display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpMeTracker::init(), vpCircle::init(), init(), vpLine::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().