Visual Servoing Platform
version 3.3.0 under development (2020-02-17)
|
#include <visp3/core/vpCylinder.h>
Public Types | |
enum | vpLineCylinderType { line1, line2 } |
enum | vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection } |
Public Member Functions | |
vpCylinder () | |
vpCylinder (const vpColVector &oP) | |
vpCylinder (double A, double B, double C, double X0, double Y0, double Z0, double R) | |
virtual | ~vpCylinder () |
void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) |
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< unsigned char > &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) |
void | setWorldCoordinates (const vpColVector &oP) |
void | setWorldCoordinates (double A, double B, double C, double X0, double Y0, double Z0, double R) |
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 |
Class that defines what is a cylinder.
A cylinder may be represented by the equation: with
where is the radius of the cylinder, are the coordinates of its direction vector and are the coordinates of the nearest point belonging to the cylinder axis from the projection center.
Setting the cylinder parameters is achieved throw the constructors with parameters or the setWorldCoordinates() methods.
Considering the set of parameters expressed in the world frame, cylinder coordinates expressed in the camera frame are obtained using changeFrame().
The projection of a cylinder on the image plane is (for non-degenerated cases) a set of two straight lines with equation:
The projection is achieved using projection() methods. The methods getRho1(), getTheta1() and getRho2(), getTheta2() allow to access to the projected line parameters.
Definition at line 96 of file vpCylinder.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 211 of file vpForwardProjection.h.
Enumerator | |
---|---|
line1 | First limb of the cylinder. |
line2 | Second limb of the cylinder. |
Definition at line 99 of file vpCylinder.h.
vpCylinder::vpCylinder | ( | ) |
Default constructor.
Definition at line 95 of file vpCylinder.cpp.
References init().
Referenced by duplicate().
|
explicit |
Create and initialize a cylinder with parameters expressed in the world frame.
o_P | : Vector of parameters . |
Definition at line 118 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
vpCylinder::vpCylinder | ( | double | A, |
double | B, | ||
double | C, | ||
double | X0, | ||
double | Y0, | ||
double | Z0, | ||
double | R | ||
) |
Create and initialize a cylinder with parameters expressed in the world frame.
A,B,C,X0,Y0,Z0,R | : Cylinder parameters . |
Definition at line 134 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Default constructor.
Definition at line 143 of file vpCylinder.cpp.
|
virtual |
From the cylinder parameters expressed in the world frame, compute the cylinder parameters expressed in the camera frame.
cMo | : Camera to world frame transformation. |
cP_ | [out] : Parameters expressed in the camera frame. |
Implements vpForwardProjection.
Definition at line 270 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by changeFrame(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceKltCylinder::init(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
From the cylinder parameters expressed in the world frame, compute the cylinder internal parameters expressed in the camera frame.
cMo | : Camera to world frame transformation. |
Implements vpForwardProjection.
Definition at line 257 of file vpCylinder.cpp.
References changeFrame(), and vpTracker::cP.
double vpCylinder::computeZ | ( | double | x, |
double | y | ||
) | const |
Compute the Z coordinate for the given normalized coordinate in the camera frame.
Definition at line 363 of file vpCylinder.cpp.
References getA(), getB(), getC(), getR(), getX(), getY(), and getZ().
Referenced by vpMbtDistanceKltCylinder::getModelForDisplay().
|
virtual |
Display the projection of the cylinder in the image as two lines.
Implements vpForwardProjection.
Definition at line 395 of file vpCylinder.cpp.
References vpFeatureDisplay::displayCylinder(), and vpTracker::p.
|
virtual |
Display the projection of the cylinder in the image as two lines.
Implements vpForwardProjection.
Definition at line 382 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 373 of file vpCylinder.cpp.
References vpCylinder().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 150 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 154 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 158 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inlineinherited |
Definition at line 220 of file vpForwardProjection.h.
|
inline |
Return cylinder parameter corresponding to the cylinder radius.
Definition at line 174 of file vpCylinder.h.
References vpForwardProjection::init(), vpForwardProjection::projection(), and vpForwardProjection::setWorldCoordinates().
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 126 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::getModelForDisplay(), 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 139 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::getModelForDisplay(), 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 132 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::getModelForDisplay(), 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 145 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 162 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 166 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 170 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 42 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 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(), vpKeyPoint::computePose(), vpMbtFaceDepthDense::computeROI(), vpMbtFaceDepthNormal::displayFeature(), vpMbtFaceDepthNormal::getFeaturesForDisplay(), vpKeyPoint::matchPointAndDetect(), vpForwardProjection::track(), vpMbtDistanceCircle::~vpMbtDistanceCircle(), vpMbtDistanceCylinder::~vpMbtDistanceCylinder(), and vpMbtDistanceLine::~vpMbtDistanceLine().
|
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(), vpForwardProjection::projection(), and vpERROR_TRACE.
|
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 165 of file vpCylinder.cpp.
References vpTracker::cP, and vpTracker::p.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceKltCylinder::getModelForDisplay(), 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 195 of file vpCylinder.cpp.
References vpException::fatalError.
|
inlineinherited |
Definition at line 219 of file vpForwardProjection.h.
|
virtual |
Set the cylinder parameters expressed in the world frame.
o_P | : Vector of parameters . |
Implements vpForwardProjection.
Definition at line 71 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceKltCylinder::buildFrom(), vpMbtDistanceCylinder::buildFrom(), and vpCylinder().
void vpCylinder::setWorldCoordinates | ( | double | A, |
double | B, | ||
double | C, | ||
double | X0, | ||
double | Y0, | ||
double | Z0, | ||
double | R | ||
) |
Set the cylinder parameters expressed in the world frame.
A,B,C,X0,Y0,Z0,R | : Cylinder parameters . |
Definition at line 81 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 111 of file vpForwardProjection.cpp.
References vpForwardProjection::project(), and vpERROR_TRACE.
Referenced by vpPoseFeatures::addFeatureSegment(), vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), ImageDisplay(withContext)::displayFrameWithContext:::::, 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 75 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpPoint::changeFrame(), vpCircle::changeFrame(), vpSphere::changeFrame(), changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpCircle::init(), vpSphere::init(), vpPoint::init(), vpLine::init(), init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpSphere::projection(), vpPoint::projection(), vpLine::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 81 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Feature coordinates expressed in the object frame, also called world frame.
Definition at line 74 of file vpForwardProjection.h.
Referenced by vpPoint::changeFrame(), vpCircle::changeFrame(), vpSphere::changeFrame(), changeFrame(), vpLine::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), vpCircle::init(), vpSphere::init(), vpPoint::init(), vpLine::init(), init(), vpForwardProjection::print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpCircle::setWorldCoordinates(), vpSphere::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpLine::setWorldCoordinates(), and setWorldCoordinates().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 71 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpPoint::display(), vpCircle::display(), vpSphere::display(), display(), vpProjectionDisplay::display(), vpLine::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), ImageDisplay(withContext)::displayFrameWithContext:::::, vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpPoint::init(), vpLine::init(), init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpCircle::projection(), vpSphere::projection(), vpPoint::projection(), vpLine::projection(), projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().