![]() |
Visual Servoing Platform
version 3.3.0
|
#include <vpLine.h>
Public Types | |
enum | vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection } |
Public Member Functions | |
void | init () |
vpLine () | |
virtual | ~vpLine () |
void | setRho (double rho) |
void | setTheta (double theta) |
double | getTheta () const |
double | getRho () const |
void | setWorldCoordinates (const double &A1, const double &B1, const double &C1, const double &D1, const double &A2, const double &B2, const double &C2, const double &D2) |
void | setWorldCoordinates (const vpColVector &oP1, const vpColVector &oP2) |
void | setWorldCoordinates (const vpColVector &oP) |
void | projection () |
void | projection (const vpColVector &cP, vpColVector &p) |
void | changeFrame (const vpHomogeneousMatrix &cMo, vpColVector &cP) |
void | changeFrame (const vpHomogeneousMatrix &cMo) |
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) |
vpLine * | duplicate () const |
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 a line in the object frame, the camera frame and the image plane. All the parameters must be set in meter.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 210 of file vpForwardProjection.h.
vpLine::vpLine | ( | ) |
Default constructor.
Definition at line 66 of file vpLine.cpp.
|
virtual |
Computes the line parameters cP in the camera frame thanks to the line parameters oP given in the object frame and the homogeneous matrix relative to the pose cMo between the object frame and the camera frame. Thus the computation gives the equations of the two planes needed to define the line in the camera frame thanks to the equations of the same two planes in the object frame.
In input of this method, the line parameters oP in the object frame are those from the vpForwardProjection::oP public attribute.
As a result of this method, line parameters cP in the camera frame are updated in the vpTracker::cP public attribute.
cMo | : The homogeneous matrix corresponding to the pose between the camera frame and the object frame. |
The code below shows how to use this method.
Implements vpForwardProjection.
Definition at line 292 of file vpLine.cpp.
|
virtual |
Computes the line parameters cP in the camera frame thanks to the line parameters oP given in the object frame and the homogeneous matrix relative to the pose between the camera frame and the object frame. Thus the computation gives the equations of the two planes needed to define the line in the desired frame thanks to the equations of the same two planes in the object frame.
In input of this method, the line parameters oP in the object frame are those from the vpForwardProjection::oP public attribute.
cMo | : The homogeneous matrix relative to the pose between the desired frame and the object frame. |
cP_ | : The vector which will contain the parameters of the two planes in the camera frame.
|
The code below shows how to use this method.
Implements vpForwardProjection.
Definition at line 335 of file vpLine.cpp.
Referenced by display().
|
virtual |
Displays the line in the image I thanks to the 2D parameters of the line p in the image plane (vpTracker::p) and the camera parameters which enable to convert the parameters from meter to pixel.
I | : The image where the line must be displayed. |
cam | : The camera parameters to enable the conversion from meter to pixel. |
color | : The desired color to display the line in the image. |
thickness | : Thickness of the feature representation. |
Implements vpForwardProjection.
Definition at line 472 of file vpLine.cpp.
|
virtual |
Displays the line in the image I thanks to the parameters in the object frame (vpForwardProjection::oP), the homogeneous matrix relative to the pose between the camera frame and the object frame and the camera parameters which enable to convert the features from meter to pixel.
I | : The image where the line must be displayed in overlay. |
cMo | : The homogeneous matrix corresponding to the pose between the camera frame and the object frame. |
cam | : The camera parameters to enable the conversion from meter to pixel. |
color | : The desired color to display the line in the image. |
thickness | : Thickness of the feature representation. |
Implements vpForwardProjection.
Definition at line 499 of file vpLine.cpp.
References changeFrame(), vpFeatureDisplay::displayLine(), and projection().
|
virtual |
Create an object with the same type.
Implements vpForwardProjection.
Definition at line 523 of file vpLine.cpp.
|
inlineinherited |
Definition at line 219 of file vpForwardProjection.h.
|
inline |
Gets the value corresponding to one of the two parameters used to define the line parametrization in the image plane.
|
inline |
|
virtual |
Initialize the memory space requested for the 2D line parameters (p) in the image plane and for 3D line parameters (oP and cP) respectively in the object frame and the camera frame.
Implements vpForwardProjection.
Definition at line 56 of file vpLine.cpp.
|
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 |
Computes the 2D parameters p of the line in the image plane thanks to the 3D line parameters cP in the camera frame located in the vpTracker::cP public attribute. The parameters are updated in the vpTracker::p public attribute.
The code below shows how to use this method.
Implements vpForwardProjection.
Definition at line 192 of file vpLine.cpp.
Referenced by display().
|
virtual |
Computes the 2D parameters p of the line in the image plane thanks to the 3D line features cP expressed in the camera frame. The image plane parameters are updated in output.
cP_ | : The vector containing the line features relative to the camera frame.
|
p_ | : The vector which contains the 2D line features expressed in the image plane.
|
vpException::fatalError | : Degenerate case, the image of the straight line is a point. |
Implements vpForwardProjection.
Definition at line 215 of file vpLine.cpp.
|
inlineinherited |
Definition at line 218 of file vpForwardProjection.h.
|
inline |
Sets the parameter used to define the line in the image plane.
rho | : The desired value for ![]() |
|
inline |
Sets the angle value used to define the line in the image plane.
theta | : The desired value for ![]() |
void vpLine::setWorldCoordinates | ( | const double & | A1, |
const double & | B1, | ||
const double & | C1, | ||
const double & | D1, | ||
const double & | A2, | ||
const double & | B2, | ||
const double & | C2, | ||
const double & | D2 | ||
) |
Sets the parameters oP which define the line in the object frame. As said in the class description, the line is defined as the intersection of two planes. The different parameters here define the equations of the two planes in the object frame. They are used to set the vpForwardProjection::oP public attribute.
Here are the 3D coordinates in the object frame.
A1,B1,C1,D1 | : The parameters used to define the first plane. |
A2,B2,C2,D2 | : The parameters used to define the second plane. |
Definition at line 84 of file vpLine.cpp.
|
virtual |
Sets the parameters oP which define the line in the object frame. As said in the class description, the line is defined as the intersection of two planes. Eight parameters are required to define the equations of the two planes in the object frame. They are used to set the vpForwardProjection::oP public attribute.
Here are the 3D coordinates in the object frame.
oP_ | : The column vector which contains the eight parameters needed to define the equations of the two planes in the object frame.
|
Implements vpForwardProjection.
Definition at line 116 of file vpLine.cpp.
void vpLine::setWorldCoordinates | ( | const vpColVector & | oP1, |
const vpColVector & | oP2 | ||
) |
Sets the parameters oP which define the line in the object frame. As said in the class description, the line is defined as the intersection of two planes. Eight parameters are required to define the equations of the two planes in the object frame. They are used to set the vpForwardProjection::oP public attribute.
Here are the 3D coordinates in the object frame.
oP1 | : The column vector which contains the four parameters needed to define the equations of the first plane.
|
oP2 | : The column vector which contains the four parameters needed to define the equations of the second plane.
|
Definition at line 145 of file vpLine.cpp.
|
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(), vpCylinder::init(), vpTracker::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=().
|
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(), vpCylinder::init(), 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(), vpCylinder::init(), vpTracker::operator=(), and vpPose::printPoint().