Visual Servoing Platform
version 3.1.0
|
#include <visp3/core/vpCircle.h>
Public Types | |
enum | vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection } |
Public Member Functions | |
void | init () |
vpCircle () | |
vpCircle (const vpColVector &oP) | |
vpCircle (const double A, const double B, const double C, const double X0, const double Y0, const double Z0, const double R) | |
virtual | ~vpCircle () |
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) |
double | getA () const |
double | getB () const |
double | getC () const |
double | getX () const |
double | getY () const |
double | getZ () const |
double | getR () const |
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, 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) |
vpCircle * | duplicate () const |
void | project () |
void | project (const vpHomogeneousMatrix &cMo) |
void | track (const vpHomogeneousMatrix &cMo) |
virtual void | print () const |
void | setDeallocate (vpForwardProjectionDeallocatorType d) |
vpForwardProjectionDeallocatorType | getDeallocate () |
Static Public Member Functions | |
static void | computeIntersectionPoint (const vpCircle &circle, const vpCameraParameters &cam, const double &rho, const double &theta, double &i, double &j) |
Public Attributes | |
vpColVector | oP |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Class that defines what is a circle.
Definition at line 58 of file vpCircle.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 211 of file vpForwardProjection.h.
vpCircle::vpCircle | ( | ) |
|
explicit |
Construct the circle from the intersection of a plane and a sphere.
oP_ | : oP[0], oP[1], oP[2] correspond to A, B, C from the plane equation Ax + By + Cz = 0. oP[3], oP[4], oP[5] correspond to X, Y, Z the coordinates of the center of the sphere. oP[6] corresponds to the radius of the sphere. |
Definition at line 99 of file vpCircle.cpp.
References init(), and setWorldCoordinates().
vpCircle::vpCircle | ( | const double | A, |
const double | B, | ||
const double | C, | ||
const double | X0, | ||
const double | Y0, | ||
const double | Z0, | ||
const double | R | ||
) |
Construct the circle from the intersection of a plane and a sphere.
A | : A from the plane equation Ax + By + Cz = 0. |
B | : B from the plane equation Ax + By + Cz = 0. |
C | : C from the plane equation Ax + By + Cz = 0. |
X0 | : X Coordinate of the center of the sphere. |
Y0 | : Y Coordinate of the center of the sphere. |
Z0 | : Z Coordinate of the center of the sphere. |
R | : Radius of the sphere. |
Definition at line 118 of file vpCircle.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Definition at line 125 of file vpCircle.cpp.
|
virtual |
perspective projection of the circle
Implements vpForwardProjection.
Definition at line 239 of file vpCircle.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCircle::display(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), vpMbtDistanceCircle::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMbtDistanceCircle::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
perspective projection of the circle
Implements vpForwardProjection.
Definition at line 267 of file vpCircle.cpp.
References vpTracker::cP, and vpForwardProjection::oP.
|
static |
Computes the coordinates of the point corresponding to the intersection between a circle and a line.
circle | : Circle to consider for the intersection. |
cam | : Camera parameters that have to be used for the intersection computation. |
rho | : The rho parameter of the line. |
theta | : The theta parameter of the line. |
i | : resulting i-coordinate of the intersection point. |
j | : resulting j-coordinate of the intersection point. |
Definition at line 332 of file vpCircle.cpp.
References vpCameraParameters::get_px(), vpCameraParameters::get_py(), vpCameraParameters::get_u0(), vpCameraParameters::get_v0(), vpTracker::p, and vpMath::sqr().
Referenced by vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Displays the feature in the image I thanks to the 2D feature parameters in the image plane (vpTracker::p) and the camera parameters which enable to convert the features from meter to pixel.
I | : The image where the feature must be displayed in overlay. |
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 294 of file vpCircle.cpp.
References vpFeatureDisplay::displayEllipse(), and vpTracker::p.
|
virtual |
Displays the feature in the image I thanks to the features in the object frame (vpForwardProjection::oP), the homogeneous matrix relative to the pose between the object frame and the camera 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 301 of file vpCircle.cpp.
References changeFrame(), vpFeatureDisplay::displayEllipse(), and projection().
|
virtual |
for memory issue (used by the vpServo class only)
Implements vpForwardProjection.
Definition at line 310 of file vpCircle.cpp.
References vpCircle().
|
inline |
Definition at line 72 of file vpCircle.h.
|
inline |
Definition at line 73 of file vpCircle.h.
|
inline |
Definition at line 74 of file vpCircle.h.
|
inlineinherited |
Definition at line 220 of file vpForwardProjection.h.
|
inline |
Definition at line 80 of file vpCircle.h.
References vpForwardProjection::changeFrame(), vpForwardProjection::display(), vpForwardProjection::duplicate(), vpColor::green, and vpForwardProjection::projection().
|
inline |
Definition at line 76 of file vpCircle.h.
|
inline |
Definition at line 77 of file vpCircle.h.
|
inline |
Definition at line 78 of file vpCircle.h.
|
virtual |
Default initialisation of the feature parameters:
Implements vpForwardProjection.
Definition at line 43 of file vpCircle.cpp.
References vpTracker::cP, vpForwardProjection::oP, vpTracker::p, and vpColVector::resize().
Referenced by vpCircle().
|
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(), 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 circle.
From the 3D parameters of the circle in the camera frame available in cP, computes the 2D parameters of the ellipse resulting from the perspective projection in the image plane. Those 2D parameters are available in p vector.
See vpCircle::projection(const vpColVector &, vpColVector &) for a more detailed description of the parameters.
Implements vpForwardProjection.
Definition at line 138 of file vpCircle.cpp.
References vpTracker::cP, and vpTracker::p.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCircle::display(), vpMbtDistanceKltCylinder::display(), vpMbtDistanceCylinder::display(), vpMbtDistanceCircle::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMbtDistanceCircle::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Perspective projection of the circle.
cP_ | 3D cercle input parameters. This vector is of dimension 7. It contains the following parameters: A, B, C, X0, Y0, Z0, r where
|
p_ | 2D circle output parameters. This is a 5 dimension vector. It contains the following parameters: xc, yc, m20, m11, m02 where:
|
Implements vpForwardProjection.
Definition at line 156 of file vpCircle.cpp.
References vpException::divideByZeroError, vpMath::sqr(), and vpERROR_TRACE.
|
inlineinherited |
Definition at line 219 of file vpForwardProjection.h.
|
virtual |
Set the world coordinates of the circle from the intersection of a plane and a sphere. We mean here the coordinates of the circle in the object frame
oP_ | : oP[0], oP[1], oP[2] correspond to A, B, C from the plane equation Ax + By + Cz = 0. oP[3], oP[4], oP[5] correspond to X, Y, Z the coordinates of the center of the sphere. oP[6] corresponds to the radius of the sphere. |
Implements vpForwardProjection.
Definition at line 61 of file vpCircle.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceCircle::buildFrom(), vpMbtDistanceKltCylinder::buildFrom(), vpMbtDistanceCylinder::buildFrom(), and vpCircle().
void vpCircle::setWorldCoordinates | ( | const double | A, |
const double | B, | ||
const double | C, | ||
const double | X0, | ||
const double | Y0, | ||
const double | Z0, | ||
const double | R | ||
) |
Set the world coordinates of the circle from the intersection of a plane and a sphere. We mean here the coordinates of the circle in the object frame
A | : A from the plane equation Ax + By + Cz = 0. |
B | : B from the plane equation Ax + By + Cz = 0. |
C | : C from the plane equation Ax + By + Cz = 0. |
X0 | : X Coordinate of the center of the sphere. |
Y0 | : Y Coordinate of the center of the sphere. |
Z0 | : Z Coordinate of the center of the sphere. |
R | : Radius of the sphere. |
Definition at line 75 of file vpCircle.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(), 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 75 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpPoint::changeFrame(), changeFrame(), vpSphere::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), init(), vpSphere::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), projection(), vpSphere::projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::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(), vpTracker::operator=(), and vpPoint::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(), changeFrame(), vpSphere::changeFrame(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), init(), vpSphere::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), setWorldCoordinates(), vpSphere::setWorldCoordinates(), vpPoint::setWorldCoordinates(), vpLine::setWorldCoordinates(), and vpCylinder::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(), computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpPoint::display(), display(), vpSphere::display(), vpCylinder::display(), vpProjectionDisplay::display(), vpLine::display(), vpProjectionDisplay::displayCamera(), vpPose::displayModel(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), init(), vpSphere::init(), vpMeTracker::init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpTracker::operator=(), vpPoint::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), projection(), vpSphere::projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().