Visual Servoing Platform
version 3.5.0 under development (2022-02-15)
|
#include <visp3/core/vpCircle.h>
Public Types | |
enum | vpForwardProjectionDeallocatorType { user, vpDisplayForwardProjection } |
Public Member Functions | |
vpCircle () | |
vpCircle (const vpColVector &oP) | |
vpCircle (double oA, double oB, double oC, double oX, double oY, double oZ, double R) | |
virtual | ~vpCircle () |
void | changeFrame (const vpHomogeneousMatrix &noMo, vpColVector &noP) const |
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< vpRGBa > &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) |
void | display (const vpImage< vpRGBa > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color=vpColor::green, unsigned int thickness=1) |
vpCircle * | duplicate () const |
double | get_x () const |
double | get_y () const |
double | get_n20 () const |
double | get_n11 () const |
double | get_n02 () const |
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) const |
void | setWorldCoordinates (const vpColVector &oP) |
void | setWorldCoordinates (double oA, double oB, double oC, double oX, double oY, double oZ, double R) |
Deprecated functions | |
vp_deprecated double | get_mu20 () const |
vp_deprecated double | get_mu11 () const |
vp_deprecated double | get_mu02 () const |
Public Member Functions Inherited from vpForwardProjection | |
vpColVector | get_oP () const |
vpForwardProjectionDeallocatorType | getDeallocate () |
virtual void | print () const |
void | project () |
void | project (const vpHomogeneousMatrix &cMo) |
void | setDeallocate (vpForwardProjectionDeallocatorType d) |
void | track (const vpHomogeneousMatrix &cMo) |
Public Member Functions Inherited from vpTracker | |
vpColVector | get_p () const |
vpColVector | get_cP () const |
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 | |
Public Attributes Inherited from vpForwardProjection | |
vpColVector | oP |
Public Attributes Inherited from vpTracker | |
vpColVector | p |
vpColVector | cP |
bool | cPAvailable |
Protected Member Functions | |
void | init () |
Class that defines a 3D circle in the object frame and allows forward projection of a 3D circle in the camera frame and in the 2D image plane by perspective projection. All the parameters must be set in meter.
Note that a 3D circle is defined from the intersection between a 3D plane and a 3D sphere.
A 3D circle has the followings parameters:
Definition at line 91 of file vpCircle.h.
|
inherited |
Used for memory issue especially in the vpServo class.
Enumerator | |
---|---|
user | |
vpDisplayForwardProjection |
Definition at line 73 of file vpForwardProjection.h.
vpCircle::vpCircle | ( | ) |
Default constructor that initialize internal vectors.
Definition at line 86 of file vpCircle.cpp.
References init().
Referenced by duplicate().
|
explicit |
Construct the circle from the intersection of a plane and a sphere.
oP_ | : This 7-dim vector defines the parameters oP[0], oP[1], oP[2] corresponding to parameters oA, oB, oC of the plane with equation oA*(X-oX)+oB*(Y-oY)+oC*(Z-oZ)=0 passing through the 3D sphere center. oP[3], oP[4], oP[5] correspond to oX, oY, oZ 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 | ( | double | oA, |
double | oB, | ||
double | oC, | ||
double | oX, | ||
double | oY, | ||
double | oZ, | ||
double | R | ||
) |
Construct the 3D circle from the intersection of a plane and a sphere with coordinates expressed in the object frame.
oA,oB,oC | : Parameters of the plane with equation oA*(X-oX)+oB*(Y-oY)+oC*(Z-oZ)=0 passing through the 3D sphere center. |
oX | : Coordinate of the center of the sphere along X-axis in the object frame. |
oY | : Coordinate of the center of the sphere along Y-axis in the object frame. |
oZ | : Coordinate of the center of the sphere along Z-axis in the object frame. |
R | : Radius of the sphere. |
Definition at line 118 of file vpCircle.cpp.
References init(), and setWorldCoordinates().
|
virtual |
Default destructor that does nothing.
Definition at line 127 of file vpCircle.cpp.
|
virtual |
From the 3D coordinates of the circle in the object frame oP that are set using for example vpCircle(double oA, double oB, double oC, double oX, double oY, double oZ, double R) or setWorldCoordinates(), compute the 3D coordinates of the circle in a new object frame noP = noMo * oP. Internal parameters of the circle remain unchanged.
noMo | : Transformation from camera to object frame. |
noP | : 3D normalized coordinates of the circle in the a new ojbect frame noP = (noA, noB, noC, noX, noY, noZ, R). |
Implements vpForwardProjection.
Definition at line 248 of file vpCircle.cpp.
References vpForwardProjection::oP, and vpColVector::resize().
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCircle::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCircle::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMbtDistanceCircle::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Perspective projection of the circle. Internal circle parameters are modified in cP.
cMo | : Homogeneous transformation from camera frame to object frame. |
Implements vpForwardProjection.
Definition at line 280 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 398 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::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCylinder::initMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Display the projection of a 3D circle in image I using internal coordinates in the image plane (x,y,n20,n11,n02) available in p
vector. These coordinates may be updated using projection().
I | : Image used as background. |
cam | : Camera parameters. |
color | : Color used to draw the circle. |
thickness | : Thickness used to draw the circle. |
Implements vpForwardProjection.
Definition at line 313 of file vpCircle.cpp.
References vpFeatureDisplay::displayEllipse(), and vpTracker::p.
void vpCircle::display | ( | const vpImage< vpRGBa > & | I, |
const vpCameraParameters & | cam, | ||
const vpColor & | color = vpColor::green , |
||
unsigned int | thickness = 1 |
||
) |
Display the projection of a 3D circle in image I using internal coordinates in the image plane (x,y,n20,n11,n02) available in p
vector. These coordinates may be updated using projection().
I | : Image used as background. |
cam | : Camera parameters. |
color | : Color used to draw the circle. |
thickness | : Thickness used to draw the circle. |
Definition at line 328 of file vpCircle.cpp.
References vpFeatureDisplay::displayEllipse(), and vpTracker::p.
|
virtual |
Display the projection of a sphere in image I. This method is non destructive wrt. cP and p internal circle parameters.
I | : Image used as background. |
cMo | : Homogeneous transformation from camera frame to object frame. The circle is considered as viewed from this camera position. |
cam | : Camera parameters. |
color | : Color used to draw the sphere. |
thickness | : Thickness used to draw the circle. |
Implements vpForwardProjection.
Definition at line 345 of file vpCircle.cpp.
References changeFrame(), vpFeatureDisplay::displayEllipse(), and projection().
void vpCircle::display | ( | const vpImage< vpRGBa > & | I, |
const vpHomogeneousMatrix & | cMo, | ||
const vpCameraParameters & | cam, | ||
const vpColor & | color = vpColor::green , |
||
unsigned int | thickness = 1 |
||
) |
Display the projection of a sphere in image I. This method is non destructive wrt. cP and p internal circle parameters.
I | : Image used as background. |
cMo | : Homogeneous transformation from camera frame to object frame. The circle is considered as viewed from this camera position. |
cam | : Camera parameters. |
color | : Color used to draw the sphere. |
thickness | : Thickness used to draw the circle. |
Definition at line 365 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 375 of file vpCircle.cpp.
References vpCircle().
|
inlineinherited |
Return object parameters expressed in the 3D camera frame.
Definition at line 99 of file vpTracker.h.
|
inline |
Definition at line 170 of file vpCircle.h.
|
inline |
Definition at line 163 of file vpCircle.h.
|
inline |
Definition at line 156 of file vpCircle.h.
|
inline |
Definition at line 117 of file vpCircle.h.
|
inline |
Definition at line 116 of file vpCircle.h.
|
inline |
Definition at line 115 of file vpCircle.h.
|
inlineinherited |
Return object parameters expressed in the 3D object frame.
Definition at line 165 of file vpForwardProjection.h.
|
inlineinherited |
Return object parameters expressed in the 2D image plane computed by perspective projection.
Definition at line 97 of file vpTracker.h.
|
inline |
Definition at line 112 of file vpCircle.h.
|
inline |
Definition at line 113 of file vpCircle.h.
|
inline |
Definition at line 119 of file vpCircle.h.
|
inline |
Definition at line 120 of file vpCircle.h.
|
inline |
Definition at line 121 of file vpCircle.h.
|
inlineinherited |
Definition at line 167 of file vpForwardProjection.h.
|
inline |
Definition at line 127 of file vpCircle.h.
References vpForwardProjection::init(), vpForwardProjection::projection(), and vpForwardProjection::setWorldCoordinates().
|
inline |
Definition at line 123 of file vpCircle.h.
|
inline |
Definition at line 124 of file vpCircle.h.
|
inline |
Definition at line 125 of file vpCircle.h.
|
protectedvirtual |
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(), 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(), and vpForwardProjection::projection().
|
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 &) const for a more detailed description of the parameters.
Implements vpForwardProjection.
Definition at line 140 of file vpCircle.cpp.
References vpTracker::cP, and vpTracker::p.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), vpMbtDistanceCylinder::computeInteractionMatrixError(), display(), vpMbtDistanceCircle::getModelForDisplay(), vpMbtDistanceKltCylinder::getModelForDisplay(), vpMbtDistanceCylinder::getModelForDisplay(), vpMbtDistanceCircle::initMovingEdge(), vpMbtDistanceCylinder::initMovingEdge(), vpMbtDistanceCircle::updateMovingEdge(), and vpMbtDistanceCylinder::updateMovingEdge().
|
virtual |
Perspective projection of the circle.
cP_ | 3D cercle input parameters expressed in the camera frame. This 7-dim vector contains the following parameters: cA, cB, cC, cX, cY, cZ, R where
|
p_ | 2D circle output parameters. This is a 5 dimension vector. It contains the following parameters: x, y, n20, n11, n02 where:
|
Implements vpForwardProjection.
Definition at line 160 of file vpCircle.cpp.
References vpException::divideByZeroError, vpColVector::resize(), and vpMath::sqr().
|
inlineinherited |
Definition at line 196 of file vpForwardProjection.h.
References vpTracker::init().
|
virtual |
Set the parameters of the 3D circle in the object frame.
oP_ | : This 7-dim vector defines the parameters oP[0], oP[1], oP[2] corresponding to parameters oA, oB, oC of the plane with equation oA*(X-oX)+oB*(Y-oY)+oC*(Z-oZ)=0 passing through the 3D sphere center. oP[3], oP[4], oP[5] correspond to oX, oY, oZ the coordinates of the center of the sphere. oP[6] corresponds to the radius of the sphere. |
Implements vpForwardProjection.
Definition at line 60 of file vpCircle.cpp.
References vpForwardProjection::oP.
Referenced by vpMbtDistanceCircle::buildFrom(), vpMbtDistanceKltCylinder::buildFrom(), vpMbtDistanceCylinder::buildFrom(), and vpCircle().
void vpCircle::setWorldCoordinates | ( | double | oA, |
double | oB, | ||
double | oC, | ||
double | oX, | ||
double | oY, | ||
double | oZ, | ||
double | R | ||
) |
Set the 3D circle coordinates in the object frame.
oA,oB,oC | : Parameters of the plane with equation oA*(X-oX)+oB*(Y-oY)+oC*(Z-oZ)=0 passing through the 3D sphere center. |
oX | : Coordinate of the center of the sphere along X-axis in the object frame. |
oY | : Coordinate of the center of the sphere along Y-axis in the object frame. |
oZ | : Coordinate of the center of the sphere along Z-axis in the object frame. |
R | : Radius of the sphere. |
Definition at line 72 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 106 of file vpForwardProjection.cpp.
References vpForwardProjection::project().
Referenced by vpPoseFeatures::addFeatureSegment(), vpPose::computeResidual(), vpProjectionDisplay::displayCamera(), 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 77 of file vpTracker.h.
Referenced by vpFeaturePoint3D::buildFrom(), vpSphere::changeFrame(), vpPoint::changeFrame(), changeFrame(), vpLine::changeFrame(), vpCylinder::changeFrame(), vpFeatureBuilder::create(), vpPoint::get_W(), vpPoint::get_X(), vpPoint::get_Y(), vpPoint::get_Z(), vpSphere::init(), init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpMbtPolygon::isVisible(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), 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 83 of file vpTracker.h.
Referenced by vpTracker::init(), and vpTracker::operator=().
|
inherited |
Feature coordinates expressed in the object frame.
Definition at line 228 of file vpForwardProjection.h.
Referenced by vpSphere::changeFrame(), vpPoint::changeFrame(), changeFrame(), vpLine::changeFrame(), vpCylinder::changeFrame(), vpPoint::get_oW(), vpPoint::get_oX(), vpPoint::get_oY(), vpPoint::get_oZ(), vpPoint::getWorldCoordinates(), vpSphere::init(), init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpForwardProjection::print(), vpPose::printPoint(), vpPoint::set_oW(), vpPoint::set_oX(), vpPoint::set_oY(), vpPoint::set_oZ(), vpSphere::setWorldCoordinates(), 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 73 of file vpTracker.h.
Referenced by vpMbtDistanceCircle::computeInteractionMatrixError(), computeIntersectionPoint(), vpMeterPixelConversion::convertEllipse(), vpFeatureBuilder::create(), vpSphere::display(), vpPoint::display(), display(), vpLine::display(), vpProjectionDisplay::display(), vpCylinder::display(), vpProjectionDisplay::displayCamera(), vpFeatureDisplay::displayEllipse(), vpPose::displayModel(), vpImageDraw::drawFrame(), vpPoint::get_w(), vpPoint::get_x(), vpPoint::get_y(), vpSphere::init(), vpMeTracker::init(), init(), vpPoint::init(), vpLine::init(), vpCylinder::init(), vpTracker::operator=(), vpForwardProjection::print(), vpPose::printPoint(), vpForwardProjection::project(), vpSphere::projection(), projection(), vpPoint::projection(), vpLine::projection(), vpCylinder::projection(), vpPoint::set_w(), vpPoint::set_x(), and vpPoint::set_y().