![]() |
Visual Servoing Platform
version 3.2.0
|
#include <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 95 of file vpCylinder.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 210 of file vpForwardProjection.h.
Enumerator | |
---|---|
line1 | First limb of the cylinder. |
line2 | Second limb of the cylinder. |
Definition at line 98 of file vpCylinder.h.
vpCylinder::vpCylinder | ( | ) |
Default constructor.
Definition at line 95 of file vpCylinder.cpp.
|
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.
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 134 of file vpCylinder.cpp.
|
virtual |
Default constructor.
Definition at line 144 of file vpCylinder.cpp.
|
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 258 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 ![]() |
Implements vpForwardProjection.
Definition at line 271 of file vpCylinder.cpp.
Referenced by vpMbtDistanceKltCylinder::display().
double vpCylinder::computeZ | ( | const double | x, |
const double | y | ||
) | const |
Compute the Z coordinate for the given normalized coordinate in the camera frame.
Definition at line 364 of file vpCylinder.cpp.
|
virtual |
Display the projection of the cylinder in the image as two lines.
Implements vpForwardProjection.
Definition at line 396 of file vpCylinder.cpp.
|
virtual |
Display the projection of the cylinder in the image as two lines.
Implements vpForwardProjection.
Definition at line 383 of file vpCylinder.cpp.
|
virtual |
for memory issue (used by the vpServo class only)
Implements vpForwardProjection.
Definition at line 374 of file vpCylinder.cpp.
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 150 of file vpCylinder.h.
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 154 of file vpCylinder.h.
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 158 of file vpCylinder.h.
|
inlineinherited |
Definition at line 219 of file vpForwardProjection.h.
|
inline |
Return cylinder parameter corresponding to the cylinder radius.
Definition at line 174 of file vpCylinder.h.
|
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 vpMbtDistanceKltCylinder::display().
|
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 vpMbtDistanceKltCylinder::display().
|
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 vpMbtDistanceKltCylinder::display().
|
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 vpMbtDistanceKltCylinder::display().
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 162 of file vpCylinder.h.
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 166 of file vpCylinder.h.
|
inline |
Return cylinder parameter expressed in the camera frame.
Definition at line 170 of file vpCylinder.h.
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 41 of file vpCylinder.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::resize().
|
virtualinherited |
Print to stdout the feature parameters in:
Definition at line 52 of file vpForwardProjection.cpp.
|
inherited |
Compute the feature parameters in the image plane (vpTracker::p) from the parameters in the camera frame (vpTracker::cP).
Definition at line 67 of file vpForwardProjection.cpp.
Referenced by vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtFaceDepthDense::computeROI(), and vpMbtFaceDepthNormal::displayFeature().
|
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 83 of file vpForwardProjection.cpp.
|
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 166 of file vpCylinder.cpp.
Referenced by vpMbtDistanceKltCylinder::display().
|
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 196 of file vpCylinder.cpp.
|
inlineinherited |
Definition at line 218 of file vpForwardProjection.h.
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 80 of file vpCylinder.cpp.
|
virtual |
Set the cylinder parameters expressed in the world frame.
o_P | : Vector of parameters ![]() |
Implements vpForwardProjection.
Definition at line 70 of file vpCylinder.cpp.
Referenced by vpMbtDistanceKltCylinder::buildFrom().
|
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 110 of file vpForwardProjection.cpp.
Referenced by vpProjectionDisplay::displayCamera(), vpWireFrameSimulator::projectCameraTrajectory(), and vpSimulatorAfma6::updateArticularPosition().
|
inherited |
Feature coordinates expressed in the camera frame cP.
Definition at line 74 of file vpTracker.h.
Referenced by vpCircle::init(), vpSphere::init(), init(), vpTracker::operator=(), vpPoint::operator=(), and vpPose::printPoint().
|
inherited |
Flag used to indicate if the feature parameters cP expressed in the camera frame are available.
Definition at line 80 of file vpTracker.h.
Referenced by 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 vpCircle::init(), vpSphere::init(), init(), vpPoint::operator=(), vpPose::printPoint(), and vpSphere::setWorldCoordinates().
|
inherited |
Feature coordinates expressed in the image plane p. They correspond to 2D normalized coordinates expressed in meters.
Definition at line 70 of file vpTracker.h.
Referenced by vpCircle::display(), vpSphere::display(), vpProjectionDisplay::display(), vpProjectionDisplay::displayCamera(), vpCircle::init(), vpSphere::init(), vpMeTracker::init(), init(), vpTracker::operator=(), vpPoint::operator=(), and vpPose::printPoint().