Visual Servoing Platform
version 3.0.1
|
#include <visp3/core/vpCylinder.h>
Public Types | |
enum | vpLineCylinderType { line1, line2 } |
enum | vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection } |
Public Member Functions | |
vpCylinder () | |
vpCylinder (const vpColVector &oP) | |
vpCylinder (const double A, const double B, const double C, const double X0, const double Y0, const double Z0, const double R) | |
virtual | ~vpCylinder () |
void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) |
void | changeFrame (const vpHomogeneousMatrix &cMo) |
double | computeZ (const double x, const double y) const |
void | display (const vpImage< unsigned char > &I, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const unsigned int thickness=1) |
void | display (const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, const 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 (const double A, const double B, const double C, const double X0, const double Y0, const double Z0, const 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 93 of file vpCylinder.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 215 of file vpForwardProjection.h.
Enumerator | |
---|---|
line1 |
First limb of the cylinder. |
line2 |
Second limb of the cylinder. |
Definition at line 96 of file vpCylinder.h.
vpCylinder::vpCylinder | ( | ) |
Default constructor.
Definition at line 105 of file vpCylinder.cpp.
References init().
Referenced by duplicate().
vpCylinder::vpCylinder | ( | const vpColVector & | o_P | ) |
Create and initialize a cylinder with parameters expressed in the world frame.
o_P | : Vector of parameters . |
Definition at line 130 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
vpCylinder::vpCylinder | ( | const double | A, |
const double | B, | ||
const double | C, | ||
const double | X0, | ||
const double | Y0, | ||
const double | Z0, | ||
const 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 144 of file vpCylinder.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Default constructor.
Definition at line 159 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 298 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by changeFrame(), vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), 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 283 of file vpCylinder.cpp.
References changeFrame(), and vpTracker::cP.
double vpCylinder::computeZ | ( | const double | x, |
const double | y | ||
) | const |
|
virtual |
Display the projection of the cylinder in the image as two lines.
Implements vpForwardProjection.
Definition at line 431 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 412 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 402 of file vpCylinder.cpp.
References vpCylinder().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 157 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 161 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 165 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inlineinherited |
Definition at line 227 of file vpForwardProjection.h.
|
inline |
Return cylinder parameter corresponding to the cylinder radius.
Definition at line 181 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 133 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), 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 146 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), 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::display(), vpMbtDistanceCylinder::display(), 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 152 of file vpCylinder.h.
Referenced by vpFeatureBuilder::create(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 169 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 173 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 177 of file vpCylinder.h.
Referenced by computeZ(), and vpFeatureBuilder::create().
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 44 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 59 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 75 of file vpForwardProjection.cpp.
References vpTracker::cP, vpTracker::p, and vpForwardProjection::projection().
Referenced by vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(), 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 95 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 185 of file vpCylinder.cpp.
References vpTracker::cP, and vpTracker::p.
Referenced by vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), 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 219 of file vpCylinder.cpp.
References vpException::fatalError.
|
inlineinherited |
Definition at line 226 of file vpForwardProjection.h.
|
virtual |
Set the cylinder parameters expressed in the world frame.
o_P | : Vector of parameters . |
Implements vpForwardProjection.
Definition at line 73 of file vpCylinder.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceKltCylinder::buildFrom(), vpMbtDistanceCylinder::buildFrom(), and vpCylinder().
void vpCylinder::setWorldCoordinates | ( | const double | A, |
const double | B, | ||
const double | C, | ||
const double | X0, | ||
const double | Y0, | ||
const double | Z0, | ||
const double | R | ||
) |
Set the cylinder parameters expressed in the world frame.
A,B,C,X0,Y0,Z0,R | : Cylinder parameters . |
Definition at line 86 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 126 of file vpForwardProjection.cpp.
References vpForwardProjection::project(), and vpERROR_TRACE.
Referenced by vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), vpPose::poseRansac(), 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(), 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(), vpLine::init(), vpPoint::init(), init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpPoint::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 83 of file vpTracker.h.
Referenced by vpTracker::init(), vpTracker::operator=(), and vpPoint::operator=().
|
inherited |
Feature coordinates expressed in the object frame, also called world frame.
Definition at line 73 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(), vpLine::init(), vpPoint::init(), init(), vpPoint::operator=(), 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 73 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpCircle::computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpPoint::display(), vpSphere::display(), vpCircle::display(), display(), vpProjectionDisplay::display(), vpLine::display(), vpProjectionDisplay::displayCamera(), vpPose::displayModel(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), vpLine::init(), vpPoint::init(), init(), vpTracker::operator=(), vpPoint::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().